UNPKG

json-joy

Version:

Collection of libraries for building collaborative editing apps.

23 lines (22 loc) 764 B
// biome-ignore lint: React is used for JSX import * as React from 'react'; import { CommonSliceType } from '../../../../json-crdt-extensions'; import { Blockquote } from './Blockquote'; import { Codeblock } from './Codeblock'; export const RenderBlock = (props) => { const { block, children } = props; const tag = block.tag(); switch (tag) { case '': return children; case CommonSliceType.codeblock: { return React.createElement(Codeblock, { ...props }); } case CommonSliceType.blockquote: { return React.createElement(Blockquote, { ...props }); } default: { return React.createElement("p", { style: { padding: '16px 0' } }, children); } } };