import React from 'react'; import './SelectAllCheckbox.scss'; import { translateString } from '../utils/helpers/'; interface SelectAllCheckboxProps { totalCount: number; selectedCount: number; onSelectAll: () => void; onDeselectAll: () => void; } export const SelectAllCheckbox: React.FC = ({ totalCount, selectedCount, onSelectAll, onDeselectAll, }) => { const allSelected = totalCount > 0 && selectedCount === totalCount; const someSelected = selectedCount > 0 && selectedCount < totalCount; const handleChange = () => { if (allSelected || someSelected) { onDeselectAll(); } else { onSelectAll(); } }; const isDisabled = totalCount === 0; return (
); };