import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { Label } from "../../../label";
import { modal } from "../../../modal";
import { useCallback, useState } from "react";
import { Tooltip, TooltipArrow, TooltipContent, TooltipTrigger } from "@radix-ui/react-tooltip";
export const MobileReduceOnlyLabel = ()=>{
    const showReduceOnlyHint = useCallback(()=>{
        modal.alert({
            title: "Reduce only",
            message: /*#__PURE__*/ _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__*/ _jsx(_Fragment, {
        children: /*#__PURE__*/ _jsx(Label, {
            className: "orderly-text-base-contrast-54",
            onClick: ()=>{
                showReduceOnlyHint();
            },
            children: "Reduce only"
        })
    });
};
export const DesktopReduceOnlyLabel = ()=>{
    const [open, setOpen] = useState(false);
    return /*#__PURE__*/ _jsx(_Fragment, {
        children: /*#__PURE__*/ _jsxs(Tooltip, {
            children: [
                /*#__PURE__*/ _jsx(TooltipTrigger, {
                    children: /*#__PURE__*/ _jsx(Label, {
                        className: "orderly-text-base-contrast-54",
                        children: "Reduce only"
                    })
                }),
                /*#__PURE__*/ _jsxs(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__*/ _jsx("div", {
                            children: /*#__PURE__*/ _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__*/ _jsx(TooltipArrow, {
                            className: "orderly-fill-base-400"
                        })
                    ]
                })
            ]
        })
    });
};

//# sourceMappingURL=reduceOnly.js.map