'use client'; import { useState, useEffect } from 'react'; import { cn } from '@/lib/utils'; // 배경 영상 목록 const BACKGROUND_VIDEOS = [ '/background-videos/1.yard.mp4', '/background-videos/2.SN2635_LNGC_CARDIFF.mp4', '/background-videos/3.SN2628_CONT_WAN HAI.mp4', '/background-videos/4.SN2612_LNGC_KGL.mp4', '/background-videos/5.SN2596_LNGC_JP MORGAN.mp4', '/background-videos/6.2235_FLNG_ENI_CORAL.mp4', '/background-videos/7.2126_FLNG_PETRONAS.mp4', ]; interface VideoBackgroundProps { quote: string; } export function VideoBackground({ quote }: VideoBackgroundProps) { const [currentVideoIndex, setCurrentVideoIndex] = useState(0); // 컴포넌트 마운트 시 랜덤한 비디오 선택 useEffect(() => { if (typeof window !== 'undefined') { setCurrentVideoIndex(Math.floor(Math.random() * BACKGROUND_VIDEOS.length)); } }, []); // 비디오 종료 시 다음 비디오로 전환 const handleVideoEnd = () => { setCurrentVideoIndex((prevIndex) => (prevIndex + 1) % BACKGROUND_VIDEOS.length); }; return (
“{quote}”