mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-22 07:29:08 +00:00
refactor: stabilise table options
This commit is contained in:
committed by
Carlos Valente
parent
84a5b4fe5b
commit
2867c8301d
@@ -1,4 +1,4 @@
|
|||||||
import { useRef } from 'react';
|
import { useCallback, useRef } from 'react';
|
||||||
import { ColumnDef, flexRender, getCoreRowModel, useReactTable } from '@tanstack/react-table';
|
import { ColumnDef, flexRender, getCoreRowModel, useReactTable } from '@tanstack/react-table';
|
||||||
import Color from 'color';
|
import Color from 'color';
|
||||||
import {
|
import {
|
||||||
@@ -92,13 +92,13 @@ export default function CuesheetTable(props: CuesheetTableProps) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const setAllVisible = () => {
|
const setAllVisible = useCallback(() => {
|
||||||
table.toggleAllColumnsVisible(true);
|
table.toggleAllColumnsVisible(true);
|
||||||
};
|
}, []);
|
||||||
|
|
||||||
const resetColumnResizing = () => {
|
const resetColumnResizing = useCallback(() => {
|
||||||
setColumnSizing({});
|
setColumnSizing({});
|
||||||
};
|
}, []);
|
||||||
|
|
||||||
const headerGroups = table.getHeaderGroups();
|
const headerGroups = table.getHeaderGroups();
|
||||||
const rowModel = table.getRowModel();
|
const rowModel = table.getRowModel();
|
||||||
|
|||||||
Reference in New Issue
Block a user