import { Checkbox } from '@wix/design-system';
import React from 'react';
import { observer } from 'mobx-react-lite';
function _SelectAllCheckbox(props) {
    const { state } = props;
    const { toggleIsSelectAll, picker: { collection: { result: { isEmptyAndNotFetching }, query: { hasActiveFilters }, bulkSelect: { selectedCountOrTotal, select: { isNotEmptyEnabledItems: hasEnabledCheckedItems }, allSelected, hasUnchecked, collection: { result: { total }, }, }, translate: t, }, }, } = state;
    return (React.createElement(Checkbox, { dataHook: "picker-select-all-checkbox", checked: allSelected, disabled: hasActiveFilters || isEmptyAndNotFetching, onChange: toggleIsSelectAll, indeterminate: hasEnabledCheckedItems && (!allSelected || hasUnchecked) }, hasEnabledCheckedItems ? (React.createElement(React.Fragment, null,
        t('cairo.deselectAll'),
        !hasActiveFilters && React.createElement(React.Fragment, null,
            " (",
            selectedCountOrTotal,
            ")"))) : (React.createElement(React.Fragment, null,
        t('cairo.selectAll'),
        !hasActiveFilters && React.createElement(React.Fragment, null,
            " (",
            total,
            ")")))));
}
export const SelectAllCheckbox = observer(_SelectAllCheckbox);
//# sourceMappingURL=SelectAllCheckbox.js.map