import Button from "@/components/ui/Button"; import HeroBackgroundSlot from "@/components/ui/HeroBackgroundSlot"; import TextAnimation from "@/components/ui/TextAnimation"; import ImageOrVideo from "@/components/ui/ImageOrVideo"; import { useState, useEffect } from "react"; import { motion, AnimatePresence } from "motion/react"; type HeroBillboardCarouselProps = { tag: string; title: string; description: string; primaryButton: { text: string; href: string }; secondaryButton: { text: string; href: string }; items: ({ imageSrc: string; videoSrc?: never } | { videoSrc: string; imageSrc?: never })[]; }; const HeroBillboardCarousel = ({ tag, title, description, primaryButton, secondaryButton, items, }: HeroBillboardCarouselProps) => { const [currentIndex, setCurrentIndex] = useState(0); useEffect(() => { const interval = setInterval(() => { setCurrentIndex((prevIndex) => (prevIndex + 1) % items.length); }, 5000); // Change image every 5 seconds return () => clearInterval(interval); }, [items.length]); return (

{tag}

{items.map((_, index) => (
); }; export default HeroBillboardCarousel;