import * as z from "zod"; export const slideLayoutId = "code-explanation-split-slide"; export const slideLayoutName = "Code Explanation Split Slide"; export const slideLayoutDescription = "A two-column slide with a code panel on the left and description on the right."; export const Schema = z.object({ title: z.string().min(8).max(24).default("Code + Explanation").meta({ description: "Slide heading shown at the top-left.", }), codeSnippet: z.object({ language: z.string().min(2).max(10).meta({ description: "Programming language of the snippet", }), fileName: z.string().min(3).max(30).meta({ description: "File name label shown above the code snippet.", }), content: z.string().min(20).max(520).meta({ description: "The actual code content to be displayed.", }), }).default({ language: "tsx", fileName: "components/UserAuth.tsx", content: `import { useState } from "react"; import { login } from "@/lib/auth"; export function UserAuth() { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const handleSubmit = async (event: React.FormEvent) => { event.preventDefault(); const user = await login(email, password); console.log("Logged in:", user); }; return null; } `, }).meta({ description: "Code sample shown in the left panel.", }), descriptionTitle: z.string().min(4).max(20).default("Description").meta({ description: "Heading shown above the paragraph.", }), description: z .string() .min(40) .max(360) .default( "This component manages credentials as local state and submits them through an async handler. The login utility abstracts network details while the handler keeps the UI flow predictable. Keep validation and side effects isolated so changes remain safe when authentication requirements evolve. " ) .meta({ description: "Description paragraph shown in the right column.", }), pageLabel: z.string().min(3).max(8).optional().default("2 / 11").meta({ description: "Bottom pagination label.", }), }); export type SchemaType = z.infer; const CodeSlide02CodeExplanationSplit = ({ data, }: { data: Partial; }) => { return ( <>

{data.title}

{data.codeSnippet?.fileName}


                
                  {data.codeSnippet?.content}
                
              

{data.descriptionTitle}

{data.description}

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