"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, {
    UnPnlPriceBasisCheckBox: function() {
        return UnPnlPriceBasisCheckBox;
    },
    UnPnlPriceBasisType: function() {
        return UnPnlPriceBasisType;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
const _lucidereact = require("lucide-react");
function _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}
var UnPnlPriceBasisType;
(function(UnPnlPriceBasisType) {
    UnPnlPriceBasisType[UnPnlPriceBasisType["MARKET_PRICE"] = 0] = "MARKET_PRICE";
    UnPnlPriceBasisType[UnPnlPriceBasisType["LAST_PRICE"] = 1] = "LAST_PRICE";
})(UnPnlPriceBasisType || (UnPnlPriceBasisType = {}));
const UnPnlPriceBasisCheckBox = ({ value, onValueChange })=>{
    return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
        className: "orderly-flex orderly-items-center orderly-space-x-3",
        children: [
            /*#__PURE__*/ (0, _jsxruntime.jsx)(UnPnlPriceBasisItem, {
                active: value === 0,
                label: "Mark Price",
                value: 0,
                onClick: onValueChange
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)(UnPnlPriceBasisItem, {
                active: value === 1,
                label: "Last Price",
                value: 1,
                onClick: onValueChange
            })
        ]
    });
};
const UnPnlPriceBasisItem = (props)=>{
    let clsName = "orderly-flex orderly-items-center orderly-gap-1 orderly-cursor-pointer";
    if (props.active) {
        clsName += " orderly-text-base-contrast";
    } else {
        clsName += " orderly-text-base-contrast-54";
    }
    return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
        className: clsName,
        onClick: ()=>{
            props.onClick(props.active ? "" : props.value);
        },
        children: [
            /*#__PURE__*/ (0, _jsxruntime.jsx)("button", {
                type: "button",
                className: "orderly-w-[14px] orderly-h-[14px] orderly-rounded-full orderly-border-2 orderly-border-base-contrast-20",
                children: props.active && // @ts-ignore
                /*#__PURE__*/ (0, _jsxruntime.jsx)(_lucidereact.Circle, {
                    className: "orderly-w-[10px] orderly-h-[10px] orderly-text-base-contrast orderly-bg-base-contrast orderly-rounded-full"
                })
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
                className: "orderly-text-3xs",
                children: props.label
            })
        ]
    });
};

//# sourceMappingURL=unPnlPriceBasisCheckBox.js.map