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