import * as z from "zod"; const MetricSchema = z.object({ value: z.string().min(2).max(6).meta({ description: "Primary metric value.", }), label: z.string().min(3).max(15).meta({ description: "Metric label text.", }), subtext: z.string().min(3).max(30).meta({ description: "Metric subtext/description.", }), }); export const slideLayoutId = "metrics-grid-slide"; export const slideLayoutName = "Metrics Grid Slide"; export const slideLayoutDescription = "A slide with metrics card grid and title at the top."; export const Schema = z.object({ title: z.string().min(6).max(18).default("Metrics").meta({ description: "Slide heading shown above the KPI cards.", }), metrics: z .array(MetricSchema) .min(1) .max(6) .default([ { value: "99.9%", label: "Uptime", subtext: "Last 12 months" }, { value: "<100ms", label: "Response Time", subtext: "Last 12 months" }, { value: "50k+", label: "Active Users", subtext: "Last 12 months" }, { value: "99.9%", label: "Uptime", subtext: "Last 12 months" }, { value: "<100ms", label: "Response Time", subtext: "Last 12 months" }, { value: "50k+", label: "Active Users", subtext: "Last 12 months" }, ]) .meta({ description: "Metrics cards in a grid.", }), pageLabel: z.string().min(3).max(8).optional().default("11 / 11").meta({ description: "Bottom pagination label.", }), }); export type SchemaType = z.infer; const CodeSlide11MetricsGrid = ({ data }: { data: Partial }) => { return ( <>

{data.title}

{data?.metrics?.map((metric, index) => (

{metric.value}

{metric.label}

{metric.subtext}

))}
{data.pageLabel}
); }; export default CodeSlide11MetricsGrid;