import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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";
import { TPSLOrderRowProvider } from "../tp_sl/tpslOrderRowContext";
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,
                    isStopOrder: props.isStopOrder
                }),
                /*#__PURE__*/ _jsx(Divider, {}),
                /*#__PURE__*/ _jsx(ListView.separated, {
                    isLoading: props.isLoading,
                    className: "orderly-relative",
                    dataSource: props.dataSource,
                    renderSeparator: (_, index)=>/*#__PURE__*/ _jsx(Divider, {}),
                    renderItem: (item, index)=>/*#__PURE__*/ _jsx(SymbolProvider, {
                            symbol: item.symbol,
                            children: /*#__PURE__*/ _jsx(TPSLOrderRowProvider, {
                                order: item,
                                children: /*#__PURE__*/ _jsx(OrderCell, {
                                    order: item,
                                    onSymbolChange: props.onSymbolChange
                                })
                            })
                        }),
                    loadMore: props.loadMore
                })
            ]
        })
    });
};

//# sourceMappingURL=orders.js.map