summaryrefslogtreecommitdiffstats
path: root/src/server/template/table.ts
diff options
context:
space:
mode:
author2024-04-07 19:43:04 +0530
committer2024-04-07 19:43:04 +0530
commit900a707fdcb04e5739126ec2509fdc39fee7491c (patch)
tree427c9155bcbcca013f4c352888d8d88984e4e027 /src/server/template/table.ts
parent0.5.1 (diff)
downloadsudomsg-900a707fdcb04e5739126ec2509fdc39fee7491c.tar
sudomsg-900a707fdcb04e5739126ec2509fdc39fee7491c.tar.gz
sudomsg-900a707fdcb04e5739126ec2509fdc39fee7491c.tar.bz2
sudomsg-900a707fdcb04e5739126ec2509fdc39fee7491c.tar.lz
sudomsg-900a707fdcb04e5739126ec2509fdc39fee7491c.tar.xz
sudomsg-900a707fdcb04e5739126ec2509fdc39fee7491c.tar.zst
sudomsg-900a707fdcb04e5739126ec2509fdc39fee7491c.zip
Rewrote Site in 11ty
Still need to Update the content
Diffstat (limited to 'src/server/template/table.ts')
-rw-r--r--src/server/template/table.ts32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/server/template/table.ts b/src/server/template/table.ts
deleted file mode 100644
index 34f2771..0000000
--- a/src/server/template/table.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-import { c, node } from "./vdom.js";
-import { Attribute, caption, table as Table, td, th, thead, tr } from "./html.js";
-
-interface TableAttr extends Attribute {
- header: boolean;
- data: node[][];
- caption?: string;
-}
-
-export default function table({ header, data, caption: captio, ...attr }: TableAttr) {
- const capt = captio ? c(caption, {}, captio) : undefined;
- if (header) {
- const [head, ...tbldata] = data;
- return c(Table, attr,
- ...tbldata.map(
- row => c(tr, {}, ...row.map(
- key => c(td, {}, key ?? "")
- ))
- ),
- c(thead, {}, c(tr, {}, ...(head ?? []).map(e => c(th, {}, e ?? "")))),
- ...(capt ? [capt] : [])
- );
- } else {
- return c(Table, attr, ...data.map(
- row => c(tr, {}, ...row.map(
- key => c(td, {}, key ?? "")
- ))
- ),
- ...(capt ? [capt] : [])
- );
- }
-}