import * as z from "zod"; import { ImageSchema, IconSchema } from "@/app/presentation-templates/defaultSchemes"; export const Schema = z.object({ title: z.string().min(5).max(50).default("Quarterly Business Review").meta({ description: "Main slide title", }), subtitle: z .string() .min(3) .max(100) .optional() .default("Q1 2024 Performance Summary") .meta({ description: "Optional subtitle", }), metrics: z .array( z.object({ label: z.string().min(2).max(20), value: z.string().min(1).max(10), trend: z.enum(["up", "down", "stable"]), }) ) .default([ { label: "Revenue", value: "$2.4M", trend: "up" }, { label: "Growth", value: "15%", trend: "up" }, ]) .meta({ description: "Key performance metrics", }), chartImage: ImageSchema.default({ __image_url__: "https://example.com/quarterly-chart.png", __image_prompt__: "Quarterly performance chart showing upward trend", }).meta({ description: "Main performance chart", }), trendIcon: IconSchema.default({ __icon_url__: "/static/icons/placeholder.svg", __icon_query__: "upward trend arrow icon", }).meta({ description: "Trend indicator icon", }), }); type SchemaType = z.infer; export default function ExampleSlideLayout({ data }: { data: SchemaType }) { const { title, subtitle, metrics, chartImage, trendIcon } = data; return (
{title &&

{title}

} {subtitle &&

{subtitle}

}
{chartImage?.__image_url__ && (
{chartImage.__image_prompt__}
)} {metrics && metrics.length > 0 && (

Key Metrics

{metrics.map((metric, index) => (
{metric.label} {trendIcon?.__icon_url__ && ( {metric.trend} )}
{metric.value}
))}
)}
); }