"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "TriggerPriceItem", {
    enumerable: true,
    get: function() {
        return TriggerPriceItem;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _numeral = require("../../../text/numeral");
const _hooks = require("@orderly.network/hooks");
const _types = require("@orderly.network/types");
const TriggerPriceItem = (props)=>{
    const { qty, price, entryPrice, orderSide, orderType, symbolInfo } = props;
    const pnl = _hooks.utils.priceToPnl({
        qty,
        price,
        entryPrice,
        orderSide,
        orderType
    }, {
        symbol: symbolInfo
    });
    const type = orderType === _types.AlgoOrderType.TAKE_PROFIT ? "TP" : "SL";
    return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
        className: "orderly-flex orderly-items-center",
        children: [
            /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
                className: "orderly-text-base-contrast-54 orderly-mr-1",
                children: `${type} PnL:`
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)(_numeral.Numeral, {
                rule: "price",
                className: pnl === 0 ? "orderly-text-base-contrast-36" : pnl > 0 ? "orderly-text-trade-profit orderly-gap-0" : "orderly-text-trade-loss orderly-gap-0",
                prefix: // @ts-ignore
                /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
                    children: pnl === 0 ? "" : pnl > 0 ? "+" : "-"
                }),
                surfix: /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
                    className: "orderly-text-base-contrast-36 orderly-ml-1",
                    children: "USDC"
                }),
                children: `${Math.abs(pnl)}`
            })
        ]
    });
};

//# sourceMappingURL=triggerPrice.js.map