--- import { getImage } from '../../data/images'; interface Props { id: string; /** Overrides the registry ratio, e.g. "16/9". */ ratio?: string; /** Show the caption line under the plate. */ caption?: boolean; sizes?: string; className?: string; /** The first plate in the viewport should not be lazy. */ eager?: boolean; /** * Adds a clip-path reveal that opens on scroll-in, timed off the wrapping * element's own `.rv`/`.rv-in` state (set `--d` there, not here). */ mask?: boolean; /** Optional short floating annotation over the bottom-left corner of the * image, e.g. "P@SHA · Chairman". Use sparingly — one or two per page, * not on every plate. */ tag?: string; } const { id, ratio, caption = false, sizes = '(max-width: 48rem) 100vw, 50vw', className = '', eager = false, mask = false, tag, } = Astro.props; const img = getImage(id); if (!img) throw new Error(`Plate: no image registered with id "${id}"`); const aspect = (ratio ?? img.ratio).replace('/', ' / '); const meta = [img.year ? String(img.year) : null, img.credit].filter(Boolean) as string[]; ---
{img.src ? ( {img.alt} ) : ( )} {tag && img.src && }
{caption && img.caption && (
{img.caption} {meta.map((m) => {m})}
)}