import { jsx as _jsx } from "react/jsx-runtime";
import { HistoryListView } from "../../../../../../block/orderHistory";
import { TradingPageContext } from "../../../../../../page/trading/context/tradingPageContext";
import { useOrderStream, useAccount } from "@orderly.network/hooks";
import { AccountStatusEnum } from "@orderly.network/types";
import { useContext, useState } from "react";
export const HistoryPane = ()=>{
    const [side, setSide] = useState("");
    const [status, setStauts] = useState("");
    const { state } = useAccount();
    const { onSymbolChange } = useContext(TradingPageContext);
    const [data, { isLoading, loadMore }] = useOrderStream({
        // @ts-ignore
        side,
        // @ts-ignore
        status
    });
    return /*#__PURE__*/ _jsx(HistoryListView, {
        isLoading: isLoading,
        // @ts-ignore
        dataSource: state.status < AccountStatusEnum.EnableTrading ? [] : data,
        onSideChange: setSide,
        onStatusChange: setStauts,
        onSymbolChange: onSymbolChange,
        side: side,
        status: status,
        loadMore: loadMore
    });
};

//# sourceMappingURL=index.js.map