"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "PositionTabTitle", {
    enumerable: true,
    get: function() {
        return PositionTabTitle;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _react = require("react");
const _hooks = require("@orderly.network/hooks");
const PositionTabTitle = ()=>{
    const { data: positions } = (0, _hooks.usePrivateQuery)("/v1/positions");
    const positionCount = (0, _react.useMemo)(()=>{
        // @ts-ignore
        if (!positions || !positions.rows) return 0;
        // @ts-ignore
        return positions.rows.filter((item)=>item.position_qty !== 0).length;
    }, [
        positions
    ]);
    if (positionCount === 0) {
        return "Positions";
    }
    return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
        children: `Positions(${positionCount})`
    });
};

//# sourceMappingURL=tabTitle.js.map