import React from 'react'; import { useEffect, useState } from 'react'; import './Carousel.css'; import { BlurryLoadImg } from './BlurryLoadImg'; const images = [ { small: '/small/engagement1.webp', full: '/full/engagement1.jpg' }, { small: '/small/engagement2.webp', full: '/full/engagement2.jpg' }, { small: '/small/engagement3.webp', full: '/full/engagement3.jpg' }, { small: '/small/engagement4.webp', full: '/full/engagement4.jpg' }, { small: '/small/engagement5.webp', full: '/full/engagement5.jpg' }, { small: '/small/engagement6.webp', full: '/full/engagement6.jpg' }, ]; function Home() { const [currentIndex, setIndex] = useState(0); useEffect(() => { const interval = setInterval(() => { setIndex((prevIndex) => prevIndex === images.length - 1 ? 0 : prevIndex + 1 ); }, 3000); return () => clearInterval(interval); }, [images.length]); return (
{images.map((image, index) => (
))}
); } export default Home;