Files
blitzkit/packages/website-ue/src/components/HighlightedCodeContent.tsx
T
2026-03-19 18:26:08 -05:00

18 lines
446 B
TypeScript

import type { Root } from "hast";
import { toJsxRuntime } from "hast-util-to-jsx-runtime";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
import { Code } from "./Code";
interface Props {
tree: Root | string;
}
export function HighlightedCodeContent({ tree }: Props) {
const node =
typeof tree === "string"
? tree
: toJsxRuntime(tree, { Fragment, jsx, jsxs });
return <Code variant="solid" children={node} />;
}