diff --git a/servers/nextjs/app/(presentation-generator)/components/EditableLayoutWrapper.tsx b/servers/nextjs/app/(presentation-generator)/components/EditableLayoutWrapper.tsx index 2c71f61f..4ecd8257 100644 --- a/servers/nextjs/app/(presentation-generator)/components/EditableLayoutWrapper.tsx +++ b/servers/nextjs/app/(presentation-generator)/components/EditableLayoutWrapper.tsx @@ -196,7 +196,6 @@ const EditableLayoutWrapper: React.FC = ({ const itemIndex = parseInt(`${slideIndex}-${type}-${dataPath}-${index}`.split('-').pop() || '0'); const propertiesData = properties?.[itemIndex]; - console.log('propertiesData', propertiesData); // Add hover effects without changing layout htmlImg.style.cursor = 'pointer'; diff --git a/servers/nextjs/app/(presentation-generator)/components/NewSlide.tsx b/servers/nextjs/app/(presentation-generator)/components/NewSlide.tsx index 52282428..f57a39e4 100644 --- a/servers/nextjs/app/(presentation-generator)/components/NewSlide.tsx +++ b/servers/nextjs/app/(presentation-generator)/components/NewSlide.tsx @@ -4,6 +4,8 @@ import { useDispatch } from 'react-redux'; import { addNewSlide } from '@/store/slices/presentationGeneration'; import { Loader2 } from 'lucide-react'; import { useGroupLayoutLoader } from '@/app/layout-preview/hooks/useGroupLayoutLoader'; +import { v4 as uuidv4 } from 'uuid'; +import { toast } from 'sonner'; interface NewSlideProps { setShowNewSlideSelection: (show: boolean) => void; group: string; @@ -13,16 +15,21 @@ interface NewSlideProps { const NewSlide = ({ setShowNewSlideSelection, group, index, presentationId }: NewSlideProps) => { const dispatch = useDispatch(); const handleNewSlide = (sampleData: any, id: string) => { - const newSlide = { - id: crypto.randomUUID(), - index: index, - content: sampleData, - layout_group: group, - layout: `${group}:${id}`, - presentation: presentationId + try { + const newSlide = { + id: uuidv4(), + index: index, + content: sampleData, + layout_group: group, + layout: `${group}:${id}`, + presentation: presentationId + } + dispatch(addNewSlide({ slideData: newSlide, index })); + setShowNewSlideSelection(false); + } catch (error: any) { + console.error(error) + toast.error('Error adding new slide') } - dispatch(addNewSlide({ slideData: newSlide, index })); - setShowNewSlideSelection(false); } const { layoutGroup, loading } = useGroupLayoutLoader(group) diff --git a/servers/nextjs/app/(presentation-generator)/upload/components/ConfigurationSelects.tsx b/servers/nextjs/app/(presentation-generator)/upload/components/ConfigurationSelects.tsx index 520c0671..741ebf99 100644 --- a/servers/nextjs/app/(presentation-generator)/upload/components/ConfigurationSelects.tsx +++ b/servers/nextjs/app/(presentation-generator)/upload/components/ConfigurationSelects.tsx @@ -30,10 +30,10 @@ interface ConfigurationSelectsProps { onConfigChange: (key: keyof PresentationConfig, value: string) => void; } -type SlideOption = "5" | "8" | "10" | "12" | "15" | "18" | "20"; +type SlideOption = "5" | "8" | "9" | "10" | "11" | "12" | "13" | "14" | "15" | "16" | "17" | "18" | "19" | "20"; // Constants -const SLIDE_OPTIONS: SlideOption[] = ["5", "8", "10", "12", "15", "18", "20"]; +const SLIDE_OPTIONS: SlideOption[] = ["5", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"]; /** * Renders a select component for slide count