"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 { useTranslations } from "next-intl"; interface ShowCaseProps { titleKey: string; subtitleKey?: string; ctaLabelKey: string; images: string[]; } export function ShowCase({ titleKey, subtitleKey, ctaLabelKey, images, }: ShowCaseProps) { const t = useTranslations(); 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 (
hero image
{/* Left Content */}

{t(titleKey)}

{subtitleKey && (

{t(subtitleKey)}

)} {t(ctaLabelKey)}
{/* 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 }} /> ))}
); }