"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "TPSLList", {
    enumerable: true,
    get: function() {
        return TPSLList;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _tpsl_listview = require("../../block/tp_sl/tpsl_listview");
const _react = require("react");
const _tab = require("../../tab");
const _divider = require("../../divider");
const _header = require("../../block/orders/full/header");
const _types = require("@orderly.network/types");
const _hooks = require("@orderly.network/hooks");
const TPSLList = (props)=>{
    const { height } = (0, _react.useContext)(_tab.TabContext);
    const [side, setSide] = (0, _react.useState)();
    const [orders, { total }] = (0, _hooks.useOrderStream)({
        status: _types.OrderStatus.INCOMPLETE,
        side,
        includes: [
            _types.AlgoOrderRootType.POSITIONAL_TP_SL,
            _types.AlgoOrderRootType.TP_SL
        ]
    }, {
        keeplive: true
    });
    // console.log("orders", orders);
    return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
        children: [
            /*#__PURE__*/ (0, _jsxruntime.jsx)(_header.Header, {
                count: orders?.length ?? 0,
                onSideChange: setSide,
                side: side,
                orderType: _types.AlgoOrderRootType.TP_SL,
                status: _types.OrderStatus.INCOMPLETE
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)(_divider.Divider, {}),
            /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
                className: "orderly-relative",
                style: {
                    height: `${(height?.content ?? 100) - 55}px`
                },
                children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_tpsl_listview.TPSLListView, {
                    dataSource: orders ?? []
                })
            })
        ]
    });
};

//# sourceMappingURL=tp_sl_list.js.map