"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TreeList = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const classNames_1 = require("../../utils/classNames");
const constants_1 = require("./constants");
const styles_1 = require("./styles");
const TreeItem_1 = require("./TreeItem");
const useLogic_1 = require("./useLogic");
const INITIAL_LEVEL = 0;
const TreeList = (props) => {
    const { listProps, itemProps } = (0, useLogic_1.useLogic)(props);
    const { data, className, expandedLevel = 10, disabledItems, ...restProps } = props;
    return ((0, jsx_runtime_1.jsx)(styles_1.List, { className: (0, classNames_1.classNames)(className, constants_1.treeListClassnames.list), ...listProps, children: data.map((item) => ((0, jsx_runtime_1.jsx)(TreeItem_1.TreeItem, { item: item, level: INITIAL_LEVEL, expandedLevel: expandedLevel, ...itemProps, ...restProps }, item.id))) }));
};
exports.TreeList = TreeList;
