"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "PnlFormatView", {
    enumerable: true,
    get: function() {
        return PnlFormatView;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _react = require("react");
const _utils = require("../../../utils");
const _lucidereact = require("lucide-react");
const PnlFormatView = (props)=>{
    const { type, curType, setPnlFormat } = props;
    const text = (0, _react.useMemo)(()=>{
        switch(type){
            case "roi_pnl":
                return "ROI & PnL";
            case "roi":
                return "ROI";
            case "pnl":
                return "PnL";
        }
    }, [
        type
    ]);
    const isSelected = type === curType;
    let clsName = "orderly-flex orderly-items-center orderly-gap-1 orderly-cursor-pointer";
    if (isSelected) {
        clsName += " orderly-text-base-contrast";
    } else {
        clsName += "";
    }
    return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
        className: clsName,
        onClick: ()=>{
            setPnlFormat(type);
        },
        children: [
            /*#__PURE__*/ (0, _jsxruntime.jsx)("button", {
                type: "button",
                className: "orderly-order-entry-radio-button orderly-w-[14px] orderly-h-[14px] orderly-rounded-full orderly-border-2 orderly-border-base-contrast-20",
                children: isSelected && // @ts-ignore
                /*#__PURE__*/ (0, _jsxruntime.jsx)(_lucidereact.Circle, {
                    className: "orderly-order-entry-radio-circle orderly-w-[10px] orderly-h-[10px] orderly-text-link orderly-bg-link orderly-rounded-full"
                })
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
                className: (0, _utils.cn)("orderly-text-[16px] orderly-ml-2 orderly-text-base-contrast-54", isSelected && "orderly-text-base-contrast"),
                children: text
            })
        ]
    });
};

//# sourceMappingURL=pnlFormat.js.map