"use client" import { useEffect } from "react" import Image from "next/image" import { X, ChevronLeft, ChevronRight, Camera, MapPin, Calendar } from "lucide-react" import { Button } from "@/components/ui/button" import { Badge } from "@/components/ui/badge" import { Card, CardContent } from "@/components/ui/card" interface PhotoModalProps { photo: any onClose: () => void onPrev: () => void onNext: () => void } export function PhotoModal({ photo, onClose, onPrev, onNext }: PhotoModalProps) { useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { switch (e.key) { case "Escape": onClose() break case "ArrowLeft": onPrev() break case "ArrowRight": onNext() break } } document.addEventListener("keydown", handleKeyDown) document.body.style.overflow = "hidden" return () => { document.removeEventListener("keydown", handleKeyDown) document.body.style.overflow = "unset" } }, [onClose, onPrev, onNext]) return (
{/* Close button */} {/* Navigation buttons */}
{/* Main image */}
{photo.title}
{/* Photo information */}
{/* Title and description */}

{photo.title}

{photo.description}

{/* Tags */}

标签

{photo.tags.map((tag: string) => ( {tag} ))}
{/* Date and location */}
拍摄时间:{photo.date}
拍摄地点:{photo.exif.location}
{/* EXIF information */}

拍摄参数

相机: {photo.exif.camera}
镜头: {photo.exif.lens}
参数: {photo.exif.settings}
{/* Keyboard shortcuts */}

快捷键

ESC - 关闭
← → - 切换图片
) }