import {Column, flexRender, getCoreRowModel, useReactTable} from "@tanstack/react-table"; export default function List({data, columns}: {data: T[]; columns: any[]}) { const table = useReactTable({ data, columns: columns, getCoreRowModel: getCoreRowModel(), }); return ( {table.getHeaderGroups().map((headerGroup) => ( {headerGroup.headers.map((header) => ( ))} ))} {table.getRowModel().rows.map((row) => ( {row.getVisibleCells().map((cell) => ( ))} ))}
{header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext())}
{flexRender(cell.column.columnDef.cell, cell.getContext())}
); }