import { useState, useEffect, useCallback } from 'react'; import { ChevronLeft, ChevronRight } from 'lucide-react'; const heroImages = [ 'https://images.unsplash.com/photo-1556742393-d75f468bfcb0?q=80&w=2070&auto=format&fit=crop', 'https://images.unsplash.com/photo-1552566626-52f8b828add9?q=80&w=2070&auto=format&fit=crop', 'https://plus.unsplash.com/premium_photo-1674106347866-8282d8c19f84?q=80&w=2070&auto=format&fit=crop' ]; function Hero() { const [currentIndex, setCurrentIndex] = useState(0); const nextSlide = useCallback(() => { setCurrentIndex((prevIndex) => (prevIndex + 1) % heroImages.length); }, []); const prevSlide = () => { setCurrentIndex((prevIndex) => (prevIndex - 1 + heroImages.length) % heroImages.length); }; useEffect(() => { const timer = setInterval(() => { nextSlide(); }, 5000); return () => clearInterval(timer); }, [nextSlide]); return (
{heroImages.map((src, index) => (
{index === currentIndex && (
)}
))}

Magyarország szíve, tálalva egy tányéron

Éld át a hagyományos magyar konyha gazdag, autentikus ízeit egy modern, elegáns környezetben.

Asztalfoglalás
{heroImages.map((_, index) => (
); } export default Hero;