// src/components/ImageCarousel.js import React from 'react'; import { Swiper, SwiperSlide } from 'swiper/react'; import { Navigation, Pagination } from 'swiper/modules'; import 'swiper/css'; import 'swiper/css/navigation'; import 'swiper/css/pagination'; const ImageCarousel = ({ images, id, width = '100%', names = [] }) => { const [activeIndex, setActiveIndex] = React.useState(0); // Get the current image name from the names array if available const getCurrentImageName = () => { if (Array.isArray(names) && names.length > activeIndex && names[activeIndex]) { return names[activeIndex]; } // Don't show anything if no names provided return ''; }; return (