/** * ImagePreviewGrid — Thumbnail grid with remove button. * On mobile the remove button is always visible (no hover needed). */ import { AnimatePresence, motion } from 'framer-motion'; import type { ImageFile } from '../types'; interface ImagePreviewGridProps { files: ImageFile[]; onRemove: (id: string) => void; } function formatFileSize(bytes: number): string { if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(0)} KB`; return `${(bytes / (1024 * 1024)).toFixed(1)} MB`; } export default function ImagePreviewGrid({ files, onRemove }: ImagePreviewGridProps) { if (files.length === 0) return null; return (

{files.length} image{files.length !== 1 ? 's' : ''} selected

{files.length >= 4 && ( ✓ Required views ready )}
{files.map((image, index) => (
{image.filename} {/* Gradient overlay */}
{/* Bottom info */}

{image.label}

{formatFileSize(image.size)}

{/* Index badge */} {index + 1} {/* Remove button — always visible on touch, hover on desktop */}
))}
); }