"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "PositionPane", {
    enumerable: true,
    get: function() {
        return PositionPane;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _react = require("react");
const _positions = require("../../../../../../block/positions");
const _hooks = require("@orderly.network/hooks");
const _types = require("@orderly.network/types");
const _page = require("../../../../../../page");
const _tabContext = require("../../../../../../tab/tabContext");
const PositionPane = (props)=>{
    const context = (0, _react.useContext)(_page.TradingPageContext);
    const { data: tabExtraData } = (0, _tabContext.useTabContext)();
    const calcMode = tabExtraData.unPnlPriceBasis === 0 ? "markPrice" : "lastPrice";
    const [data, info, { loading }] = (0, _hooks.usePositionStream)(tabExtraData.showAllSymbol ? "" : context.symbol, {
        calcMode
    });
    const { state } = (0, _hooks.useAccount)();
    const { data: { pnlNotionalDecimalPrecision } } = (0, _tabContext.useTabContext)();
    return /*#__PURE__*/ (0, _jsxruntime.jsx)(_positions.PositionsViewFull, {
        dataSource: state.status < _types.AccountStatusEnum.EnableTrading ? [] : data.rows,
        aggregated: data.aggregated,
        isLoading: loading,
        showAllSymbol: tabExtraData.showAllSymbol,
        onSymbolChange: context.onSymbolChange,
        pnlNotionalDecimalPrecision: pnlNotionalDecimalPrecision,
        ...props
    });
};

//# sourceMappingURL=index.js.map