fix treeview imports

This commit is contained in:
Triston Armstrong 2023-12-23 20:06:57 -06:00
parent 08b53b105e
commit ccab82f972

View File

@ -1,12 +1,11 @@
import * as React from 'react'; import * as React from 'react';
import TreeView from '@mui/lab/TreeView'; import { TreeView, TreeItem } from '@mui/x-tree-view';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import ChevronRightIcon from '@mui/icons-material/ChevronRight'; import ChevronRightIcon from '@mui/icons-material/ChevronRight';
import TreeItem from '@mui/lab/TreeItem'; import { useRouter } from 'next/router'
import {useRouter} from 'next/router' import { styled } from '@mui/material/styles';
import {styled} from '@mui/material/styles';
const TCTreeItem = styled(TreeItem)(({theme}) => ({ const TCTreeItem = styled(TreeItem)(({ theme }) => ({
'& .MuiTreeItem-content': { '& .MuiTreeItem-content': {
'& .MuiTreeItem-label': { '& .MuiTreeItem-label': {
fontSize: '1rem', fontSize: '1rem',
@ -33,9 +32,9 @@ export default function FolderTree(props) {
return ( return (
<TreeView <TreeView
aria-label="rich object" aria-label="rich object"
defaultCollapseIcon={<ExpandMoreIcon/>} defaultCollapseIcon={<ExpandMoreIcon />}
defaultExpanded={expandedNodes} defaultExpanded={expandedNodes}
defaultExpandIcon={<ChevronRightIcon/>} defaultExpandIcon={<ChevronRightIcon />}
onNodeSelect={(event, nodIds) => { onNodeSelect={(event, nodIds) => {
const currentNode = props.flattenNodes.find(aNode => { const currentNode = props.flattenNodes.find(aNode => {
return aNode.id === nodIds return aNode.id === nodIds
@ -47,7 +46,7 @@ export default function FolderTree(props) {
// router.reload() // router.reload()
} }
}} }}
sx={{flexGrow: 1, maxWidth: 400, overflowY: 'auto'}} sx={{ flexGrow: 1, maxWidth: 400, overflowY: 'auto' }}
> >
{renderTree(props.tree)} {renderTree(props.tree)}
</TreeView> </TreeView>