This commit is contained in:
2024-04-21 14:42:52 +02:00
parent 4b69674ede
commit 8a25f53c99
10700 changed files with 55767 additions and 14201 deletions

View File

@@ -0,0 +1,43 @@
import { Button, IconButton } from '@chakra-ui/react'
import cx from 'classnames'
import { File } from '@/client/api/file'
import downloadFile from '@/helpers/download-file'
import { IconDownload } from '@/lib'
export type DrawerDownloadButtonProps = {
file: File
isCollapsed?: boolean
}
const DrawerDownloadButton = ({
file,
isCollapsed,
}: DrawerDownloadButtonProps) => {
if (isCollapsed) {
return (
<IconButton
icon={<IconDownload />}
variant="solid"
colorScheme="blue"
aria-label="Download"
title="Download"
className={cx('h-[50px]', 'w-[50px]', 'p-1.5', 'rounded-md')}
onClick={() => downloadFile(file)}
/>
)
} else {
return (
<Button
leftIcon={<IconDownload />}
variant="solid"
colorScheme="blue"
className={cx('h-[50px]', 'w-full', 'p-1.5', 'rounded-md')}
onClick={() => downloadFile(file)}
>
Download
</Button>
)
}
}
export default DrawerDownloadButton