import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { Divider } from "../../divider";
import { PositionCell } from "./cell";
import { PositionOverview } from "./overview";
import { ListView } from "../../listView";
import { StatisticStyleProvider } from "../../statistic/defaultStaticStyle";
import { SymbolProvider } from "../../provider";
export const PositionsView = (props)=>{
    return /*#__PURE__*/ _jsx("div", {
        id: "orderly-positions-mobile",
        children: /*#__PURE__*/ _jsx(StatisticStyleProvider, {
            labelClassName: "orderly-text-3xs orderly-text-base-contrast/30",
            valueClassName: "orderly-text-base-contrast/80",
            children: /*#__PURE__*/ _jsxs("div", {
                children: [
                    /*#__PURE__*/ _jsx(PositionOverview, {
                        onMarketCloseAll: props.onMarketCloseAll,
                        aggregated: props.aggregated,
                        onShowAllSymbolChange: props.onShowAllSymbolChange,
                        showAllSymbol: props.showAllSymbol
                    }),
                    /*#__PURE__*/ _jsx(Divider, {}),
                    /*#__PURE__*/ _jsx(_Fragment, {
                        children: /*#__PURE__*/ _jsx(ListView.separated, {
                            dataSource: props.dataSource,
                            renderItem: (item, index)=>{
                                return /*#__PURE__*/ _jsx(SymbolProvider, {
                                    symbol: item.symbol,
                                    children: /*#__PURE__*/ _jsx(PositionCell, {
                                        item: item,
                                        onLimitClose: props.onLimitClose,
                                        onMarketClose: props.onMarketClose,
                                        onSymbolChange: props.onSymbolChange,
                                        onTPSLOrder: props.onTPSLOrder
                                    })
                                });
                            },
                            renderSeparator: (item, index)=>{
                                return /*#__PURE__*/ _jsx(Divider, {}, index);
                            },
                            loadMore: props.loadMore
                        })
                    })
                ]
            })
        })
    });
};

//# sourceMappingURL=positions.js.map