mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
24 lines
567 B
TypeScript
24 lines
567 B
TypeScript
import { Table } from '@tanstack/react-table';
|
|
|
|
import Tristate from '../common/Tristate';
|
|
|
|
interface SelectAllProps<TData> {
|
|
table: Table<TData>
|
|
}
|
|
|
|
function SelectAll<TData>({ table }: SelectAllProps<TData>) {
|
|
return (
|
|
<Tristate
|
|
tabIndex={-1}
|
|
value={
|
|
!table.getIsAllPageRowsSelected() && table.getIsSomePageRowsSelected() ? null :
|
|
table.getIsAllPageRowsSelected()
|
|
}
|
|
tooltip='Выделить все'
|
|
setValue={value => table.toggleAllPageRowsSelected(value !== false)}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export default SelectAll;
|