@@ -9,6 +9,7 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/comp
9
9
import { UserMenuContent } from '@/components/user-menu-content' ;
10
10
import { useInitials } from '@/hooks/use-initials' ;
11
11
import { cn } from '@/lib/utils' ;
12
+ import { dashboard } from '@/routes' ;
12
13
import { type BreadcrumbItem , type NavItem , type SharedData } from '@/types' ;
13
14
import { Link , usePage } from '@inertiajs/react' ;
14
15
import { BookOpen , Folder , LayoutGrid , Menu , Search } from 'lucide-react' ;
@@ -18,7 +19,7 @@ import AppLogoIcon from './app-logo-icon';
18
19
const mainNavItems : NavItem [ ] = [
19
20
{
20
21
title : 'Dashboard' ,
21
- href : '/ dashboard' ,
22
+ href : dashboard ( ) ,
22
23
icon : LayoutGrid ,
23
24
} ,
24
25
] ;
@@ -78,7 +79,7 @@ export function AppHeader({ breadcrumbs = [] }: AppHeaderProps) {
78
79
{ rightNavItems . map ( ( item ) => (
79
80
< a
80
81
key = { item . title }
81
- href = { item . href }
82
+ href = { typeof item . href === 'string' ? item . href : item . href . url }
82
83
target = "_blank"
83
84
rel = "noopener noreferrer"
84
85
className = "flex items-center space-x-2 font-medium"
@@ -94,7 +95,7 @@ export function AppHeader({ breadcrumbs = [] }: AppHeaderProps) {
94
95
</ Sheet >
95
96
</ div >
96
97
97
- < Link href = "/ dashboard" prefetch className = "flex items-center space-x-2" >
98
+ < Link href = { dashboard ( ) } prefetch className = "flex items-center space-x-2" >
98
99
< AppLogo />
99
100
</ Link >
100
101
@@ -108,7 +109,7 @@ export function AppHeader({ breadcrumbs = [] }: AppHeaderProps) {
108
109
href = { item . href }
109
110
className = { cn (
110
111
navigationMenuTriggerStyle ( ) ,
111
- page . url === item . href && activeItemStyles ,
112
+ page . url === ( typeof item . href === 'string' ? item . href : item . href . url ) && activeItemStyles ,
112
113
'h-9 cursor-pointer px-3' ,
113
114
) }
114
115
>
@@ -135,7 +136,7 @@ export function AppHeader({ breadcrumbs = [] }: AppHeaderProps) {
135
136
< Tooltip >
136
137
< TooltipTrigger >
137
138
< a
138
- href = { item . href }
139
+ href = { typeof item . href === 'string' ? item . href : item . href . url }
139
140
target = "_blank"
140
141
rel = "noopener noreferrer"
141
142
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