@@ -20,7 +20,7 @@ export function NavMain({ lable = "Platform", items = [], openSubmenu, setOpenSu
2020} ) {
2121 const page = usePage ( ) ;
2222
23- const id = useRef < string > ( useId ( ) ) ;
23+ const id = useId ( ) ;
2424
2525 const { isMobile, state, openMobile } = useSidebar ( ) ;
2626
@@ -56,7 +56,7 @@ export function NavMain({ lable = "Platform", items = [], openSubmenu, setOpenSu
5656 } , [ openSubmenu ] ) ;
5757
5858 const activeGroup = ( navItem : NavItem ) => {
59- let foundItem = items . find ( ( item ) => {
59+ const foundItem = items . find ( ( item ) => {
6060 if ( navItem . href && page . url . startsWith ( resolveUrl ( navItem . href ) ) ) {
6161 return item ;
6262 }
@@ -77,25 +77,25 @@ export function NavMain({ lable = "Platform", items = [], openSubmenu, setOpenSu
7777 isActive = { activeGroup ( item ) }
7878 className = "cursor-pointer"
7979 tooltip = { { children : item . title } }
80- onClick = { ( ) => handleSubmenuToggle ( index , id . current ) }
80+ onClick = { ( ) => handleSubmenuToggle ( index , id ) }
8181 >
8282 { item . icon && < item . icon /> }
8383 < span > { item . title } </ span >
8484 < ChevronDownIcon
85- className = { `ms-auto h-4 w-4 shrink-0 opacity-50 transition-all duration-300 ${ openSubmenu ?. id === id . current && openSubmenu ?. index === index ? "rotate-180" : "" } ` }
85+ className = { `ms-auto h-4 w-4 shrink-0 opacity-50 transition-all duration-300 ${ openSubmenu ?. id === id && openSubmenu ?. index === index ? "rotate-180" : "" } ` }
8686 />
8787 </ SidebarMenuButton >
8888
8989 { ( state === "expanded" || ( isMobile && openMobile ) ) && (
9090 < div
9191 ref = { ( el ) => {
92- subMenuRefs . current [ `${ id . current } -${ index } ` ] = el ;
92+ subMenuRefs . current [ `${ id } -${ index } ` ] = el ;
9393 } }
9494 className = "overflow-hidden transition-all duration-300"
9595 style = { {
9696 height :
97- openSubmenu ?. id === id . current && openSubmenu ?. index === index
98- ? `${ subMenuHeight [ `${ id . current } -${ index } ` ] } px`
97+ openSubmenu ?. id === id && openSubmenu ?. index === index
98+ ? `${ subMenuHeight [ `${ id } -${ index } ` ] } px`
9999 : "0px" ,
100100 } }
101101 >
0 commit comments