"use client"; import { useEffect, useState } from 'react'; import { X } from 'lucide-react'; interface TemplatePreviewModalProps { /** Control visibility */ open: boolean; /** Video URL to preview */ videoUrl: string | null; /** Close callback */ onClose: () => void; /** Optional title shown over the video */ title?: string; /** Optional description shown over the video */ description?: string; /** Optional primary action (e.g., Try it) */ onPrimaryAction?: () => void; /** Optional primary action label */ primaryLabel?: string; } /** * Fullscreen, Tailwind-based template preview modal with video content. * Overlays title/description if provided and supports an optional primary action. */ export function TemplatePreviewModal({ open, videoUrl, onClose, title, description, onPrimaryAction, primaryLabel = 'Try it', }: TemplatePreviewModalProps) { const [isReady, setIsReady] = useState(false); useEffect(() => { if (!open) { setIsReady(false); } }, [open]); if (!open || !videoUrl) return null; return (
e.stopPropagation()} >
); } export default TemplatePreviewModal;