"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 _useFormatOrderHistory = require("../../../../../../page/trading/shared/hooks/useFormatOrderHistory");
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
    });
    const formattedData = (0, _useFormatOrderHistory.useFormatOrderHistory)(state.status < _types.AccountStatusEnum.EnableTrading || !data ? [] : data);
    return /*#__PURE__*/ (0, _jsxruntime.jsx)(_orderHistory.HistoryListView, {
        isLoading: isLoading,
        dataSource: formattedData,
        onSideChange: setSide,
        onStatusChange: setStauts,
        onSymbolChange: onSymbolChange,
        side: side,
        status: status,
        loadMore: loadMore,
        onCancelAlgoOrder: ()=>{
            throw new Error("Not implemented");
        },
        onCancelOrder: ()=>{
            throw new Error("Not implemented");
        }
    });
};

//# sourceMappingURL=index.js.map