import { Dialog, Transition } from "@headlessui/react"; import React, { Fragment, useState } from "react"; import Swiper from "swiper"; import { SwiperSlide, Swiper as SwiperComponent } from "swiper/react"; import { Navigation, Pagination, A11y } from "swiper"; export default function PropertyImageSlider({ modalOpen, closeModal, spaceImages }) { const [currentImageSlide, setCurrentImageSlide] = useState(0); return (
{spaceImages.length > 0 ?

Images {currentImageSlide + 1} of {spaceImages.length}

:

No approved images to preview

}
``, }} className="property-swiper-slid" > {spaceImages.map((img, i) => ( {({ isActive }) => { if (isActive) setCurrentImageSlide(i); return ( ); }} ))}
); }