"use client"; import { useState, useEffect } from "react"; import Image from "next/image"; import { motion, AnimatePresence } from "framer-motion"; import { ChevronLeft, ChevronRight } from "lucide-react"; import { useLanguage } from "@/context/language-context"; //hello again dear interface ShowCaseProps { images: string[]; } export function ShowCase({ images }: ShowCaseProps) { const { t } = useLanguage(); const [currentImageIndex, setCurrentImageIndex] = useState(0); const [autoPlay, setAutoPlay] = useState(true); useEffect(() => { if (!autoPlay) return; const timer = setInterval(() => { setCurrentImageIndex((prev) => (prev + 1) % images.length); }, 5000); return () => clearInterval(timer); }, [autoPlay, images.length]); const goToNext = () => { setCurrentImageIndex((prev) => (prev + 1) % images.length); setAutoPlay(false); }; const goToPrev = () => { setCurrentImageIndex((prev) => (prev - 1 + images.length) % images.length); setAutoPlay(false); }; const handleContactClick = () => { const contactElement = document.querySelector("#contact"); if (contactElement) { contactElement.scrollIntoView({ behavior: "smooth" }); } }; return (
{/* background image */}
hero image
{/* Left Content */}

{t.hero.title}

{t.hero.subtitle}

{t.hero.cta}
{/* Right - Image Carousel */}
{`Pump setAutoPlay(false)} onMouseLeave={() => setAutoPlay(true)} /> {/* Navigation Buttons */} {/* Indicators */}
{images.map((_, idx) => ( { setCurrentImageIndex(idx); setAutoPlay(false); }} className={`h-2 rounded-full transition-all ${ idx === currentImageIndex ? "bg-white w-8" : "bg-white/50 w-2" }`} whileHover={{ scale: 1.2 }} /> ))}
); }