import { ReactNode } from 'react' interface TableProps { headers: string[] rows: (string | ReactNode)[][] } export function Table({ headers, rows }: TableProps) { const columnCount = headers.length return (
{columnCount === 3 ? ( <> ) : columnCount === 4 ? ( <> ) : ( headers.map((_, i) => ) )} {headers.map((header, i) => ( ))} {rows.map((row, i) => ( {row.map((cell, j) => ( ))} ))}
{header}
{cell}
) }