import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown'; import { TableCell, type TableCellBaseProps } from '@mui/material'; import { equals, isEmpty, not } from 'ramda'; import PopoverMenu from '../../../PopoverMenu'; import Checkbox from '../../Checkbox'; import type { PredefinedRowSelection } from '../../models'; import { labelPredefinedRowsSelectionMenu } from '../../translatedLabels'; import PredefinedSelectionList from '../_internals/PredefinedSelectionList'; export interface SelectActionListingHeaderCellProps { onSelectAllClick: (event: React.ChangeEvent) => void; onSelectRowsWithCondition: ( condition: (row: Record) => boolean ) => void; predefinedRowsSelection: Array; rowCount: number; selectedRowCount: number; } const SelectActionListingHeaderCell = ({ rowCount, onSelectAllClick, selectedRowCount, predefinedRowsSelection, onSelectRowsWithCondition }: SelectActionListingHeaderCellProps): JSX.Element => { const hasRows = not(equals(rowCount, 0)); return ( } > 0 && selectedRowCount < rowCount } onChange={onSelectAllClick} slotProps={{ input: { 'aria-label': 'Select all' } }} /> {not(isEmpty(predefinedRowsSelection)) ? ( } title={labelPredefinedRowsSelectionMenu} > {(props: { close?: () => void } | undefined): JSX.Element => ( undefined)} onSelectRowsWithCondition={onSelectRowsWithCondition} predefinedRowsSelection={predefinedRowsSelection} /> )} ) : (
)} ); }; export { SelectActionListingHeaderCell };