import type { EntityLink } from "@/lib/catalog";
/** A record link. Glossary and preview render only when that optional data is present. */
export function RecordLink({ link }: { link: EntityLink }) {
const anchor = link.href ? (
{link.title}
) : (
{link.title}
);
return (
{link.glossary ? (
{anchor}
{link.glossary}
) : (
anchor
)}
{link.preview ? (
{link.preview.title}
{link.preview.summary}
) : null}
);
}