"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "UnrealizedPnLPopoverCard", {
    enumerable: true,
    get: function() {
        return UnrealizedPnLPopoverCard;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _divider = require("../../../divider");
const _unPnlPriceBasisCheckBox = require("../../../page/trading/desktop/sections/datalist/unPnlPriceBasisCheckBox");
const _tabContext = require("../../../tab/tabContext");
const _react = require("react");
const UnrealizedPnLPopoverCard = (props)=>{
    const { unPnlPriceBasis, setUnPnlPriceBasic } = props;
    const { updateData } = (0, _tabContext.useTabContext)();
    const onUnPnlPriceBasisChanged = (0, _react.useCallback)((type)=>{
        var value = 0;
        switch(type){
            case _unPnlPriceBasisCheckBox.UnPnlPriceBasisType.MARKET_PRICE:
                value = 0;
                break;
            case _unPnlPriceBasisCheckBox.UnPnlPriceBasisType.LAST_PRICE:
                value = 1;
                break;
        }
        updateData("unPnlPriceBasis", value);
        setUnPnlPriceBasic(type);
    }, [
        unPnlPriceBasis
    ]);
    return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
        children: [
            /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
                children: "Current unrealized profit or loss on your open positions across all widgets calculated using Mark Price."
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)(_divider.Divider, {
                className: "orderly-py-2 orderly-border-white/10"
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
                className: "orderly-mb-2",
                children: "Unrealized PnL Price Basis"
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)(_unPnlPriceBasisCheckBox.UnPnlPriceBasisCheckBox, {
                value: unPnlPriceBasis,
                onValueChange: onUnPnlPriceBasisChanged
            })
        ]
    });
};

//# sourceMappingURL=unrealPnLHover.js.map