import { Link } from 'react-router-dom'; import type { SitePhoto } from '../lib/types'; import { PlayerAvatar } from './PlayerAvatar'; import { num, relativeTime } from '../lib/format'; // Single-photo tile for the masonry feed. The outer block is a Link // to the photo-detail route; the avatar inside is its OWN Link to the // uploader profile — the inner Link wins click-precedence because // React Router stops event propagation. event.stopPropagation on the // inner anchor preserves that even on touch devices where iOS // occasionally fires both handlers. export function PhotoCard({ photo }: { photo: SitePhoto }) { return (
{photo.caption { (e.currentTarget as HTMLImageElement).style.display = 'none'; }} className="w-full h-auto bg-ink-800 object-cover" />
e.stopPropagation()} className="flex items-center gap-2 group" > {photo.uploaderDisplayName} {photo.caption && (

{photo.caption}

)}
♥ {num(photo.cheerCount)} {photo.roomName ? ^{photo.roomName} : {relativeTime(photo.createdAt)} }
); }