import classNames from 'classnames'; import { Grid, Link, Heading } from '@aws-amplify/ui-react'; interface CardLinkProps { href: string; title: string; desc: string; icon?: React.ReactNode; className?: string; variation?: 'plain' | 'branded' | 'home'; } export function CardLink({ href, title, desc, icon, variation = 'plain', className, }: CardLinkProps) { const classes = classNames( `docs-cardLink`, `docs-cardLink--${variation}`, className ); return ( {icon &&
{icon}
}
{title}
{desc}
); } interface CardLinkGroupProps { title?: string; // Passing an id to the group attaches it to the title, which // will allow it to show in the ToC id?: string; children: React.ReactNode; templateColumns?: string | object; gap?: string; } export function CardLinkGroup({ title, children, templateColumns = { base: '1fr', large: '1fr 1fr' }, id, gap = 'large', }: CardLinkGroupProps) { return ( <> {title ? ( { /* Assuming you added an id for this to show in the ToC, * we'll add the utility hover anchor link here */ id ? ( ) : null } {title} ) : null} {children} ); }