import { FolderGit2, GitBranch, LayoutDashboard, LogOut, Puzzle, Server, Settings, Users } from "lucide-react"; import { NavLink, Outlet, useNavigate } from "react-router-dom"; import { clearAuthToken, signOut, useSession } from "../lib/auth-client"; import { Header } from "./Header"; export function CmsLayout() { const { data: session } = useSession(); const isAdmin = (session?.user as any)?.role === "admin"; const navItems = [ { to: "/projects", label: "Projects", icon: FolderGit2 }, { to: "/agents", label: "Agents", icon: Users }, { to: "/skills", label: "Skills", icon: Puzzle }, { to: "/machines", label: "Machines", icon: Server }, { to: "/repositories", label: "Repositories", icon: GitBranch }, { to: "/settings", label: "Settings", icon: Settings }, ]; if (isAdmin) { navItems.push({ to: "/admin", label: "Admin Panel", icon: LayoutDashboard }); } const navigate = useNavigate(); async function handleSignOut() { await signOut(); clearAuthToken(); navigate("/auth"); } return (