import { useNamespace } from "../../../hooks/use-namespace/index.mjs";
import { ElText } from "../../text/index.mjs";
import { treeNodeContentProps, ROOT_TREE_INJECTION_KEY } from "./virtual-tree.mjs";
import { defineComponent, inject, h } from "vue";
var tree_node_content_default = defineComponent({
  name: "ElTreeNodeContent",
  props: treeNodeContentProps,
  setup(props) {
    const tree = inject(ROOT_TREE_INJECTION_KEY);
    const ns = useNamespace("tree");
    return () => {
      const node = props.node;
      const { data } = node;
      return (tree == null ? void 0 : tree.ctx.slots.default) ? tree.ctx.slots.default({
        node,
        data
      }) : h(ElText, {
        tag: "span",
        truncated: true,
        class: ns.be("node", "label")
      }, () => [node == null ? void 0 : node.label]);
    };
  }
});
export {
  tree_node_content_default as default
};
