"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "RegularCell", {
    enumerable: true,
    get: function() {
        return RegularCell;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _statistic = require("../../statistic/statistic");
const _numeralTotal = require("../../text/numeralTotal");
const _types = require("@orderly.network/types");
const RegularCell = (props)=>{
    const { order, base_dp, quote_dp } = props;
    const isAlgoOrder = order?.algo_order_id !== undefined;
    // console.log("price node", order);
    const isStopMarket = order?.type === "MARKET" && isAlgoOrder;
    return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
        children: [
            /*#__PURE__*/ (0, _jsxruntime.jsx)(_statistic.Statistic, {
                label: "Qty.",
                labelClassName: "orderly-text-4xs orderly-text-base-contrast-36",
                value: order.quantity ?? "-",
                precision: base_dp,
                rule: "price",
                valueClassName: order.side === _types.OrderSide.BUY ? "orderly-text-trade-profit orderly-text-3xs" : "orderly-text-trade-loss orderly-text-3xs"
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)(_statistic.Statistic, {
                label: "Filled",
                labelClassName: "orderly-text-4xs orderly-text-base-contrast-36",
                valueClassName: "orderly-text-3xs orderly-text-base-contrast-80",
                // @ts-ignore
                value: order.total_executed_quantity ?? "-",
                rule: "price",
                precision: base_dp
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)(_statistic.Statistic, {
                label: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
                    children: [
                        /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
                            className: "orderly-text-base-contrast-36",
                            children: "Est. total"
                        }),
                        /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
                            className: "orderly-text-base-contrast-20",
                            children: "(USDC)"
                        })
                    ]
                }),
                labelClassName: "orderly-text-4xs orderly-text-base-contrast-36",
                valueClassName: "orderly-text-3xs orderly-text-base-contrast-80",
                value: /*#__PURE__*/ (0, _jsxruntime.jsx)(_numeralTotal.NumeralTotal, {
                    price: props.order.price ?? 1,
                    quantity: props.order.quantity,
                    precision: quote_dp
                }),
                align: "right"
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)(_statistic.Statistic, {
                label: /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
                    children: /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
                        className: "orderly-text-base-contrast-36",
                        children: "Trigger price"
                    })
                }),
                labelClassName: "orderly-text-4xs orderly-text-base-contrast-36",
                valueClassName: "orderly-text-3xs orderly-text-base-contrast-80",
                rule: "price",
                precision: quote_dp,
                value: order.trigger_price
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)(_statistic.Statistic, {
                label: /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
                    children: /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
                        className: "orderly-text-base-contrast-36",
                        children: "Limit price"
                    })
                }),
                labelClassName: "orderly-text-4xs orderly-text-base-contrast-36",
                valueClassName: "orderly-text-3xs orderly-text-base-contrast-80",
                value: isStopMarket ? /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
                    children: "Market"
                }) : order.price ?? "-",
                rule: "price",
                precision: quote_dp
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)(_statistic.Statistic, {
                label: /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
                    children: /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
                        className: "orderly-text-base-contrast-36",
                        children: "Mark price"
                    })
                }),
                labelClassName: "orderly-text-4xs orderly-text-base-contrast-36",
                valueClassName: "orderly-text-3xs orderly-text-base-contrast-80",
                rule: "price",
                precision: quote_dp,
                value: order.mark_price,
                align: "right"
            })
        ]
    });
};

//# sourceMappingURL=cell.regular.js.map