"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WysiwygEditorComponent = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const WysiwygEditorComponent = function WysiwygEditorComponent({ className, autofocus, editor, children }) {
    const ref = (0, react_1.useRef)(null);
    (0, react_1.useEffect)(() => {
        const { current } = ref;
        if (current) {
            current.appendChild(editor.wysiwygEditor.dom);
            if (autofocus) {
                editor.focus();
            }
        }
    }, [editor]);
    return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: className, children: children }));
};
exports.WysiwygEditorComponent = WysiwygEditorComponent;
//# sourceMappingURL=WysiwygEditorComponent.js.map
