diff --git a/components/FolderTree.js b/components/FolderTree.js
index b0a8922..d18efa3 100644
--- a/components/FolderTree.js
+++ b/components/FolderTree.js
@@ -1,34 +1,33 @@
-import * as React from 'react';
-import { TreeView, TreeItem } from '@mui/x-tree-view';
-import { useRouter } from 'next/router'
-import { styled } from '@mui/material/styles';
+import * as React from "react";
+import { TreeView, TreeItem } from "@mui/x-tree-view";
+import { useRouter } from "next/router";
+import { styled } from "@mui/material/styles";
const TCTreeItem = styled(TreeItem)(({ theme }) => ({
- '& .MuiTreeItem-content': {
- borderRadius: '10px',
- '&:hover': {
- backgroundColor: 'rgba(25, 118, 210, 0.59)'
+ "& .MuiTreeItem-content": {
+ borderRadius: "10px",
+ "&:hover": {
+ backgroundColor: "rgba(25, 118, 210, 0.59)",
},
- '& .MuiTreeItem-label': {
- fontSize: '1rem',
- paddingLeft: '6px',
- fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif,',
+ "& .MuiTreeItem-label": {
+ fontSize: "1rem",
+ paddingLeft: "6px",
+ fontFamily:
+ '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif,',
lineHeight: 2.0,
-
},
},
-}))
-
+}));
export default function FolderTree(props) {
- const router = useRouter()
+ const router = useRouter();
- const memoTree = React.useMemo(() => renderTree(props.tree), [props.tree])
- const expandedNodes = [props.tree.id]
+ const memoTree = React.useMemo(() => renderTree(props.tree), [props.tree]);
+ const expandedNodes = [props.tree.id];
return (
<>
- {"<-"} Back To Portfolio
+ {"<-"} Back To Portfolio
}
onNodeSelect={(event, nodIds) => {
- const currentNode = props.flattenNodes.find(aNode => {
- return aNode.id === nodIds
- })
+ // TODO: already sorted, impliment binary search
+ const currentNode = props.flattenNodes.find((aNode) => {
+ return aNode.id === nodIds;
+ });
+ console.log({ currentNode });
if (currentNode != null && currentNode.routePath != null) {
- router.push(currentNode.routePath)
+ router.push(currentNode.routePath);
}
}}
- sx={{ overflowY: 'scroll' }}
+ sx={{ overflowY: "scroll" }}
>
{memoTree}
@@ -53,26 +54,55 @@ export default function FolderTree(props) {
function ChevronRightIcon() {
return (
-