import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from "react";
import { ListView } from "../../listView";
import { Divider } from "../../divider";
import { OrderCell } from "../../block/orders/cell";
import { Toolbar } from "./toolbar";
import { StatisticStyleProvider } from "../../statistic/defaultStaticStyle";
import { OrderListProvider } from "./shared/orderListContext";
import { SymbolProvider } from "../../provider";
export const OrdersView = (props)=>{
    return /*#__PURE__*/ _jsx(OrderListProvider, {
        cancelOrder: props.cancelOrder,
        editOrder: props.editOrder,
        cancelAlgoOrder: props.cancelAlgoOrder,
        editAlgoOrder: props.editAlgoOrder,
        children: /*#__PURE__*/ _jsxs(StatisticStyleProvider, {
            labelClassName: "orderly-text-3xs orderly-text-base-contrast/30",
            children: [
                /*#__PURE__*/ _jsx(Toolbar, {
                    onCancelAll: props.onCancelAll,
                    onShowAllSymbolChange: props.onShowAllSymbolChange,
                    showAllSymbol: props.showAllSymbol
                }),
                /*#__PURE__*/ _jsx(Divider, {}),
                /*#__PURE__*/ _jsx(ListView.separated, {
                    isLoading: props.isLoading,
                    dataSource: props.dataSource,
                    renderSeparator: (_, index)=>/*#__PURE__*/ _jsx(Divider, {}),
                    renderItem: (item, index)=>/*#__PURE__*/ _jsx(SymbolProvider, {
                            symbol: item.symbol,
                            children: /*#__PURE__*/ _jsx(OrderCell, {
                                order: item,
                                onSymbolChange: props.onSymbolChange
                            })
                        }),
                    loadMore: props.loadMore
                })
            ]
        })
    });
};

//# sourceMappingURL=orders.js.map