fix: revamp uploaded file modal
This commit is contained in:
parent
8c5ff4f230
commit
decd7f7918
1 changed files with 20 additions and 18 deletions
|
@ -1,6 +1,6 @@
|
|||
import { Button, Table, Title } from '@mantine/core';
|
||||
import { ActionIcon, Box, Button, Group, Stack, Table, Title, Tooltip } from '@mantine/core';
|
||||
import { showNotification } from '@mantine/notifications';
|
||||
import { CopyIcon } from 'components/icons';
|
||||
import { CopyIcon, LinkIcon } from 'components/icons';
|
||||
import Link from 'components/Link';
|
||||
|
||||
export default function showFilesModal(clipboard, modals, files: string[]) {
|
||||
|
@ -26,25 +26,27 @@ export default function showFilesModal(clipboard, modals, files: string[]) {
|
|||
size: 'auto',
|
||||
children: (
|
||||
<Table withBorder={false} withColumnBorders={false} highlightOnHover horizontalSpacing={'sm'}>
|
||||
<tbody>
|
||||
<Stack>
|
||||
{files.map((file, idx) => (
|
||||
<tr key={file}>
|
||||
<td>
|
||||
<Group key={idx} position='apart'>
|
||||
<Group position='left'>
|
||||
<Link href={file}>{file}</Link>
|
||||
</td>
|
||||
<td>
|
||||
<Button.Group>
|
||||
<Button variant='outline' onClick={() => copy(idx)}>
|
||||
Copy
|
||||
</Button>
|
||||
<Button variant='outline' onClick={() => open(idx)}>
|
||||
Open
|
||||
</Button>
|
||||
</Button.Group>
|
||||
</td>
|
||||
</tr>
|
||||
</Group>
|
||||
<Group position='right'>
|
||||
<Tooltip label='Open link in a new tab'>
|
||||
<ActionIcon onClick={() => open(idx)} variant='filled' color='primary'>
|
||||
<LinkIcon />
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
<Tooltip label='Copy link to clipboard'>
|
||||
<ActionIcon onClick={() => copy(idx)} variant='filled' color='primary'>
|
||||
<CopyIcon />
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
</Group>
|
||||
</Group>
|
||||
))}
|
||||
</tbody>
|
||||
</Stack>
|
||||
</Table>
|
||||
),
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue