import useDownloads, { useDownloadsProps } from '~/hooks/useDownloads' import HorizontalBarChart from './HorizontalBarChart' import { extractFileName } from '~/lib/util' import StyledSectionHeader from './StyledSectionHeader' interface ActiveDownloadProps { filetype?: useDownloadsProps['filetype'] withHeader?: boolean } const ActiveDownloads = ({ filetype, withHeader = false }: ActiveDownloadProps) => { const { data: downloads } = useDownloads({ filetype }) return ( <> {withHeader && }
{downloads && downloads.length > 0 ? ( downloads.map((download) => (
)) ) : (

No active downloads

)}
) } export default ActiveDownloads