import { useRef, useEffect } from "react"; import { Video, List, Link as LinkIcon, Lightbulb, ChevronRight, ImageIcon, ArrowRight, } from "lucide-react"; import { Button } from "../../../../components/ui/button"; import { Input } from "../../../../components/ui/input"; import { Select } from "../../../../components/ui/select"; interface VideoDetailStepProps { formData: any; setFormData: (data: any) => void; nextStep: () => void; } export function VideoDetailStep({ formData, setFormData, nextStep, }: VideoDetailStepProps) { const editorRef = useRef(null); const isInternalChange = useRef(false); // Initialize editor content only once or when needed from outside useEffect(() => { if (editorRef.current && !isInternalChange.current) { editorRef.current.innerHTML = formData.description || ""; } }, []); const handleCommand = (command: string, value?: string) => { document.execCommand(command, false, value); syncState(); }; const syncState = () => { if (editorRef.current) { isInternalChange.current = true; setFormData({ ...formData, description: editorRef.current.innerHTML }); // Reset after a short delay to allow exterior updates if any (e.g., from step change) setTimeout(() => { isInternalChange.current = false; }, 0); } }; const handleInput = () => { syncState(); }; return (
{/* Single Unified Card for Everything */}
{/* 1. Upload Video Section */}

Upload Video

Drag and drop video files here

MP4, MOV, WebM. Max size 2GB.

OR
{/* Gradient Divider */}
); }