"use client"; import Image from "next/image"; import { useState } from "react"; interface TripImage { id: string; url: string; caption: string | null; } export function ImageGallery({ images }: { images: TripImage[] }) { const [activeIndex, setActiveIndex] = useState(0); if (images.length === 0) { return (
🏔️
); } const activeImage = images[activeIndex]; return (
{/* Main Image */}
{activeImage.caption {activeImage.caption && (

{activeImage.caption}

)} {/* Counter */}
{activeIndex + 1} / {images.length}
{/* Thumbnails */} {images.length > 1 && (
{images.map((img, i) => ( ))}
)}
); }