"use client";
import { createSplitProps } from "../../utils/create-split-props.js";
import { useTreeViewContext } from "../tree-view/use-tree-view-context.js";
import { TreeViewTree } from "../tree-view/tree-view-tree.js";
import { JsonTreeViewNode } from "./json-tree-view-node.js";
import { forwardRef } from "react";
import { jsx } from "react/jsx-runtime";
//#region src/components/json-tree-view/json-tree-view-tree.tsx
var splitTreeNodeProps = createSplitProps();
var JsonTreeViewTree = forwardRef((props, ref) => {
	const [nodeProps, treeProps] = splitTreeNodeProps(props, [
		"arrow",
		"indentGuide",
		"renderValue"
	]);
	const tree = useTreeViewContext();
	const children = tree.collection.getNodeChildren(tree.collection.rootNode);
	return /* @__PURE__ */ jsx(TreeViewTree, {
		"data-scope": "json-tree-view",
		...treeProps,
		ref,
		children: children.map((child, index) => /* @__PURE__ */ jsx(JsonTreeViewNode, {
			node: child,
			indexPath: [index],
			...nodeProps
		}, index))
	});
});
JsonTreeViewTree.displayName = "JsonTreeViewTree";
//#endregion
export { JsonTreeViewTree };
