import type { TableBlockPayload } from "@/lib/blog-blocks"; import { tableVariantClass } from "@/components/blog-table-styles"; import { cn } from "@/lib/utils"; interface BlogTableProps { payload: TableBlockPayload; } /** Glass shell — matches HeroHeader bar styling. */ const tableGlassClass = "rounded-blog border border-border/10 bg-background/30 backdrop-blur-md shadow-lg overflow-hidden transition-[box-shadow,background-color] duration-300"; export function BlogTable({ payload }: BlogTableProps) { const { headers, rows, caption, variant = "one" } = payload; if (!headers.length && !rows.length) return null; return (
{headers.length > 0 ? ( {headers.map((header, index) => ( ) : null} {rows.length > 0 ? ( {rows.map((row, rowIndex) => ( {row.map((cell, cellIndex) => { const Tag = cellIndex === 0 && headers.length === 0 ? "th" : "td"; return ( ); })} ))} ) : null}
))}
{caption ? (
{caption}
) : null}
); }