Files
bee-dashboard/src/pages/files/DownloadActionBar.tsx
T
Ferenc Sárai 3ff645cab1 feat: add image opening functionality to DownloadActionBar (#725)
* feat: add image opening functionality to DownloadActionBar and Share components

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-05 16:51:09 +01:00

58 lines
1.6 KiB
TypeScript

import { Box, Grid } from '@mui/material'
import { ReactElement } from 'react'
import Bookmark from 'remixicon-react/BookmarkLineIcon'
import X from 'remixicon-react/CloseLineIcon'
import Download from 'remixicon-react/DownloadLineIcon'
import Link from 'remixicon-react/LinkIcon'
import ExpandableListItemActions from '../../components/ExpandableListItemActions'
import { SwarmButton } from '../../components/SwarmButton'
interface Props {
onOpen: () => void
onCancel: () => void
onDownload: () => void
onUpdateFeed: () => void
hasIndexDocument: boolean
isImage: boolean
loading: boolean
}
export function DownloadActionBar({
onOpen,
onCancel,
onDownload,
onUpdateFeed,
hasIndexDocument,
isImage,
loading,
}: Props): ReactElement {
return (
<Grid container justifyContent="space-between">
<ExpandableListItemActions>
{hasIndexDocument && (
<SwarmButton onClick={onOpen} iconType={Link} disabled={loading}>
View Website
</SwarmButton>
)}
{isImage && (
<SwarmButton onClick={onOpen} iconType={Link} disabled={loading}>
Open Image
</SwarmButton>
)}
<SwarmButton onClick={onDownload} iconType={Download} disabled={loading} loading={loading}>
Download
</SwarmButton>
<SwarmButton onClick={onCancel} iconType={X} disabled={loading} cancel>
Close
</SwarmButton>
</ExpandableListItemActions>
<Box mb={1} mr={1}>
<SwarmButton onClick={onUpdateFeed} iconType={Bookmark} disabled={loading}>
Update Feed
</SwarmButton>
</Box>
</Grid>
)
}