"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RenderBlock = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const json_crdt_extensions_1 = require("../../../../json-crdt-extensions");
const Blockquote_1 = require("./Blockquote");
const Codeblock_1 = require("./Codeblock");
const RenderBlock = (props) => {
    const { block, children } = props;
    const tag = block.tag();
    switch (tag) {
        case '':
            return children;
        case json_crdt_extensions_1.CommonSliceType.codeblock: {
            return React.createElement(Codeblock_1.Codeblock, { ...props });
        }
        case json_crdt_extensions_1.CommonSliceType.blockquote: {
            return React.createElement(Blockquote_1.Blockquote, { ...props });
        }
        case json_crdt_extensions_1.CommonSliceType.h1: {
            return React.createElement("h1", null, children);
        }
        case json_crdt_extensions_1.CommonSliceType.h2: {
            return React.createElement("h2", null, children);
        }
        case json_crdt_extensions_1.CommonSliceType.h3: {
            return React.createElement("h3", null, children);
        }
        case json_crdt_extensions_1.CommonSliceType.h4: {
            return React.createElement("h4", null, children);
        }
        case json_crdt_extensions_1.CommonSliceType.h5: {
            return React.createElement("h5", null, children);
        }
        case json_crdt_extensions_1.CommonSliceType.h6: {
            return React.createElement("h6", null, children);
        }
        case json_crdt_extensions_1.CommonSliceType.title: {
            return React.createElement("h1", null, children);
        }
        case json_crdt_extensions_1.CommonSliceType.subtitle: {
            return React.createElement("h2", null, children);
        }
        default: {
            return React.createElement("p", { style: { padding: '16px 0' } }, children);
        }
    }
};
exports.RenderBlock = RenderBlock;
//# sourceMappingURL=index.js.map