"use client" import { useState, useEffect } from "react" import Image from "next/image" import { Card } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" import { Calendar, MapPin } from "lucide-react" interface Photo { id: number src: string title: string description: string category: string tags: string[] date: string exif: { camera: string lens: string settings: string location: string } } interface PhotoGalleryProps { photos: Photo[] onPhotoClick: (photo: Photo) => void } export function PhotoGallery({ photos, onPhotoClick }: PhotoGalleryProps) { const [loadedImages, setLoadedImages] = useState>(new Set()) const [isHydrated, setIsHydrated] = useState(false) useEffect(() => { setIsHydrated(true) }, []) const handleImageLoad = (photoId: number) => { setLoadedImages((prev) => new Set(prev).add(photoId)) } return (
{photos.map((photo) => ( onPhotoClick(photo)} >
{isHydrated && !loadedImages.has(photo.id) &&
} {photo.title} handleImageLoad(photo.id)} />
{/* Hover overlay */}

{photo.title}

{photo.description}

{photo.date} {photo.exif.location}
{/* Card content */}

{photo.title}

{photo.tags.slice(0, 2).map((tag) => ( {tag} ))}
{photo.exif.camera} • {photo.exif.settings}
))}
) }