@@ -9,6 +9,7 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/comp
99import { UserMenuContent } from '@/components/user-menu-content' ;
1010import { useInitials } from '@/hooks/use-initials' ;
1111import { cn } from '@/lib/utils' ;
12+ import { dashboard } from '@/routes' ;
1213import { type BreadcrumbItem , type NavItem , type SharedData } from '@/types' ;
1314import { Link , usePage } from '@inertiajs/react' ;
1415import { BookOpen , Folder , LayoutGrid , Menu , Search } from 'lucide-react' ;
@@ -18,7 +19,7 @@ import AppLogoIcon from './app-logo-icon';
1819const mainNavItems : NavItem [ ] = [
1920 {
2021 title : 'Dashboard' ,
21- href : '/ dashboard' ,
22+ href : dashboard ( ) ,
2223 icon : LayoutGrid ,
2324 } ,
2425] ;
@@ -78,7 +79,7 @@ export function AppHeader({ breadcrumbs = [] }: AppHeaderProps) {
7879 { rightNavItems . map ( ( item ) => (
7980 < a
8081 key = { item . title }
81- href = { item . href }
82+ href = { typeof item . href === 'string' ? item . href : item . href . url }
8283 target = "_blank"
8384 rel = "noopener noreferrer"
8485 className = "flex items-center space-x-2 font-medium"
@@ -94,7 +95,7 @@ export function AppHeader({ breadcrumbs = [] }: AppHeaderProps) {
9495 </ Sheet >
9596 </ div >
9697
97- < Link href = "/ dashboard" prefetch className = "flex items-center space-x-2" >
98+ < Link href = { dashboard ( ) } prefetch className = "flex items-center space-x-2" >
9899 < AppLogo />
99100 </ Link >
100101
@@ -108,7 +109,7 @@ export function AppHeader({ breadcrumbs = [] }: AppHeaderProps) {
108109 href = { item . href }
109110 className = { cn (
110111 navigationMenuTriggerStyle ( ) ,
111- page . url === item . href && activeItemStyles ,
112+ page . url === ( typeof item . href === 'string' ? item . href : item . href . url ) && activeItemStyles ,
112113 'h-9 cursor-pointer px-3' ,
113114 ) }
114115 >
@@ -135,7 +136,7 @@ export function AppHeader({ breadcrumbs = [] }: AppHeaderProps) {
135136 < Tooltip >
136137 < TooltipTrigger >
137138 < a
138- href = { item . href }
139+ href = { typeof item . href === 'string' ? item . href : item . href . url }
139140 target = "_blank"
140141 rel = "noopener noreferrer"
141142 className = "group ml-1 inline-flex h-9 w-9 items-center justify-center rounded-md bg-transparent p-0 text-sm font-medium text-accent-foreground ring-offset-background transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50"
0 commit comments