import { formatSize } from '@/utils/storageCleaner'; import { useLazyTranslation } from '@/utils/useLazyTranslation'; interface OptionItemProps { labelKey: string; checked: boolean; size?: number; isCount?: boolean; onChange: () => void; } export default function OptionItem({ labelKey, checked, size, isCount = false, onChange, }: OptionItemProps) { const { t } = useLazyTranslation('storageCleaner'); return (
{t(labelKey)} {size !== undefined && size > 0 ? ( {isCount ? `${size} ${t('storageCleaner:countUnit')}` : formatSize(size)} ) : ( {t('storageCleaner:noData')} )}
); }