diff --git a/src/components/ui/DataTable.tsx b/src/components/ui/DataTable.tsx index 73ca407..1dd2605 100644 --- a/src/components/ui/DataTable.tsx +++ b/src/components/ui/DataTable.tsx @@ -6,6 +6,9 @@ import { flexRender, getCoreRowModel, getFilteredRowModel, + getPaginationRowModel, + getSortedRowModel, + SortingState, useReactTable } from '@tanstack/react-table'; @@ -40,13 +43,19 @@ export function DataTable({ createGroup }: DataTableProps & { createGroup?: () => void }) { const [columnFilters, setColumnFilters] = useState([]); + const [sorting, setSorting] = useState([]); + const table = useReactTable({ data, columns, getCoreRowModel: getCoreRowModel(), onColumnFiltersChange: setColumnFilters, + getPaginationRowModel: getPaginationRowModel(), + onSortingChange: setSorting, + getSortedRowModel: getSortedRowModel(), getFilteredRowModel: getFilteredRowModel(), state: { + sorting, columnFilters } }); @@ -105,6 +114,24 @@ export function DataTable({ +
+ + +
); }