import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
import { useMemo } from "react";
import { usePrivateQuery } from "@orderly.network/hooks";
export const PositionTabTitle = ()=>{
    const { data: positions } = usePrivateQuery("/v1/positions");
    const positionCount = 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__*/ _jsx(_Fragment, {
        children: `Positions(${positionCount})`
    });
};

//# sourceMappingURL=tabTitle.js.map