import { formatBytes } from '~/lib/util' import { useTranslation } from 'react-i18next' import DynamicIcon, { DynamicIconName } from './DynamicIcon' import type { CollectionWithStatus } from '../../types/collections' import classNames from 'classnames' import { IconCircleCheck } from '@tabler/icons-react' export interface CuratedCollectionCardProps { collection: CollectionWithStatus onClick?: (collection: CollectionWithStatus) => void; size?: 'small' | 'large' } const CuratedCollectionCard: React.FC = ({ collection, onClick, size = 'small' }) => { const { t } = useTranslation() const totalSizeBytes = collection.resources?.reduce( (acc, resource) => acc + resource.size_mb * 1024 * 1024, 0 ) return (
{ if (collection.all_installed) { return } if (onClick) { onClick(collection) } }} >

{collection.name}

{collection.all_installed && (

{t('common.allItemsDownloaded')}

)}

{collection.description}

{t('common.items', { count: collection.resources?.length, size: formatBytes(totalSizeBytes, 0) })}

) } export default CuratedCollectionCard