diff --git a/apps/kb/src/components/Card.astro b/apps/kb/src/components/Card.astro new file mode 100644 index 00000000000..8784427734e --- /dev/null +++ b/apps/kb/src/components/Card.astro @@ -0,0 +1,45 @@ +--- +// Small "glass panel" card, adapted from apps/docs' GlassPanel +// (packages/ui-patterns/src/GlassPanel/index.tsx) — same surface treatment +// (bg-surface-75, hover:border-strong), trimmed to what kb needs: no +// logo/icon-picker machinery, which pulled in next/image and next-themes +// that don't apply to a plain Astro app. +// +// Unlike GlassPanel (always a plain
, link-agnostic — every call site +// in docs wraps it in a Next.js ), this renders as an itself when +// `href` is given. That's only safe because `topics` render as plain, +// non-linked badges — nothing inside the card is itself a link, so there's +// no nested- problem. +import { Badge } from 'ui' + +interface Props { + href?: string + title: string + description?: string + topics?: string[] + class?: string +} + +const { href, title, description, topics = [], class: className } = Astro.props +const Tag = href ? 'a' : 'div' +--- + + +

{title}

+ {description &&

{description}

} + { + topics.length > 0 && ( +
+ {topics.map((topic) => ( + {topic} + ))} +
+ ) + } +
diff --git a/apps/kb/src/components/Header.tsx b/apps/kb/src/components/Header.tsx index 5f7c344da07..f1b9c746a54 100644 --- a/apps/kb/src/components/Header.tsx +++ b/apps/kb/src/components/Header.tsx @@ -7,7 +7,7 @@ import { ThemeToggle } from './ThemeToggle' // search, no user menu, no dashboard link — kb doesn't have any of that yet. function Header() { return ( -
+