import type { BodyElement } from "../../lib/api"; import { ChartRenderer } from "../charts/ChartRenderer"; interface BodyRendererProps { elements: BodyElement[]; } export function BodyRenderer({ elements }: BodyRendererProps) { if (elements.length === 0) { return (
No content yet. Use the CLI below to add content.
); } return (
{elements.map((element, index) => ( ))}
); } function BodyElementRenderer({ element }: { element: BodyElement }) { switch (element.type) { case "heading": return ; case "paragraph": return ; case "chart": return ( ); case "image": return ( ); default: return null; } } function HeadingElement({ level, text }: { level: number; text: string }) { const className = "font-mono text-[#9bc3ff]"; switch (level) { case 1: return

{text}

; case 2: return

{text}

; case 3: return

{text}

; case 4: return

{text}

; case 5: return
{text}
; case 6: return
{text}
; default: return

{text}

; } } function ParagraphElement({ text }: { text: string }) { return

{text}

; } function ChartElement({ chartType, data, title, config, }: { chartType: "line" | "bar" | "pie" | "area"; data: Record[]; title?: string; config?: Record; }) { return (
); } function ImageElement({ src, alt, caption, }: { src: string; alt?: string; caption?: string; }) { return (
{alt {caption && (
{caption}
)}
); }