@@ -27,33 +27,37 @@ import { getCurrentUser, signOut } from "@/lib/auth"
2727import { useEffect , useState } from "react"
2828import type { User } from "@/lib/auth"
2929import { NotificationsPanel } from "./notifications-panel"
30+ import { useLanguage } from "@/lib/i18n"
3031
31- const navItems = [
32- { href : "/dashboard" , label : "Dashboard" , icon : LayoutDashboard } ,
33- { href : "/dashboard/projects" , label : "Projects" , icon : FolderKanban } ,
34- { href : "/dashboard/collaborators" , label : "Collaborators" , icon : Users } ,
35- { href : "/dashboard/chat" , label : "Chat" , icon : MessageCircle } ,
36- { href : "/dashboard/whiteboard" , label : "Whiteboard" , icon : Palette } ,
37- { href : "/dashboard/todo" , label : "To Do" , icon : CheckSquare } ,
38- { href : "/dashboard/meeting" , label : "Meeting" , icon : Calendar } ,
39- { href : "/dashboard/planning" , label : "Planning" , icon : ClipboardList } ,
40- { href : "/dashboard/diagrams" , label : "Flow & Diagrams" , icon : Workflow } ,
41- { href : "/dashboard/files" , label : "Files" , icon : FileText } ,
42- { href : "/dashboard/wiki" , label : "Knowledge Base" , icon : BookOpen } ,
43- { href : "/dashboard/community" , label : "Community" , icon : MessageSquare } ,
44- { href : "/dashboard/entertainment" , label : "Entertainment" , icon : Gamepad2 } ,
45- { href : "/dashboard/ai-tools" , label : "AI Tools" , icon : Sparkles } ,
46- { href : "/dashboard/support" , label : "Live Support" , icon : Headphones } ,
47- { href : "/dashboard/settings" , label : "Settings" , icon : Settings } ,
48- ]
32+ // navItems will be created inside the component so labels come from translations
4933
5034export function DashboardSidebar ( ) {
35+ const { t } = useLanguage ( )
5136 const pathname = usePathname ( )
5237 const router = useRouter ( )
5338 const [ user , setUser ] = useState < User | null > ( null )
5439 const [ isLoaded , setIsLoaded ] = useState ( false )
5540 const [ isMobileMenuOpen , setIsMobileMenuOpen ] = useState ( false )
5641
42+ const navItems = [
43+ { href : "/dashboard" , label : t . nav . dashboard || "Dashboard" , icon : LayoutDashboard } ,
44+ { href : "/dashboard/projects" , label : t . nav . projects || "Projects" , icon : FolderKanban } ,
45+ { href : "/dashboard/collaborators" , label : t . projects ?. collaborators || "Collaborators" , icon : Users } ,
46+ { href : "/dashboard/chat" , label : t . chat ?. title || "Chat" , icon : MessageCircle } ,
47+ { href : "/dashboard/whiteboard" , label : t . whiteboard ?. title || "Whiteboard" , icon : Palette } ,
48+ { href : "/dashboard/todo" , label : t . todo ?. title || "To Do" , icon : CheckSquare } ,
49+ { href : "/dashboard/meeting" , label : t . meeting ?. title || "Meeting" , icon : Calendar } ,
50+ { href : "/dashboard/planning" , label : t . planning ?. title || "Planning" , icon : ClipboardList } ,
51+ { href : "/dashboard/diagrams" , label : t . diagrams ?. title || "Flow & Diagrams" , icon : Workflow } ,
52+ { href : "/dashboard/files" , label : t . files ?. title || "Files" , icon : FileText } ,
53+ { href : "/dashboard/wiki" , label : t . wiki ?. title || "Knowledge Base" , icon : BookOpen } ,
54+ { href : "/dashboard/community" , label : t . community ?. title || "Community" , icon : MessageSquare } ,
55+ { href : "/dashboard/entertainment" , label : t . landing ?. community ?. title || "Entertainment" , icon : Gamepad2 } ,
56+ { href : "/dashboard/ai-tools" , label : t . nav . aiTools || "AI Tools" , icon : Sparkles } ,
57+ { href : "/dashboard/support" , label : "Live Support" , icon : Headphones } ,
58+ { href : "/dashboard/settings" , label : t . nav . settings || "Settings" , icon : Settings } ,
59+ ]
60+
5761 useEffect ( ( ) => {
5862 const currentUser = getCurrentUser ( )
5963 if ( ! currentUser ) {
@@ -197,7 +201,7 @@ export function DashboardSidebar() {
197201 < div className = "p-1.5 border border-border group-hover:border-red-500 transition-colors" >
198202 < LogOut className = "h-4 w-4 group-hover:text-red-500 transition-colors" />
199203 </ div >
200- < span > Log Out</ span >
204+ < span > { t . nav . signOut || " Log Out" } </ span >
201205 </ div >
202206 </ button >
203207 </ div >
0 commit comments