import React from 'react';
import Checkbox from '../../Checkbox';
import { dataHooks } from '../SelectorList.helpers';
const ToggleAllCheckbox = ({ selectAllText = 'Select all', deselectAllText = 'Deselect all', enabledItemsAmount, selectedEnabledItemsAmount, selectAll, deselectAll, size = 'medium', dataHook = dataHooks.toggleAllCheckbox, }) => {
    const cases = {
        select: {
            text: selectAllText,
            number: enabledItemsAmount,
            onChange: selectAll,
            indeterminate: false,
            checked: false,
        },
        deselect: {
            text: deselectAllText,
            number: selectedEnabledItemsAmount,
            onChange: deselectAll,
            indeterminate: selectedEnabledItemsAmount < enabledItemsAmount,
            checked: true,
        },
    };
    const { text, number: num, onChange, checked, indeterminate, } = selectedEnabledItemsAmount ? cases.deselect : cases.select;
    return (React.createElement(Checkbox, { dataHook: dataHook, checked: checked, onChange: onChange, indeterminate: indeterminate, size: size }, ` ${text} (${num})`));
};
export default ToggleAllCheckbox;
//# sourceMappingURL=ToggleAllCheckbox.js.map