"use client"; import { useRef, useState } from "react"; import { useRouter } from "next/navigation"; import { Download, FileImage, Pencil, Trash2 } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Badge } from "@/components/ui/badge"; import { Input } from "@/components/ui/input"; import { PhotoViewer, type ViewerPhoto } from "./photo-viewer"; import type { PhotoAdjustments } from "@/lib/photo-adjustments"; import type { AdvancedEditView } from "@/lib/advanced-edit"; /** * Grid image that degrades to a readable tile instead of a blank square when * the thumbnail cannot be produced (damaged or unsupported RAW, missing file). */ function GalleryImage({ src, alt }: { src: string; alt: string }) { const [failed, setFailed] = useState(false); if (failed) { return (
Photo uploads and editing are disabled. {storageMessage}
)} {canContribute && (Upload photos to this event
{files.length} file{files.length === 1 ? "" : "s"} selected,{" "} {formatBytes(files.reduce((sum, file) => sum + file.size, 0))}. Uploads run one at a time.
)} {progress && ({progress.done < progress.total ? `Uploading ${progress.done + 1} of ${progress.total}: ${progress.current}` : "Upload finished."}
)} {notice && ({notice}
)} {error && ({error}
)}RAW files download as originals; browsers cannot preview them. JPEG, PNG, WebP, GIF and AVIF show a preview.
No photos yet. Upload the first frame for this event.
) : ({photo.filename}
{photo.uploaderName}