+ {
+ if (node.isInternal) {
+ node.toggle();
+ } else {
+ node.tree.props.onNodeClick(node);
+ }
+ }}
+ >
+
+
+ {node.data.name}
+
+
+
);
};
const FileTree = ({ files, handleFileSelect }) => {
- const handleNodeClick = (node) => {
- if (!node.isInternal) {
- handleFileSelect(node.data.path);
- }
- };
+ const target = useRef(null);
+ const size = useSize(target);
return (
-