"use client"; import { useState } from "react"; export function PastMeetingGallery({ title, photos, }: { title: string; photos: { id: number; imageUrl: string; caption: string | null }[]; }) { const [open, setOpen] = useState(null); if (photos.length === 0) return null; const current = open == null ? null : photos.find((photo) => photo.id === open); return ( <>
{photos.slice(0, 4).map((photo, index) => ( ))}
{current && (
setOpen(null)} style={{ position: "fixed", inset: 0, background: "rgba(19,50,79,0.72)", zIndex: 80, padding: 24, display: "flex", alignItems: "center", justifyContent: "center" }} >
event.stopPropagation()} style={{ maxWidth: 980, width: "100%" }}> {/* eslint-disable-next-line @next/next/no-img-element */} {current.caption
{current.caption ?? title}
)} ); }