import { Checkbox } from '@wix/design-system'; import React from 'react'; import { FiltersMap } from '@wix/bex-core'; import { observer } from 'mobx-react-lite'; import { PickerContentState } from '../../state'; export interface SelectAllCheckboxProps { state: PickerContentState; } function _SelectAllCheckbox( props: SelectAllCheckboxProps, ) { const { state } = props; const { toggleIsSelectAll, picker: { collection: { result: { isEmptyAndNotFetching }, query: { hasActiveFilters, limit }, bulkSelect: { selectedCountOrTotal, select: { isNotEmptyEnabledItems: hasEnabledCheckedItems }, allSelected, hasUnchecked, collection: { result: { total }, }, }, translate: t, }, }, } = state; return ( limit)} onChange={toggleIsSelectAll} indeterminate={hasEnabledCheckedItems && (!allSelected || hasUnchecked)} > {hasEnabledCheckedItems ? ( <> {t('cairo.deselectAll')} ({selectedCountOrTotal}) ) : ( <> {t('cairo.selectAll')} ({total}) )} ); } export const SelectAllCheckbox = observer(_SelectAllCheckbox);