import { useState } from 'react'; import type { GalleryImage } from '../../api/types'; import { api } from '../../api'; import { useQueryClient } from '@tanstack/react-query'; interface Props { images: GalleryImage[]; catalogId: string; } export default function LightboxView({ images, catalogId }: Props) { const [lightbox, setLightbox] = useState(null); const qc = useQueryClient(); if (images.length === 0) { return (
No images yet.
); } return ( <>
{images.map(img => (
setLightbox(img)} style={{ cursor: 'pointer', borderRadius: 3, overflow: 'hidden', background: 'var(--bg-deep)', aspectRatio: '1', position: 'relative', }} > {img.caption
))}
{lightbox && (
setLightbox(null)} style={{ position: 'fixed', inset: 0, background: 'rgba(0,0,0,0.92)', display: 'flex', alignItems: 'center', justifyContent: 'center', zIndex: 1000, }} >
e.stopPropagation()} style={{ position: 'relative', maxWidth: '90vw', maxHeight: '90vh' }}> {lightbox.caption
{lightbox.caption && ( {lightbox.caption} )}
)} ); }