'use client'; import { useState } from 'react'; import Image from 'next/image'; interface ImageCarrouselProps { images: string[]; titre: string; } export default function ImageCarrousel({ images, titre }: ImageCarrouselProps) { const [currentIndex, setCurrentIndex] = useState(0); const goToPrevious = () => { const isFirstSlide = currentIndex === 0; const newIndex = isFirstSlide ? images.length - 1 : currentIndex - 1; setCurrentIndex(newIndex); }; const goToNext = () => { const isLastSlide = currentIndex === images.length - 1; const newIndex = isLastSlide ? 0 : currentIndex + 1; setCurrentIndex(newIndex); }; const goToSlide = (slideIndex: number) => { setCurrentIndex(slideIndex); }; if (!images || images.length === 0) { return (