diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx index 0e8addf..abc791b 100644 --- a/src/components/layout/Sidebar.tsx +++ b/src/components/layout/Sidebar.tsx @@ -1,7 +1,8 @@ -import { BookOpen, Home, Library, Settings } from "lucide-react"; +import { BookOpen, Home, Library, Settings, LogOut } from "lucide-react"; import Link from "next/link"; -import { usePathname } from "next/navigation"; +import { usePathname, useRouter } from "next/navigation"; import { cn } from "@/lib/utils"; +import { authService } from "@/lib/services/auth.service"; interface SidebarProps { isOpen: boolean; @@ -9,6 +10,12 @@ interface SidebarProps { export function Sidebar({ isOpen }: SidebarProps) { const pathname = usePathname(); + const router = useRouter(); + + const handleLogout = () => { + authService.logout(); + router.push("/login"); + }; const navigation = [ { @@ -26,11 +33,11 @@ export function Sidebar({ isOpen }: SidebarProps) { return ( ); }