UNPKG

@udus/notion-renderer

Version:
6 lines (5 loc) 682 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { RichText } from "../RichText/RichText.js"; export const Code = ({ block }) => { return (_jsxs("div", { id: block.id, className: "notion-block notion-code", children: [_jsx("div", { className: "notion-code-header", children: _jsx("div", { className: "notion-code-langage", children: block.code.language }) }), _jsx("pre", { className: "notion-code-body", children: _jsx("code", { children: _jsx(RichText, { richText: block.code.rich_text }) }) }), block.code.caption && (_jsx("div", { className: "notion-caption notion-code-caption", children: _jsx(RichText, { richText: block.code.caption }) }))] })); };