import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Divider } from "../../../divider";
import { UnPnlPriceBasisCheckBox, UnPnlPriceBasisType } from "../../../page/trading/desktop/sections/datalist/unPnlPriceBasisCheckBox";
import { useTabContext } from "../../../tab/tabContext";
import { useCallback } from "react";
export const UnrealizedPnLPopoverCard = (props)=>{
    const { unPnlPriceBasis, setUnPnlPriceBasic } = props;
    const { updateData } = useTabContext();
    const onUnPnlPriceBasisChanged = useCallback((type)=>{
        var value = 0;
        switch(type){
            case UnPnlPriceBasisType.MARKET_PRICE:
                value = 0;
                break;
            case UnPnlPriceBasisType.LAST_PRICE:
                value = 1;
                break;
        }
        updateData("unPnlPriceBasis", value);
        setUnPnlPriceBasic(type);
    }, [
        unPnlPriceBasis
    ]);
    return /*#__PURE__*/ _jsxs("div", {
        children: [
            /*#__PURE__*/ _jsx("span", {
                children: "Current unrealized profit or loss on your open positions across all widgets calculated using Mark Price."
            }),
            /*#__PURE__*/ _jsx(Divider, {
                className: "orderly-py-2 orderly-border-white/10"
            }),
            /*#__PURE__*/ _jsx("div", {
                className: "orderly-mb-2",
                children: "Unrealized PnL Price Basis"
            }),
            /*#__PURE__*/ _jsx(UnPnlPriceBasisCheckBox, {
                value: unPnlPriceBasis,
                onValueChange: onUnPnlPriceBasisChanged
            })
        ]
    });
};

//# sourceMappingURL=unrealPnLHover.js.map