@@ -24,7 +24,7 @@ const SubHeaderLeftV2 = (props: SubHeaderLeftV2Props) => {
2424 const selectedItemText = useMemo ( ( ) => {
2525 const selectedCount = selectedItemIds === 'all' ? currentCollection . items . length : selectedItemIds . size ;
2626
27- if ( typeof selectedCount !== 'number' || selectedCount === 0 ) {
27+ if ( selectedCount === 0 ) {
2828 return '' ;
2929 }
3030
@@ -33,9 +33,7 @@ const SubHeaderLeftV2 = (props: SubHeaderLeftV2Props) => {
3333 const selectedKey =
3434 selectedItemIds === 'all' ? currentCollection . items [ 0 ] . id : selectedItemIds . values ( ) . next ( ) . value ;
3535 const selectedItem = currentCollection . items . find ( item => item . id === selectedKey ) ;
36- if ( typeof selectedItem ?. name === 'string' ) {
37- return selectedItem . name as string ;
38- }
36+ return selectedItem ?. name ?? '' ;
3937 }
4038 // Case 2: Multiple selected items - show count
4139 if ( selectedCount > 1 ) {
@@ -47,18 +45,18 @@ const SubHeaderLeftV2 = (props: SubHeaderLeftV2Props) => {
4745 // Case 1 and 2: selected item text with X button
4846 if ( selectedItemText ) {
4947 return (
50- < PageHeader . Root className = "be-sub-header-left-v2-selected " variant = "default" >
48+ < PageHeader . Root className = "be-SubHeaderLeftV2--selection " variant = "default" >
5149 < PageHeader . Corner >
5250 < IconButton
53- aria-label = "Clear selection"
51+ aria-label = { formatMessage ( messages . clearSelection ) }
5452 icon = { XMark }
5553 onClick = { onClearSelectedItemIds }
5654 variant = "small-utility"
5755 />
5856 </ PageHeader . Corner >
5957
6058 < PageHeader . StartElements >
61- < Text as = "p " > { selectedItemText } </ Text >
59+ < Text as = "span " > { selectedItemText } </ Text >
6260 </ PageHeader . StartElements >
6361 </ PageHeader . Root >
6462 ) ;
@@ -67,7 +65,7 @@ const SubHeaderLeftV2 = (props: SubHeaderLeftV2Props) => {
6765 // Case 3: No selected items - show title if provided, otherwise show root name
6866 return (
6967 < Text as = "h1" variant = "titleXLarge" >
70- { title || rootName }
68+ { title ?? rootName }
7169 </ Text >
7270 ) ;
7371} ;
0 commit comments