import React from "react" import * as z from "zod" const layoutId = "table-of-contents-layout" const layoutName = "Table Of Contents" const layoutDescription = "Header with brand marker, title, optional description, and a two-column table of contents list" const ToCItemSchema = z .object({ title: z.string().min(4).max(50).default("Introduction").meta({ description: "Section title. Max 50 characters", }), }) .default({ title: "Introduction", }) const Schema = z .object({ topBar: z .object({ marker: z.string().min(1).max(3).default("2").meta({ description: "Numeric marker on the top bar. Up to 3 digits", }), }) .default({ marker: "2" }), title: z .string() .min(12) .max(68) .default("Table Of Contents") .meta({ description: "Main slide title. Max 10 words" }), description: z .string() .min(0) .max(200) .default( "Use this as a quick guide to navigate the presentation sections." ) .meta({ description: "Lead paragraph. Optional. Max 35 words" }), items: z .array(ToCItemSchema) .min(3) .max(10) .default([ { title: "Introduction" }, { title: "Problem Statement" }, { title: "Solution" }, { title: "Market" }, { title: "Business Model" }, { title: "Roadmap" }, { title: "Team" }, { title: "Go-To-Market" }, { title: "Financials" }, { title: "Ask" }, ]) .meta({ description: "List of contents (3-10)" }), }) .default({ topBar: { marker: "2" }, title: "Table Of Contents", description: "Use this as a quick guide to navigate the presentation sections.", items: [ { title: "Introduction" }, { title: "Problem Statement" }, { title: "Solution" }, { title: "Market" }, { title: "Business Model" }, { title: "Roadmap" }, { title: "Team" }, { title: "Go-To-Market" }, { title: "Financials" }, { title: "Ask" }, ], }) type SlideData = z.infer interface SlideLayoutProps { data?: Partial } const dynamicSlideLayout: React.FC = ({ data: slideData }) => { const items = slideData?.items || [] return ( <>
{(slideData as any)?._logo_url__ && logo} {(slideData as any)?.__companyName__ && {(slideData as any)?.__companyName__ || "Pitchdeck"}}

{slideData?.title}

{slideData?.description && (

{slideData?.description}

)}
{items.map((item, idx) => (
{idx + 1}
{item.title}
))}
) } export { Schema, layoutId, layoutName, layoutDescription } export default dynamicSlideLayout