"use client"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { oneDark } from "react-syntax-highlighter/dist/esm/styles/prism"; const MONOSPACE = 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'; const PLAIN_LANGS = new Set(["", "text", "txt", "plain", "plaintext", "none"]); export default function RichCodeBlock({ raw, lang, className, }: { raw: string; lang: string; className?: string; }) { const normalizedLang = (lang || "").toLowerCase(); const isPlain = PLAIN_LANGS.has(normalizedLang); return (
{raw}
) : (