import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { ItemSearch } from "./ItemSearch";
import ContentTree from "../ContentTree";
import { cn } from "../../lib/utils";
import { normalizeGuid } from "../utils";
export function TreeListSelector({ language, rootItemIds, database = "master", selectedItemIds, onSelectionChange, onDoubleClick, onItemSelected, readOnly, className, expandIdPath, showSearch = true, selectionMode = "multiple", multiSelectRequiresModifier = true, enableDragAndDrop, isDraggable, showGrabCursorForDraggableNodes, }) {
    const normalizedRootIds = rootItemIds?.map((id) => normalizeGuid(id));
    return (_jsxs("div", { className: cn("flex h-full flex-col bg-white", className), children: [showSearch && (_jsx("div", { className: cn("border-b border-gray-100 p-2", readOnly && "bg-gray-5"), children: _jsx(ItemSearch, { rootItemIds: normalizedRootIds, language: language, database: database, itemSelected: (item) => onItemSelected?.(item), disabled: readOnly }) })), _jsx("div", { className: cn("relative flex-1 overflow-auto", readOnly && "bg-gray-5"), children: _jsx(ContentTree, { language: language, rootItemIds: rootItemIds, database: database, selectedItemIds: selectedItemIds, onSelectionChange: onSelectionChange, onDoubleClick: onDoubleClick, selectionMode: selectionMode, multiSelectRequiresModifier: multiSelectRequiresModifier, hideRootNodes: true, expandIdPath: expandIdPath, includeItemPath: true, enableDragAndDrop: enableDragAndDrop, isDraggable: isDraggable, showGrabCursorForDraggableNodes: showGrabCursorForDraggableNodes }) })] }));
}
export default TreeListSelector;
//# sourceMappingURL=TreeListSelector.js.map