import { jsx as _jsx } from "react/jsx-runtime";
import { classNames } from '../../utils/classNames';
import { treeListClassnames } from './constants';
import { List } from './styles';
import { TreeItem } from './TreeItem';
import { useLogic } from './useLogic';
const INITIAL_LEVEL = 0;
export const TreeList = (props) => {
    const { listProps, itemProps } = useLogic(props);
    const { data, className, expandedLevel = 10, disabledItems, ...restProps } = props;
    return (_jsx(List, { className: classNames(className, treeListClassnames.list), ...listProps, children: data.map((item) => (_jsx(TreeItem, { item: item, level: INITIAL_LEVEL, expandedLevel: expandedLevel, ...itemProps, ...restProps }, item.id))) }));
};
