11'use client' ;
22
3- import { env } from '@/env.mjs' ;
43import { Badge } from '@comp/ui/badge' ;
54import { Button } from '@comp/ui/button' ;
65import { cn } from '@comp/ui/cn' ;
@@ -36,7 +35,7 @@ type MenuItem = {
3635} ;
3736
3837interface ItemProps {
39- organizationId : string ;
38+ organizationId ? : string ;
4039 item : MenuItem ;
4140 isActive : boolean ;
4241 disabled : boolean ;
@@ -49,7 +48,6 @@ export function MainMenu({ organizationId, isCollapsed = false, onItemClick }: P
4948 const pathname = usePathname ( ) ;
5049 const [ activeStyle , setActiveStyle ] = useState ( { top : '0px' , height : '0px' } ) ;
5150 const itemRefs = useRef < ( HTMLDivElement | null ) [ ] > ( [ ] ) ;
52- const isDubEnabled = env . NEXT_PUBLIC_IS_DUB_ENABLED === 'true' ;
5351
5452 const items : MenuItem [ ] = [
5553 {
@@ -242,7 +240,7 @@ const Item = ({
242240} : ItemProps ) => {
243241 const Icon = item . icon ;
244242 const linkDisabled = disabled || item . disabled ;
245- const itemPath = item . path . replace ( ':organizationId' , organizationId ) ;
243+ const itemPath = item . path . replace ( ':organizationId' , organizationId ?? '' ) ;
246244
247245 if ( linkDisabled ) {
248246 return (
@@ -315,7 +313,7 @@ const Item = ({
315313} ;
316314
317315type Props = {
318- organizationId : string ;
316+ organizationId ? : string ;
319317 isCollapsed ?: boolean ;
320318 onItemClick ?: ( ) => void ;
321319} ;
0 commit comments