import { PropsWithChildren, ReactNode } from "react"; type Column = { key: string; label: string; }; type TableProps = { columns: Column[]; rows: T[]; renderCell: (row: T, column: Column) => ReactNode; }; export function Table({ columns, rows, renderCell }: PropsWithChildren>) { return (
{columns.map((column) => ( ))} {rows.map((row, index) => ( {columns.map((column) => ( ))} ))}
{column.label}
{renderCell(row, column)}
); }