import { Box, Checkbox, Divider, Grid, Typography } from '@mui/material'; import type { StorageCleanerOptions } from '@/types/storage'; import OptionItem from './OptionItem'; import { storageCleanerPageStyles } from '@/config/pageTheme'; import { useLazyTranslation } from '@/utils/useLazyTranslation'; interface StorageOptionsGridProps { options: StorageCleanerOptions; sizes: Record; allSelected: boolean; someSelected: boolean; onOptionChange: (key: keyof StorageCleanerOptions) => void; onSelectAll: (checked: boolean) => void; } export default function StorageOptionsGrid({ options, sizes, allSelected, someSelected, onOptionChange, onSelectAll, }: StorageOptionsGridProps) { const { t } = useLazyTranslation('storageCleaner'); const optionKeys: { key: keyof StorageCleanerOptions; isCount?: boolean }[] = [ { key: 'localStorage' }, { key: 'sessionStorage' }, { key: 'indexedDB' }, { key: 'cookies' }, { key: 'cacheStorage', isCount: true }, { key: 'serviceWorkers', isCount: true }, ]; return ( {optionKeys.map(({ key, isCount }) => ( onOptionChange(key)} /> ))} {t('storageCleaner:selectAll')} onSelectAll(e.target.checked)} color="warning" sx={storageCleanerPageStyles.OPTIONS_GRID_CHECKBOX} /> ); }