import { jsx as _jsx } from "react/jsx-runtime";
import { Icon } from "@powerhousedao/design-system";
import { useCopyToClipboard } from "usehooks-ts";
export const DocumentState = (props) => {
    const { documentState, onCopyState } = props;
    const [, copy] = useCopyToClipboard();
    function handleCopy() {
        const jsonState = JSON.stringify(documentState, null, 2);
        copy(jsonState)
            .then(() => {
            onCopyState?.();
        })
            .catch((error) => {
            console.error("Failed to copy document state!", error);
        });
    }
    return (_jsx("button", { className: "rounded-lg bg-slate-50 p-1 text-stone-300", onClick: handleCopy, children: _jsx(Icon, { name: "CurlyBrackets" }) }));
};
//# sourceMappingURL=document-state.js.map