@@ -14,7 +14,12 @@ import {
1414import { type Actions , ROW_HEIGHT } from './constants' ;
1515import { ExpandButton } from './tree-item' ;
1616import { type NavigationItemActions } from './item-actions' ;
17- import type { SidebarTreeItem } from './tree-data' ;
17+ import type {
18+ ConnectedConnectionTreeItem ,
19+ NotConnectedConnectionTreeItem ,
20+ SidebarActionableItem ,
21+ SidebarTreeItem ,
22+ } from './tree-data' ;
1823
1924type NavigationBaseItemProps = {
2025 item : SidebarTreeItem ;
@@ -117,11 +122,11 @@ const ClusterStateBadge: React.FunctionComponent<{
117122} ;
118123
119124const ClusterStateBadgeWithTooltip : React . FunctionComponent < {
120- item : SidebarTreeItem ;
125+ item : ConnectedConnectionTreeItem | NotConnectedConnectionTreeItem ;
121126} > = ( { item } ) => {
122127 const isDarkMode = useDarkMode ( ) ;
123128
124- const atlasClusterState = item . connectionInfo ? .atlasMetadata ?. clusterState ;
129+ const atlasClusterState = item . connectionInfo . atlasMetadata ?. clusterState ;
125130 if ( atlasClusterState === 'PAUSED' ) {
126131 return (
127132 < Tooltip
@@ -168,6 +173,7 @@ export const NavigationBaseItem: React.FC<NavigationBaseItemProps> = ({
168173 children,
169174} ) => {
170175 const [ hoverProps , isHovered ] = useHoverState ( ) ;
176+
171177 return (
172178 < div
173179 data-testid = "base-navigation-item"
@@ -193,7 +199,9 @@ export const NavigationBaseItem: React.FC<NavigationBaseItemProps> = ({
193199 { icon }
194200 < span title = { name } > { name } </ span >
195201 </ div >
196- < ClusterStateBadgeWithTooltip item = { item } />
202+ { item . type === 'connection' && (
203+ < ClusterStateBadgeWithTooltip item = { item } />
204+ ) }
197205 < div className = { actionControlsWrapperStyles } >
198206 < ItemActionControls
199207 menuClassName = { menuStyles }
0 commit comments