// @mui import { Theme } from '@mui/material/styles'; import { Box, SxProps, Checkbox, TableRow, TableCell, TableHead, TableSortLabel, } from '@mui/material'; // ---------------------------------------------------------------------- const visuallyHidden = { border: 0, margin: -1, padding: 0, width: '1px', height: '1px', overflow: 'hidden', position: 'absolute', whiteSpace: 'nowrap', clip: 'rect(0 0 0 0)', } as const; // ---------------------------------------------------------------------- type Props = { order?: 'asc' | 'desc'; orderBy?: string; headLabel: any[]; rowCount?: number; numSelected?: number; onSort?: (id: string) => void; onSelectAllRows?: (checked: boolean) => void; sx?: SxProps; }; export default function TableHeadCustom({ order, orderBy, rowCount = 0, headLabel, numSelected = 0, onSort, onSelectAllRows, sx, }: Props) { return ( {onSelectAllRows && ( 0 && numSelected < rowCount} checked={rowCount > 0 && numSelected === rowCount} onChange={(event: React.ChangeEvent) => onSelectAllRows(event.target.checked) } /> )} {headLabel.map((headCell) => ( {onSort && headCell.needSort !== false ? ( onSort(headCell.id)} sx={{ textTransform: 'capitalize' }} > {headCell.label} {orderBy === headCell.id ? ( {order === 'desc' ? 'sorted descending' : 'sorted ascending'} ) : null} ) : ( headCell.label )} ))} ); }