"use client" import { Home, Users, Settings, LogOut, Shield } from "lucide-react" import Link from "next/link" import { usePathname } from "next/navigation" import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarHeader, } from "@/components/ui/sidebar" import { useAppDispatch, useAppSelector } from "@/lib/hooks" import { logout } from "@/lib/features/auth/authSlice" // Menu items. const items = [ { title: "Genel Bakış", url: "/admin", icon: Home, }, { title: "Kullanıcılar", url: "/admin/users", icon: Users, }, { title: "Ayarlar", url: "/admin/settings", icon: Settings, }, { title: "CORS Ayarları", url: "/admin/cors", icon: Shield, }, ] export function AppSidebar() { const pathname = usePathname() const dispatch = useAppDispatch() const user = useAppSelector((state) => state.auth.user) const isAdmin = user?.roles?.some((r: any) => r.name === "admin") return ( NextGoBlog {isAdmin && ( Admin Panel {items.map((item) => ( {item.title} ))} )} Hesabım Profilim dispatch(logout())}> Çıkış Yap ) }