24 lines
677 B
TypeScript
24 lines
677 B
TypeScript
|
|
export const tableColumnWidth = `interface RowData {
|
||
|
|
name: string;
|
||
|
|
age: number;
|
||
|
|
email: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export default function Page() {
|
||
|
|
const headers: Header<RowData>[] = [
|
||
|
|
{ key: "name", label: "Nombre", width: "50%" },
|
||
|
|
{ key: "age", label: "Edad", width: "15%" },
|
||
|
|
{ key: "email", label: "Correo electrónico", width: "35%" },
|
||
|
|
];
|
||
|
|
|
||
|
|
const data: RowData[] = [
|
||
|
|
{ name: "Juan", age: 20, email: "juan@example.com" },
|
||
|
|
{ name: "María", age: 25, email: "maria@example.com" },
|
||
|
|
{ name: "Pedro", age: 30, email: "pedro@example.com" },
|
||
|
|
{ name: "Luisa", age: 28, email: "luisa@example.com" },
|
||
|
|
];
|
||
|
|
|
||
|
|
return <Table headers={headers} data={data} />;
|
||
|
|
}
|
||
|
|
`;
|