import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { ListView } from "../../../listView";
import { Divider } from "../../../divider";
import { useCallback } from "react";
import { SortGroup } from "../../../block/markets/sections/sortGroup";
import { Cell } from "./cell";
import { SymbolProvider } from "../../../provider";
export const MarketListView = (props)=>{
    const renderItem = useCallback((item)=>{
        return /*#__PURE__*/ _jsx(SymbolProvider, {
            symbol: item.symbol,
            children: /*#__PURE__*/ _jsx(Cell, {
                item: item,
                onItemClick: props.onItemClick
            })
        });
    }, []);
    const renderSeparator = useCallback(()=>{
        return /*#__PURE__*/ _jsx(Divider, {
            className: "orderly-my-[16px]"
        });
    }, []);
    return /*#__PURE__*/ _jsxs(_Fragment, {
        children: [
            /*#__PURE__*/ _jsx(SortGroup, {
                onChange: props.onSort,
                readLastSortCondition: true
            }),
            /*#__PURE__*/ _jsx(Divider, {}),
            /*#__PURE__*/ _jsx("div", {
                className: "orderly-overflow-y-auto orderly-overflow-hidden orderly-scrollbar-hidden orderly-hide-scrollbar orderly-my-2",
                style: {
                    height: props.listHeight
                },
                children: /*#__PURE__*/ _jsx(ListView.separated, {
                    dataSource: props.dataSource,
                    renderItem: renderItem,
                    renderSeparator: renderSeparator,
                    contentClassName: "orderly-space-y-[16px]",
                    className: "orderly-py-[16px]"
                })
            })
        ]
    });
};

//# sourceMappingURL=listView.js.map