import * as React from 'react';
import {Fragment} from 'react';
const ROWS = 25;
const COLS = 4;
function TableCell({row, col}: {row: number, col: number}): React.Node {
return <td>{`r${row}c${col}`}</td>;
}
function TableColumnHeader({col}: {col: number}): React.Node {
return <th>{`Column ${col}`}</th>;
}
function TableRow({row}: {row: number}): React.Node {
return (
<tr>
{Array.from({length: COLS}, (_, col) => (
<TableCell key={col} row={row} col={col} />
))}
</tr>
);
}
function TableHeaderRow(): React.Node {
return (
<tr>
{Array.from({length: COLS}, (_, col) => (
<TableColumnHeader key={col} col={col} />
))}
</tr>
);
}
function TableBody(): React.Node {
return (
<tbody>
{Array.from({length: ROWS}, (_, row) => (
<TableRow key={row} row={row} />
))}
</tbody>
);
}
function Table(): React.Node {
return (
<table>
<thead>
<TableHeaderRow />
</thead>
<TableBody />
</table>
);
}
export default function SearchableTable(): React.Node {
return (
<Fragment>
<h1>Searchable Table</h1>
<Table />
</Fragment>
);
}