'use client'; import { useState } from 'react'; import { Play, X } from 'lucide-react'; import { cn } from '@/utils/cn'; import { ImagePlaceholder } from '../misc/image-placeholder'; import Image from 'next/image'; type AnimationStyle = | 'from-bottom' | 'from-center' | 'from-top' | 'from-left' | 'from-right' | 'fade' | 'top-in-bottom-out' | 'left-in-right-out'; type HeroVideoDialogProps = { animationStyle?: AnimationStyle; videoSrc: string; thumbnailSrc?: string | null; thumbnailAlt?: string; className?: string; }; const animationTransforms: Record = { 'from-bottom': 'translateY(40px) scale(0.98)', 'from-center': 'scale(0.86)', 'from-top': 'translateY(-40px) scale(0.98)', 'from-left': 'translateX(-40px) scale(0.98)', 'from-right': 'translateX(40px) scale(0.98)', fade: 'scale(1)', 'top-in-bottom-out': 'translateY(-48px) scale(0.98)', 'left-in-right-out': 'translateX(-48px) scale(0.98)', }; export default function HeroVideoDialog({ animationStyle = 'from-center', videoSrc, thumbnailSrc = null, thumbnailAlt = 'Video thumbnail', className, }: HeroVideoDialogProps) { const [isVideoOpen, setIsVideoOpen] = useState(false); return (
{isVideoOpen ? (
setIsVideoOpen(false)} >
event.stopPropagation()} >