diff --git a/servers/nextjs/app/(presentation-generator)/presentation/components/SlideContent.tsx b/servers/nextjs/app/(presentation-generator)/presentation/components/SlideContent.tsx index aa8a1e8b..aa268726 100644 --- a/servers/nextjs/app/(presentation-generator)/presentation/components/SlideContent.tsx +++ b/servers/nextjs/app/(presentation-generator)/presentation/components/SlideContent.tsx @@ -115,7 +115,13 @@ const SlideContent = ({ // }, [presentationData?.slides, isStreaming]); const renderLayout = (slide: any) => { - const layoutName = idMapFileNames[slide.layoutId]; + console.log(slide) + console.log(idMapFileNames) + const layoutName = idMapFileNames[slide.layout]; + if (!layoutName) { + return
Layout not found
+ } + console.log(layoutName) const Layout = dynamic(() => import(`@/components/layouts/${layoutName}`)) as React.ComponentType<{ data: any }>; return }; diff --git a/servers/nextjs/components/layouts/BulletPointSlideLayout.tsx b/servers/nextjs/components/layouts/BulletPointSlideLayout.tsx index b5f5e660..b44e039b 100644 --- a/servers/nextjs/components/layouts/BulletPointSlideLayout.tsx +++ b/servers/nextjs/components/layouts/BulletPointSlideLayout.tsx @@ -1,23 +1,16 @@ import React from 'react' import * as z from "zod"; +import { imageSchema } from './defaultSchemes'; export const layoutId = 'bullet-point-slide' export const layoutName = 'Bullet Point Slide' export const layoutDescription = 'A slide with a title, subtitle, and a list of bullet points.' -const imageSchema = z.object({ - url: z.url().meta({ - description: "URL to image", - }), - prompt: z.string().meta({ - description: "Prompt used to generate the image", - }), -}) const bulletPointSlideSchema = z.object({ title: z.string().min(3).max(100).default('Key Points').meta({ description: "Title of the slide", - badu: "'badf" + }), subtitle: z.string().min(3).max(150).optional().meta({ description: "Optional subtitle or description", @@ -47,8 +40,8 @@ interface BulletPointSlideLayoutProps { accentColor?: 'blue' | 'green' | 'purple' | 'orange' | 'red' } -const BulletPointSlideLayout: React.FC = ({ data, accentColor = 'blue' }) => { - const slideData = bulletPointSlideSchema.parse(data || {}) +const BulletPointSlideLayout: React.FC = ({ data: slideData, accentColor = 'blue' }) => { + const accentColors = { blue: 'from-blue-600 to-blue-800', @@ -77,7 +70,7 @@ const BulletPointSlideLayout: React.FC = ({ data, a return (
= ({ data, a
{/* Professional Header */}
-

- {slideData.title} + {slideData?.title}

- {slideData.subtitle && ( -

- {slideData.subtitle} + {slideData?.subtitle}

)} @@ -122,8 +115,8 @@ const BulletPointSlideLayout: React.FC = ({ data, a {/* Content background accent */}
-