"use client" import {useState} from "react"; import { ColumnDef, getCoreRowModel, getPaginationRowModel, getSortedRowModel, SortingState, useReactTable } from "@tanstack/react-table" import {DataTable} from "@/components/wrappers/table/data-table"; import {TablePagination} from "@/components/wrappers/table/table-pagination"; interface DataTableProps { columns: ColumnDef[] data: TData[] } export function DataTableWithPagination({columns, data}: DataTableProps) { const [sorting, setSorting] = useState([]) const table = useReactTable({ data, columns, getCoreRowModel: getCoreRowModel(), getPaginationRowModel: getPaginationRowModel(), onSortingChange: setSorting, getSortedRowModel: getSortedRowModel(), state: { sorting, }, }) return (
) }