|
@@ -11,7 +11,8 @@ import {
|
|
|
SidebarFooter,
|
|
SidebarFooter,
|
|
|
} from "@/components/ui/sidebar";
|
|
} from "@/components/ui/sidebar";
|
|
|
import { useNavigate } from "react-router-dom";
|
|
import { useNavigate } from "react-router-dom";
|
|
|
-import { LayoutDashboard, Phone, BarChart3, Settings, CreditCard, Layers3, PhoneCall } from "lucide-react";
|
|
|
|
|
|
|
+import { LayoutDashboard, Phone, BarChart3, Settings, CreditCard, Layers3, PhoneCall, LogOut } from "lucide-react";
|
|
|
|
|
+import { useAuth } from "@/components/context/AuthContext";
|
|
|
|
|
|
|
|
const menuItems = [
|
|
const menuItems = [
|
|
|
{
|
|
{
|
|
@@ -62,7 +63,8 @@ const configItems = [
|
|
|
export function AppSidebar() {
|
|
export function AppSidebar() {
|
|
|
const navigate = useNavigate();
|
|
const navigate = useNavigate();
|
|
|
const currentPath = window.location.pathname;
|
|
const currentPath = window.location.pathname;
|
|
|
-
|
|
|
|
|
|
|
+ const { logout } = useAuth();
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<Sidebar className="border-r border-slate-700/50 bg-slate-900 text-white">
|
|
<Sidebar className="border-r border-slate-700/50 bg-slate-900 text-white">
|
|
|
<SidebarHeader className="p-6 bg-slate-900">
|
|
<SidebarHeader className="p-6 bg-slate-900">
|
|
@@ -128,9 +130,18 @@ export function AppSidebar() {
|
|
|
</SidebarContent>
|
|
</SidebarContent>
|
|
|
|
|
|
|
|
<SidebarFooter className="p-6 bg-slate-900">
|
|
<SidebarFooter className="p-6 bg-slate-900">
|
|
|
- <div className="flex items-center gap-3 p-3 bg-slate-800/50 rounded-lg">
|
|
|
|
|
- <Settings className="w-4 h-4 text-slate-400" />
|
|
|
|
|
- <span className="text-sm text-slate-300">Settings</span>
|
|
|
|
|
|
|
+ <div className="flex flex-col gap-2">
|
|
|
|
|
+ <div className="flex items-center gap-3 p-3 bg-slate-800/50 rounded-lg">
|
|
|
|
|
+ <Settings className="w-4 h-4 text-slate-400" />
|
|
|
|
|
+ <span className="text-sm text-slate-300">Settings</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <button
|
|
|
|
|
+ onClick={logout}
|
|
|
|
|
+ className="flex items-center gap-3 p-3 bg-slate-800/50 rounded-lg hover:bg-slate-800 transition-colors cursor-pointer"
|
|
|
|
|
+ >
|
|
|
|
|
+ <LogOut className="w-4 h-4 text-slate-400" />
|
|
|
|
|
+ <span className="text-sm text-slate-300">Logout</span>
|
|
|
|
|
+ </button>
|
|
|
</div>
|
|
</div>
|
|
|
</SidebarFooter>
|
|
</SidebarFooter>
|
|
|
</Sidebar>
|
|
</Sidebar>
|