diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/components/EachSlide/HtmlEditor.tsx b/servers/nextjs/app/(presentation-generator)/custom-layout/components/EachSlide/HtmlEditor.tsx index 03a17887..7ee780cb 100644 --- a/servers/nextjs/app/(presentation-generator)/custom-layout/components/EachSlide/HtmlEditor.tsx +++ b/servers/nextjs/app/(presentation-generator)/custom-layout/components/EachSlide/HtmlEditor.tsx @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import React, { useState, useEffect } from "react"; import { Button } from "@/components/ui/button"; import { Textarea } from "@/components/ui/textarea"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; @@ -21,6 +21,10 @@ export const HtmlEditor: React.FC = ({ const [htmlContent, setHtmlContent] = useState(slide.html || ""); const [isPreviewMode, setIsPreviewMode] = useState(false); + useEffect(() => { + setHtmlContent(slide.html || ""); + }, [slide.html]); + if (!isHtmlEditMode) return null; const handleSave = () => { @@ -83,8 +87,8 @@ export const HtmlEditor: React.FC = ({ Edit HTML Content: