import React, { useState, useEffect } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { Button } from '@/components/ui/button'; import { ChevronLeft, ChevronRight } from 'lucide-react'; const HeroSection = ({ images }) => { const [currentImageIndex, setCurrentImageIndex] = useState(0); useEffect(() => { const timer = setTimeout(() => { setCurrentImageIndex((prevIndex) => (prevIndex + 1) % images.length); }, 5000); return () => clearTimeout(timer); }, [currentImageIndex, images.length]); const handlePrev = () => { setCurrentImageIndex((prevIndex) => (prevIndex - 1 + images.length) % images.length); }; const handleNext = () => { setCurrentImageIndex((prevIndex) => (prevIndex + 1) % images.length); }; return (