import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTMLAsync } from "@sportsdataverse/sdvtables/html";
const variants = [
{ label: "as shipped", options: {} },
{ label: 'striped: "true", fontSize: "14"', options: { striped: "true", fontSize: "14" } },
];
const tables = await Promise.all(
variants.map(({ label, options }) =>
renderHTMLAsync(
defineTable<Standing>()
.columns((c) => [c.logo("team", { league: "nfl" }), c.int("wins"), c.int("losses")])
.theme("fmtr-nytimes", { options })
.title(`fmtr-nytimes, ${label}`)
.build(),
STANDINGS.slice(0, 4),
),
),
);
tables.join("\n");