"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "TradeData", {
    enumerable: true,
    get: function() {
        return TradeData;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _react = require("react");
const _hooks = require("@orderly.network/hooks");
const _text = require("../../../../../text");
const _provider = require("../../../../../provider");
const _icon = require("../../../../../icon");
const TradeData = (props)=>{
    const { symbol } = props;
    const ticker = (0, _hooks.useTickerStream)(symbol);
    const { quote_dp, base_dp } = (0, _react.useContext)(_provider.SymbolContext);
    //
    return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
        className: "orderly-h-[240px] orderly-p-4 orderly-relative",
        children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("table", {
            className: "orderly-w-full orderly-text-3xs",
            children: [
                /*#__PURE__*/ (0, _jsxruntime.jsxs)("tr", {
                    className: "orderly-h-[28px]",
                    children: [
                        /*#__PURE__*/ (0, _jsxruntime.jsx)("td", {
                            className: "orderly-text-base-contrast-54",
                            children: "Mark price"
                        }),
                        /*#__PURE__*/ (0, _jsxruntime.jsx)("td", {
                            className: "orderly-text-right orderly-text-base-contrast",
                            children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_text.Numeral, {
                                precision: quote_dp,
                                children: ticker?.mark_price
                            })
                        })
                    ]
                }),
                /*#__PURE__*/ (0, _jsxruntime.jsxs)("tr", {
                    className: "orderly-h-[28px]",
                    children: [
                        /*#__PURE__*/ (0, _jsxruntime.jsx)("td", {
                            className: "orderly-text-base-contrast-54",
                            children: "Index price"
                        }),
                        /*#__PURE__*/ (0, _jsxruntime.jsx)("td", {
                            className: "orderly-text-right orderly-text-base-contrast",
                            children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_text.Numeral, {
                                precision: quote_dp,
                                children: ticker?.index_price
                            })
                        })
                    ]
                }),
                /*#__PURE__*/ (0, _jsxruntime.jsxs)("tr", {
                    className: "orderly-h-[28px]",
                    children: [
                        /*#__PURE__*/ (0, _jsxruntime.jsx)("td", {
                            className: "orderly-text-base-contrast-54 ",
                            children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
                                className: "orderly-flex orderly-items-center",
                                children: [
                                    /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
                                        children: "24h volume"
                                    }),
                                    /*#__PURE__*/ (0, _jsxruntime.jsx)(_icon.OrderlyIcon, {
                                        size: 14,
                                        className: "orderly-ml-[6px]"
                                    })
                                ]
                            })
                        }),
                        /*#__PURE__*/ (0, _jsxruntime.jsxs)("td", {
                            className: "orderly-text-right orderly-text-base-contrast",
                            children: [
                                /*#__PURE__*/ (0, _jsxruntime.jsx)(_text.Numeral.total, {
                                    rule: "human",
                                    precision: 2,
                                    price: ticker?.["24h_close"],
                                    quantity: ticker?.["24h_volumn"]
                                }),
                                /*#__PURE__*/ (0, _jsxruntime.jsx)(_text.Text, {
                                    rule: "symbol",
                                    symbolElement: "quote",
                                    className: "orderly-text-base-contrast-36 orderly-ml-2",
                                    children: symbol
                                })
                            ]
                        })
                    ]
                }),
                /*#__PURE__*/ (0, _jsxruntime.jsxs)("tr", {
                    className: "orderly-h-[28px]",
                    children: [
                        /*#__PURE__*/ (0, _jsxruntime.jsx)("td", {
                            className: "orderly-text-base-contrast-54",
                            children: "24h high"
                        }),
                        /*#__PURE__*/ (0, _jsxruntime.jsx)("td", {
                            className: "orderly-text-right orderly-text-base-contrast",
                            children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_text.Numeral, {
                                precision: quote_dp,
                                children: ticker?.["24h_high"]
                            })
                        })
                    ]
                }),
                /*#__PURE__*/ (0, _jsxruntime.jsxs)("tr", {
                    className: "orderly-h-[28px]",
                    children: [
                        /*#__PURE__*/ (0, _jsxruntime.jsx)("td", {
                            className: "orderly-text-base-contrast-54",
                            children: "24h low"
                        }),
                        /*#__PURE__*/ (0, _jsxruntime.jsx)("td", {
                            className: "orderly-text-right orderly-text-base-contrast",
                            children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_text.Numeral, {
                                precision: quote_dp,
                                children: ticker?.["24h_low"]
                            })
                        })
                    ]
                }),
                /*#__PURE__*/ (0, _jsxruntime.jsxs)("tr", {
                    className: "orderly-h-[28px]",
                    children: [
                        /*#__PURE__*/ (0, _jsxruntime.jsx)("td", {
                            className: "orderly-text-base-contrast-54",
                            children: "Open interest"
                        }),
                        /*#__PURE__*/ (0, _jsxruntime.jsxs)("td", {
                            className: "orderly-text-right orderly-text-base-contrast",
                            children: [
                                ticker?.["open_interest"] ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_text.Numeral.total, {
                                    rule: "human",
                                    precision: 2,
                                    price: ticker?.["mark_price"],
                                    quantity: ticker?.["open_interest"]
                                }) : "--",
                                /*#__PURE__*/ (0, _jsxruntime.jsx)(_text.Text, {
                                    className: "orderly-text-base-contrast-36 orderly-ml-2",
                                    children: "USDC"
                                })
                            ]
                        })
                    ]
                })
            ]
        })
    });
};

//# sourceMappingURL=tradeData.js.map