Closed toni-santos closed 3 weeks ago
It's still missing the CSS but (hopefully most of) the logic should be already done.
I'm using the following code as a test, in a test.tsx
file. Don't forget to add the function to index.js
.
import { Table } from "./modules/components/table";
import jsx from 'texsaur';
const tsxtest = () => {
return (
<div>
<p>Hello World</p>
<button onclick={() => console.log("testadsfasdf")}>test</button>
</div>
)
}
const tsxtest2 = (thing: string) => {
return (
<div>
<p>{thing}</p>
</div>
)
}
const headers:[string, (string | Element)][] = [["Name", "Name"], ["test", tsxtest()], ["idade", "Age"]];
const data = [
["d", tsxtest2("wow"), "30"],
["b", tsxtest2("wow1"), "25"],
["a", tsxtest2("wow2"), "40"],
["c", tsxtest2("wow3"), "35"]
];
const content = <Table tableName="test" headers={headers} data={data} />
export const test = () => {
console.log("test");
document.body.appendChild(content);
return null;
}
Closes #177 Implements a generic extensible table component.