import { JSX, useLayoutEffect, useState } from "react"; import { type BundledLanguage, highlight } from "../../highlight"; type Props = { code: string; language: BundledLanguage; }; export default function CodeBlock({ code, language }: Props) { const [nodes, setNodes] = useState(null); useLayoutEffect(() => { highlight(code, language).then(setNodes); }, [code, language]); return (
			{nodes === null ? {code} : nodes}
		
); }