@@ -47,6 +47,7 @@ interface NavItem {
4747 name : string
4848 href : string
4949 icon : React . ReactNode
50+ external ?: boolean
5051}
5152
5253const mainNavItems : NavItem [ ] = [
@@ -55,7 +56,7 @@ const mainNavItems: NavItem[] = [
5556]
5657
5758const bottomNavItems : NavItem [ ] = [
58- { name : 'Documentation' , href : '/docs' , icon : < DocsIcon /> } ,
59+ { name : 'Documentation' , href : '/docs' , icon : < DocsIcon /> , external : true } ,
5960 { name : 'Settings' , href : '/dashboard/settings' , icon : < SettingsIcon /> } ,
6061]
6162
@@ -70,23 +71,49 @@ export function Sidebar({ collapsed, onToggle }: SidebarProps) {
7071 return location . pathname === href
7172 }
7273
73- const NavLink = ( { item } : { item : NavItem } ) => (
74- < Link
75- to = { item . href }
76- className = { `flex items-center gap-3 px-3 py-2.5 rounded-lg transition-all group ${
77- isActive ( item . href )
78- ? 'bg-blue-500/10 text-blue-400'
79- : 'text-gray-400 hover:text-white hover:bg-white/5'
80- } `}
81- >
82- < span className = { `${ isActive ( item . href ) ? 'text-blue-400' : 'text-gray-500 group-hover:text-gray-300' } ` } >
83- { item . icon }
84- </ span >
85- { ! collapsed && (
86- < span className = "text-sm font-medium truncate" > { item . name } </ span >
87- ) }
88- </ Link >
89- )
74+ const NavLink = ( { item } : { item : NavItem } ) => {
75+ // External links open in new tab
76+ if ( item . external ) {
77+ return (
78+ < a
79+ href = { item . href }
80+ target = "_blank"
81+ rel = "noopener noreferrer"
82+ className = "flex items-center gap-3 px-3 py-2.5 rounded-lg transition-all group text-gray-400 hover:text-white hover:bg-white/5"
83+ >
84+ < span className = "text-gray-500 group-hover:text-gray-300" >
85+ { item . icon }
86+ </ span >
87+ { ! collapsed && (
88+ < >
89+ < span className = "text-sm font-medium truncate" > { item . name } </ span >
90+ < svg className = "w-3 h-3 ml-auto opacity-50" fill = "none" stroke = "currentColor" viewBox = "0 0 24 24" >
91+ < path strokeLinecap = "round" strokeLinejoin = "round" strokeWidth = { 2 } d = "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
92+ </ svg >
93+ </ >
94+ ) }
95+ </ a >
96+ )
97+ }
98+
99+ return (
100+ < Link
101+ to = { item . href }
102+ className = { `flex items-center gap-3 px-3 py-2.5 rounded-lg transition-all group ${
103+ isActive ( item . href )
104+ ? 'bg-blue-500/10 text-blue-400'
105+ : 'text-gray-400 hover:text-white hover:bg-white/5'
106+ } `}
107+ >
108+ < span className = { `${ isActive ( item . href ) ? 'text-blue-400' : 'text-gray-500 group-hover:text-gray-300' } ` } >
109+ { item . icon }
110+ </ span >
111+ { ! collapsed && (
112+ < span className = "text-sm font-medium truncate" > { item . name } </ span >
113+ ) }
114+ </ Link >
115+ )
116+ }
90117
91118 return (
92119 < aside
0 commit comments