import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useMemo } from "react";
import { cn } from "../../../utils";
import { Circle } from "lucide-react";
export const PnlFormatView = (props)=>{
    const { type, curType, setPnlFormat } = props;
    const text = 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__*/ _jsxs("div", {
        className: clsName,
        onClick: ()=>{
            setPnlFormat(type);
        },
        children: [
            /*#__PURE__*/ _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__*/ _jsx(Circle, {
                    className: "orderly-order-entry-radio-circle orderly-w-[10px] orderly-h-[10px] orderly-text-link orderly-bg-link orderly-rounded-full"
                })
            }),
            /*#__PURE__*/ _jsx("span", {
                className: cn("orderly-text-[16px] orderly-ml-2 orderly-text-base-contrast-54", isSelected && "orderly-text-base-contrast"),
                children: text
            })
        ]
    });
};

//# sourceMappingURL=pnlFormat.js.map