import { Grid } from '@mui/material' import { useRecoilValue } from 'recoil' import { activeDownloadsState } from '../atoms/downloads' import { useToast } from '../hooks/toast' import { useI18n } from '../hooks/useI18n' import { useRPC } from '../hooks/useRPC' import DownloadCard from './DownloadCard' const DownloadsCardView: React.FC = () => { const downloads = useRecoilValue(activeDownloadsState) const { i18n } = useI18n() const { client } = useRPC() const { pushMessage } = useToast() const abort = (id: string) => client.kill(id) return ( { downloads.map(download => ( abort(download.id)} onCopy={() => pushMessage(i18n.t('clipboardAction'), 'info')} /> )) } ) } export default DownloadsCardView