--- /** * Card — a square picture with a title and a meta line; the whole card is one link. * href: where the card goes; without it the card is a
sample. * title, meta: the caption. chips: short tags over the picture, such as platforms. * chipsLabel: names the tag list for screen readers. * image: { src, alt, width?, height? } — square; 1600 × 1600 if not given. * actionLabel: the title's hover text. state: 'hover' forces the hover state, for documentation. * class: extra classes. root: prefix for href and image.src; '/' on pages in a folder. * …attributes: passed to the element, such as data-project. */ interface Props { href?: string; title: string; meta: string; chips?: string[]; chipsLabel?: string; image: { src: string; alt: string; width?: number; height?: number }; actionLabel?: string; state?: 'hover'; class?: string; root?: string; [attr: string]: any; } const { href, title, meta, chips = [], chipsLabel = 'Platforms', image, actionLabel = 'View project', state, class: extra, root = '', ...attrs } = Astro.props; const Tag = href ? 'a' : 'div'; const Title = href ? 'h3' : 'p'; --- {image.alt} {chips.length > 0 && }{'\n '} <span>{title}</span><span aria-hidden="true">{actionLabel}</span> {meta}