3ef1ad9574
* feat: add website and folder upload and download * feat: download-share-upload navigation * fix: check for files length in hasIndexDocument * fix: change router dependency * refactor: switch to @ethersphere/manfest-js * fix: hide previews on dropzone, fix spinner align, hide 0 size display * feat: add upload and download history * refactor: change drag and drop text * feat: make history ux better * refactor: improve code based on review * build: add missing react-router dependency * ci: remove beeload * revert(ci): remove beeload This reverts commit 4ce6cb0045a2d9aea3047ab395d214d8d368c532.
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
import { Button } from '@material-ui/core'
|
|
import { Clear } from '@material-ui/icons'
|
|
import { ReactElement } from 'react'
|
|
import { Download, Link } from 'react-feather'
|
|
import ExpandableListItemActions from '../../components/ExpandableListItemActions'
|
|
import { SwarmButton } from '../../components/SwarmButton'
|
|
|
|
interface Props {
|
|
onOpen: () => void
|
|
onDownload: () => void
|
|
onCancel: () => void
|
|
hasIndexDocument: boolean
|
|
loading: boolean
|
|
}
|
|
|
|
export function DownloadActionBar({ onOpen, onDownload, onCancel, hasIndexDocument, loading }: Props): ReactElement {
|
|
return (
|
|
<ExpandableListItemActions>
|
|
{hasIndexDocument && (
|
|
<SwarmButton onClick={onOpen} iconType={Link} disabled={loading}>
|
|
View Website
|
|
</SwarmButton>
|
|
)}
|
|
<SwarmButton onClick={onDownload} iconType={Download} disabled={loading} loading={loading}>
|
|
Download
|
|
</SwarmButton>
|
|
<Button onClick={onCancel} variant="contained" startIcon={<Clear />} disabled={loading}>
|
|
Close
|
|
</Button>
|
|
</ExpandableListItemActions>
|
|
)
|
|
}
|