@@ -6,18 +6,13 @@ import { SxProps } from '@mui/system';
6
6
import { remove } from 'lodash' ;
7
7
import { useCallback , useEffect , useState } from 'react' ;
8
8
9
- import { ROOT_PATH } from '../../../shared-constants' ;
10
9
import { OpossumColors } from '../../../shared-styles' ;
11
10
import { navigateToSelectedPathOrOpenUnsavedPopup } from '../../../state/actions/popup-actions/popup-actions' ;
12
11
import { getInitialExpandedIds } from '../../../state/helpers/resources-helpers' ;
13
12
import { useAppDispatch , useAppSelector } from '../../../state/hooks' ;
14
- import {
15
- getAttributionBreakpoints ,
16
- getFilesWithChildren ,
17
- getSelectedResourceId ,
18
- } from '../../../state/selectors/resource-selectors' ;
13
+ import { getSelectedResourceId } from '../../../state/selectors/resource-selectors' ;
19
14
import { VirtualizedTree } from '../../VirtualizedTree/VirtualizedTree' ;
20
- import { GeneralTreeItemLabel } from './GeneralTreeItemLabel/GeneralTreeItemLabel ' ;
15
+ import { LinkedResourcesTreeNode } from './LinkedResourcesTreeNode/LinkedResourcesTreeNode ' ;
21
16
22
17
interface Props {
23
18
disableHighlightSelected ?: boolean ;
@@ -33,8 +28,6 @@ export function LinkedResourcesTree({
33
28
sx,
34
29
} : Props ) {
35
30
const dispatch = useAppDispatch ( ) ;
36
- const filesWithChildren = useAppSelector ( getFilesWithChildren ) ;
37
- const attributionBreakpoints = useAppSelector ( getAttributionBreakpoints ) ;
38
31
const selectedResourceId = useAppSelector ( getSelectedResourceId ) ;
39
32
40
33
const [ expandedIds , setExpandedIds ] = useState < Array < string > > ( [ ] ) ;
@@ -80,14 +73,7 @@ export function LinkedResourcesTree({
80
73
resourceIds = { resourceIds }
81
74
selectedNodeId = { disableHighlightSelected ? '' : selectedResourceId }
82
75
readOnly = { readOnly }
83
- getTreeNodeLabel = { ( { node, nodeId, nodeName } ) => (
84
- < GeneralTreeItemLabel
85
- labelText = { nodeName || ROOT_PATH }
86
- canHaveChildren = { node !== 1 }
87
- isAttributionBreakpoint = { attributionBreakpoints . has ( nodeId ) }
88
- showFolderIcon = { node !== 1 && ! filesWithChildren . has ( nodeId ) }
89
- />
90
- ) }
76
+ TreeNodeLabel = { LinkedResourcesTreeNode }
91
77
testId = { 'linked-resources-tree' }
92
78
/>
93
79
) ;
0 commit comments