UNPKG

@udus/notion-renderer

Version:
7 lines (6 loc) 600 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { RichText } from "../RichText/RichText.js"; import { BlockList } from "./BlockList.js"; export const Toggle = ({ block }) => { return (_jsxs("details", { id: block.id, className: `notion-block notion-toggle notion-color-${block.toggle.color}`, children: [_jsx("summary", { className: "notion-toggle-summary", children: _jsx(RichText, { richText: block.toggle.rich_text }) }), _jsx("div", { className: "notion-toggle-details", children: block.toggle.children && _jsx(BlockList, { blocks: block.toggle.children }) })] })); };