"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "default", {
    enumerable: true,
    get: function() {
        return SwitchMarginModulePlace;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _switchOperateIcon = require("../../../../icon/icons/switchOperateIcon");
const _switchMarginModuleTopIcon = require("../../../../icon/icons/switchMarginModuleTopIcon");
const _switchMarginModuleBottomIcon = require("../../../../icon/icons/switchMarginModuleBottomIcon");
const _react = require("react");
const _utils = require("../../../../utils");
const _layoutContext = require("../../../../layout/layoutContext");
function SwitchMarginModulePlace() {
    const [open, setOpen] = (0, _react.useState)(false);
    const triggerRef = (0, _react.useRef)(null);
    const { marginModulePosition, setMarginModulePosition } = (0, _react.useContext)(_layoutContext.LayoutContext);
    return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
        className: "orderly-absolute orderly-top-4 orderly-right-0 orderly-z-[40]",
        ref: triggerRef,
        onMouseEnter: ()=>setOpen(true),
        onMouseLeave: ()=>setOpen(false),
        children: [
            /*#__PURE__*/ (0, _jsxruntime.jsx)(_switchOperateIcon.SwitchOperateIcon, {
                className: (0, _utils.cn)("orderly-absolute orderly-right-0 orderly-text-base-contrast-20 orderly-top-0 hover:orderly-text-base-contrast-54 orderly-cursor-pointer", open && "orderly-text-base-contrast-54")
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
                className: (0, _utils.cn)("orderly-hidden orderly-mr-3 orderly-p-1 orderly-w-6 orderly-h-12 orderly-border orderly-border-solid orderly-border-base-contrast-12 orderly-rounded-sm orderly-bg-[#16141C] orderly-flex-col orderly-items-center orderly-justify-between", open && " orderly-flex"),
                children: [
                    /*#__PURE__*/ (0, _jsxruntime.jsx)(_switchMarginModuleTopIcon.SwitchMarginModuleTopIcon, {
                        onClick: ()=>setMarginModulePosition("top"),
                        className: (0, _utils.cn)("orderly-text-base-contrast-54 hover:orderly-text-primary orderly-cursor-pointer orderly-rounded-[2px]", marginModulePosition === "top" && "orderly-text-primary orderly-bg-base-500")
                    }),
                    /*#__PURE__*/ (0, _jsxruntime.jsx)(_switchMarginModuleBottomIcon.SwitchMarginModuleBottomIcon, {
                        onClick: ()=>setMarginModulePosition("bottom"),
                        className: (0, _utils.cn)("orderly-text-base-contrast-54 hover:orderly-text-primary orderly-cursor-pointer orderly-rounded-[2px]", marginModulePosition === "bottom" && "orderly-text-primary orderly-bg-base-500")
                    })
                ]
            })
        ]
    });
}

//# sourceMappingURL=switchMarginModulePlace.js.map