"use client"; import { useState } from "react"; import Image from "next/image"; interface PropertyGalleryProps { images: string[]; title: string; } export default function PropertyGallery({ images, title }: PropertyGalleryProps) { const [activeImage, setActiveImage] = useState(0); const [showLightbox, setShowLightbox] = useState(false); const [lightboxIndex, setLightboxIndex] = useState(0); const openLightbox = (index: number) => { setLightboxIndex(index); setShowLightbox(true); document.body.style.overflow = 'hidden'; }; const closeLightbox = () => { setShowLightbox(false); document.body.style.overflow = 'unset'; }; // Ensure we have at least 5 images for the gallery (1 big + 4 small) const displayImages = [...images]; while (displayImages.length < 5) { displayImages.push("/assets/images/image.png"); } const nextImage = () => { setLightboxIndex((prev) => (prev + 1) % displayImages.length); }; const prevImage = () => { setLightboxIndex((prev) => (prev - 1 + displayImages.length) % displayImages.length); }; return ( <>