import { useState } from 'react'; import { Link } from 'react-router-dom'; import type { GallerySummary } from '../../types/gallery'; import { formatBytes, formatDate } from '../../lib/format'; interface GalleryCardProps { gallery: GallerySummary; onDelete: (gallery: GallerySummary) => void; } export function GalleryCard({ gallery, onDelete }: GalleryCardProps) { const [copied, setCopied] = useState(false); const clientURL = `${window.location.origin}/g/${gallery.slug}`; async function copyLink() { try { await navigator.clipboard.writeText(clientURL); setCopied(true); window.setTimeout(() => setCopied(false), 1800); } catch { setCopied(false); } } return (
{gallery.coverUrl ? ( ) : ( )}