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 PropertyImageSliderAdd({ modalOpen, closeModal, spaceImages }) { const [currentImageSlide, setCurrentImageSlide] = useState(0); return (
{/*
{spaceImages.length > 0 ?

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

:

No approved images to preview

}
*/}

Images {currentImageSlide + 1} of {spaceImages?.filter((v) => (v != null && v != "")).length}

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