"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: all[name]
    });
}
_export(exports, {
    DesktopReduceOnlyLabel: function() {
        return DesktopReduceOnlyLabel;
    },
    MobileReduceOnlyLabel: function() {
        return MobileReduceOnlyLabel;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _label = require("../../../label");
const _modal = require("../../../modal");
const _react = require("react");
const _reacttooltip = require("@radix-ui/react-tooltip");
const MobileReduceOnlyLabel = ()=>{
    const showReduceOnlyHint = (0, _react.useCallback)(()=>{
        _modal.modal.alert({
            title: "Reduce only",
            message: /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
                className: "orderly-text-2xs orderly-text-base-contrast-54",
                children: "Reduce only ensures that you can only reduce or close a current position so that your position size will not be increased unintentionally."
            })
        });
    }, []);
    return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
        children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_label.Label, {
            className: "orderly-text-base-contrast-54",
            onClick: ()=>{
                showReduceOnlyHint();
            },
            children: "Reduce only"
        })
    });
};
const DesktopReduceOnlyLabel = ()=>{
    const [open, setOpen] = (0, _react.useState)(false);
    return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
        children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_reacttooltip.Tooltip, {
            children: [
                /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacttooltip.TooltipTrigger, {
                    children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_label.Label, {
                        className: "orderly-text-base-contrast-54",
                        children: "Reduce only"
                    })
                }),
                /*#__PURE__*/ (0, _jsxruntime.jsxs)(_reacttooltip.TooltipContent, {
                    align: "center",
                    className: "orderly-max-w-[300px] orderly-z-20 orderly-text-base-contrast orderly-select-none orderly-rounded orderly-bg-base-400 orderly-p-3 orderly-text-4xs",
                    children: [
                        /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
                            children: /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
                                className: "orderly-text-3xs",
                                children: "Reduce only ensures that you can only reduce or close a current position so that your position size will not be increased unintentionally."
                            })
                        }),
                        /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacttooltip.TooltipArrow, {
                            className: "orderly-fill-base-400"
                        })
                    ]
                })
            ]
        })
    });
};

//# sourceMappingURL=reduceOnly.js.map