import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Numeral } from "../../../text/numeral";
import { utils } from "@orderly.network/hooks";
import { AlgoOrderType } from "@orderly.network/types";
export const TriggerPriceItem = (props)=>{
    const { qty, price, entryPrice, orderSide, orderType, symbolInfo } = props;
    const pnl = utils.priceToPnl({
        qty,
        price,
        entryPrice,
        orderSide,
        orderType
    }, {
        symbol: symbolInfo
    });
    const type = orderType === AlgoOrderType.TAKE_PROFIT ? "TP" : "SL";
    return /*#__PURE__*/ _jsxs("div", {
        className: "orderly-flex orderly-items-center",
        children: [
            /*#__PURE__*/ _jsx("span", {
                className: "orderly-text-base-contrast-54 orderly-mr-1",
                children: `${type} PnL:`
            }),
            /*#__PURE__*/ _jsx(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__*/ _jsx("span", {
                    children: pnl === 0 ? "" : pnl > 0 ? "+" : "-"
                }),
                surfix: /*#__PURE__*/ _jsx("span", {
                    className: "orderly-text-base-contrast-36 orderly-ml-1",
                    children: "USDC"
                }),
                children: `${Math.abs(pnl)}`
            })
        ]
    });
};

//# sourceMappingURL=triggerPrice.js.map