@@ -2,38 +2,37 @@ import { Link } from "@inertiajs/react"
22import { Button } from "@/components/ui/button"
33import Heading from "@/components/heading" ;
44import { cn } from "@/lib/utils"
5+ import { type NavItemType } from '@/types/navigation'
56
67import { Separator } from "@/components/ui/separator"
78
89interface LayoutProps {
910 children : React . ReactNode
1011}
1112
12- interface NavItem {
13- title : string
14- href : string
15- }
16-
17- const sidebarNavItems : NavItem [ ] = [
13+ const sidebarNavItems : NavItemType [ ] = [
1814 {
1915 title : "Profile" ,
20- href : "/settings/profile" ,
16+ url : "/settings/profile" ,
17+ icon : null
2118 } ,
2219 {
2320 title : "Password" ,
24- href : "/settings/password" ,
21+ url : "/settings/password" ,
22+ icon : null
2523 } ,
2624 {
2725 title : "Appearance" ,
28- href : "/settings/appearance"
26+ url : "/settings/appearance" ,
27+ icon : null
2928 }
3029]
3130
3231export default function SettingsLayout ( {
3332 children
3433} : LayoutProps ) {
3534 const currentPath = window . location . pathname
36- const currentItem = sidebarNavItems . find ( item => currentPath === item . href )
35+ const currentItem = sidebarNavItems . find ( item => currentPath === item . url )
3736
3837 return (
3938 < div className = "p-5 sm:p-8 md:p-10" >
@@ -48,16 +47,16 @@ export default function SettingsLayout({
4847 < nav className = "flex-col space-x-0 space-y-1 flex" >
4948 { sidebarNavItems . map ( ( item ) => (
5049 < Button
51- key = { item . href }
50+ key = { item . url }
5251 size = "sm"
5352 variant = "ghost"
5453 asChild
5554 className = { cn (
5655 "w-full justify-center justify-start" ,
57- currentPath === item . href ? "bg-muted" : "hover:underline"
56+ currentPath === item . url ? "bg-muted" : "hover:underline"
5857 ) }
5958 >
60- < Link href = { item . href } prefetch >
59+ < Link href = { item . url } prefetch >
6160 { item . title }
6261 </ Link >
6362 </ Button >
0 commit comments