import { RefObject , useCallback } from "react" ; export function elementHasNestedTreeNode ( element ) { return element ?. lastElementChild ?. className . includes ( "widget-tree-node" ) ?? true ; } export const useTreeNodeLazyLoading = ( treeNodeBranchBody ) : { hasNestedTreeNode : ( ) => boolean ; } => { const hasNestedTreeNode = useCallback ( ( ) => treeNodeBranchBody . current ?. lastElementChild ?. className . includes ( "widget-tree-node" ) ?? true , [ ] ) ; return { hasNestedTreeNode } ; } ;