import { useEffect, useState } from "react"; import type { LucideIcon } from "lucide-react"; import { motion, AnimatePresence } from "motion/react"; 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 ScrollReveal from "@/components/ui/ScrollReveal"; import ActiveBadge from "@/components/ui/ActiveBadge"; import { resolveIcon } from "@/utils/resolve-icon"; type FeatureItem = { icon: string | LucideIcon; title: string; description: string; }; type HeroBillboardFeaturesProps = { badge: string; title: string; description: string; primaryButton: { text: string; href: string }; secondaryButton: { text: string; href: string }; features: FeatureItem[]; } & ({ imageSrc: string; videoSrc?: never } | { videoSrc: string; imageSrc?: never }); const INTERVAL = 5000; const HeroBillboardFeatures = ({ badge, title, description, primaryButton, secondaryButton, imageSrc, videoSrc, features, }: HeroBillboardFeaturesProps) => { const [currentIndex, setCurrentIndex] = useState(0); useEffect(() => { if (features.length <= 1) return; const interval = setInterval(() => { setCurrentIndex((prev) => (prev + 1) % features.length); }, INTERVAL); return () => clearInterval(interval); }, [features.length]); const feature = features[currentIndex]; const FeatureIcon = resolveIcon(feature.icon); return (

{feature.title}

{feature.description}

); }; export default HeroBillboardFeatures;