"use client"; import React, { useState, useRef, useEffect } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { ChevronLeft, ChevronRight, X } from 'lucide-react'; import { clsx, type ClassValue } from 'clsx'; import { twMerge } from 'tailwind-merge' function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } // ============================================================================ // TYPES // ============================================================================ interface TestimonialVideoItem { id: string; name: string; role: string; thumbnail: string; videoUrl: string; badge: string; } interface TestimonialVideoProps { className?: string; } // ============================================================================ // DATA // ============================================================================ const TESTIMONIALS: TestimonialVideoItem[] = [ { id: '1', name: "David Chen", role: "Product Lead at TechFlow", thumbnail: "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=800&h=1100&fit=crop&q=80", videoUrl: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", badge: "CUSTOMER STORY" }, { id: '2', name: "Maria Rodriguez", role: "VP of Design at CreativeLab", thumbnail: "https://images.unsplash.com/photo-1573496359142-b8d87734a5a2?w=800&h=1100&fit=crop&q=80", videoUrl: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4", badge: "CUSTOMER STORY" }, { id: '3', name: "Amelia Brynn", role: "Strategy Lead at Forerunnerâ„¢", thumbnail: "https://images.unsplash.com/photo-1580489944761-15a19d654956?w=800&h=1100&fit=crop&q=80", videoUrl: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4", badge: "CUSTOMER STORY" }, { id: '4', name: "Sarah Mitchell", role: "CMO at BrandWorks", thumbnail: "https://images.unsplash.com/photo-1573497019940-1c28c88b4f3e?w=800&h=1100&fit=crop&q=80", videoUrl: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4", badge: "CUSTOMER STORY" } ]; // ============================================================================ // ANIMATION VARIANTS // ============================================================================ const animatedContentVariants = { hidden: { opacity: 0, y: 40, filter: 'blur(10px)' }, visible: (customDelay: number = 0) => ({ opacity: 1, y: 0, filter: 'blur(0px)', transition: { duration: 0.8, delay: customDelay, ease: [0.4, 0, 0.2, 1] as const, } }) }; // ============================================================================ // MAIN COMPONENT // ============================================================================ export function TestimonialVideo({ className }: TestimonialVideoProps) { const [activeVideo, setActiveVideo] = useState(null); const carouselRef = useRef(null); const scroll = (direction: 'left' | 'right') => { if (carouselRef.current) { const { current } = carouselRef; const scrollAmount = 420; current.scrollBy({ left: direction === 'left' ? -scrollAmount : scrollAmount, behavior: 'smooth' }); } }; // Lock scroll when modal is open useEffect(() => { if (activeVideo) { document.body.style.overflow = 'hidden'; } else { document.body.style.overflow = 'auto'; } return () => { document.body.style.overflow = 'auto'; }; }, [activeVideo]); return ( <> {/* Google Fonts */}
{/* Header */}
TESTIMONIALS We've helped teams rethink their offers, their structure, and their story.
{/* Carousel Container */}
{TESTIMONIALS.map((testimonial, idx) => ( setActiveVideo(testimonial.videoUrl)} className="relative flex-none w-[320px] md:w-[400px] h-[450px] md:h-[550px] rounded-2xl overflow-hidden cursor-pointer group" > {/* Thumbnail */} {testimonial.name} {/* Overlay Gradient */}
{/* Badge */}
{testimonial.badge}
{/* Info */}

{testimonial.name}

{testimonial.role}

{/* Play Icon */}
))}
{/* Video Modal */} {activeVideo && ( setActiveVideo(null)} > e.stopPropagation()} > {/* Close Button */} )}
); } export default TestimonialVideo;