import * as React from "react"; import ReactMarkdown, { type Components } from "react-markdown"; import remarkGfm from "remark-gfm"; import rehypeSanitize from "rehype-sanitize"; import { cn } from "@/lib/utils"; /** * MarkdownContent — WealthX DS (Atom) * * Renders a markdown string into safe, design-system-styled HTML. Used to render * AI / assistant responses that arrive as markdown (headings, lists, bold, links, * tables, code blocks) instead of plain text. * * Safety: every render runs through `rehype-sanitize` with the default schema, so * untrusted model output cannot inject scripts, event handlers, or unsafe URLs. * * Styling is applied per-element via the `components` map (the repo does not ship * `@tailwindcss/typography`), using design tokens only and sharp corners. */ export interface MarkdownContentProps { /** The markdown source string to render. */ content: string; /** Density of the rendered text. Defaults to `"medium"`. */ size?: "small" | "medium"; /** * Known mention labels (e.g. staff names). Any `@