"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "HistoryPane", {
    enumerable: true,
    get: function() {
        return HistoryPane;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _orderHistory = require("../../../../../../block/orderHistory");
const _tradingPageContext = require("../../../../../../page/trading/context/tradingPageContext");
const _hooks = require("@orderly.network/hooks");
const _types = require("@orderly.network/types");
const _react = require("react");
const HistoryPane = ()=>{
    const [side, setSide] = (0, _react.useState)("");
    const [status, setStauts] = (0, _react.useState)("");
    const { state } = (0, _hooks.useAccount)();
    const { onSymbolChange } = (0, _react.useContext)(_tradingPageContext.TradingPageContext);
    const [data, { isLoading, loadMore }] = (0, _hooks.useOrderStream)({
        // @ts-ignore
        side,
        // @ts-ignore
        status
    });
    return /*#__PURE__*/ (0, _jsxruntime.jsx)(_orderHistory.HistoryListView, {
        isLoading: isLoading,
        // @ts-ignore
        dataSource: state.status < _types.AccountStatusEnum.EnableTrading ? [] : data,
        onSideChange: setSide,
        onStatusChange: setStauts,
        onSymbolChange: onSymbolChange,
        side: side,
        status: status,
        loadMore: loadMore
    });
};

//# sourceMappingURL=index.js.map