"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
import { CLEAR_EDITOR_COMMAND } from "lexical";
function Debug() {
    const [editor] = useLexicalComposerContext();
    function handleOnSave() {
        console.log(JSON.stringify(editor.getEditorState()));
    }
    function handleOnClear() {
        editor.dispatchCommand(CLEAR_EDITOR_COMMAND, void 0);
        editor.focus();
    }
    return /*#__PURE__*/ jsxs("div", {
        className: "editor-actions",
        children: [
            /*#__PURE__*/ jsx("button", {
                type: "button",
                onClick: handleOnSave,
                children: "Save"
            }),
            /*#__PURE__*/ jsx("button", {
                type: "button",
                onClick: handleOnClear,
                children: "Clear"
            })
        ]
    });
}
export { Debug };
