"use client"; import { signOut } from "next-auth/react"; import Link from "next/link"; import type { Route } from "next"; import { usePathname } from "next/navigation"; import { clsx } from "clsx"; import { Suspense, useState } from "react"; import { PreferencesModal } from "./PreferencesModal.js"; import { ThemeProvider } from "./ThemeProvider.js"; import { NotificationBell } from "../notifications/NotificationBell.js"; import { NavProgressBar } from "~/components/ui/NavProgressBar.js"; const allNavItems = [ { href: "/dashboard", label: "Dashboard", icon: "📊", roles: ["ADMIN", "MANAGER", "CONTROLLER", "USER", "VIEWER"] }, { href: "/resources", label: "Resources", icon: "👥", roles: ["ADMIN", "MANAGER", "CONTROLLER"] }, { href: "/projects", label: "Projects", icon: "📋", roles: ["ADMIN", "MANAGER", "CONTROLLER", "VIEWER"] }, { href: "/estimates", label: "Estimates", icon: "🧮", roles: ["ADMIN", "MANAGER", "CONTROLLER", "USER", "VIEWER"] }, { href: "/allocations", label: "Allocations", icon: "📅", roles: ["ADMIN", "MANAGER", "CONTROLLER"] }, { href: "/timeline", label: "Timeline", icon: "🗓️", roles: ["ADMIN", "MANAGER", "CONTROLLER", "USER", "VIEWER"] }, { href: "/staffing", label: "Staffing", icon: "🎯", roles: ["ADMIN", "MANAGER"] }, { href: "/vacations", label: "Vacations", icon: "🏖️", roles: ["ADMIN", "MANAGER"] }, { href: "/vacations/my", label: "My Vacations", icon: "🌴", roles: ["ADMIN", "MANAGER", "CONTROLLER", "USER", "VIEWER"] }, { href: "/roles", label: "Roles", icon: "🏷️", roles: ["ADMIN", "MANAGER", "CONTROLLER"] }, { href: "/analytics/skills", label: "Skills Analytics", icon: "📈", roles: ["ADMIN", "MANAGER", "CONTROLLER", "VIEWER"] }, { href: "/reports/chargeability", label: "Chargeability", icon: "📊", roles: ["ADMIN", "MANAGER", "CONTROLLER"] }, ]; const adminNavItems = [ { href: "/admin/blueprints", label: "Blueprints", icon: "🏗️" }, { href: "/admin/countries", label: "Countries", icon: "🌍" }, { href: "/admin/org-units", label: "Org Units", icon: "🏢" }, { href: "/admin/utilization-categories", label: "Util. Categories", icon: "📊" }, { href: "/admin/clients", label: "Clients", icon: "🏦" }, { href: "/admin/rate-cards", label: "Rate Cards", icon: "💲" }, { href: "/admin/effort-rules", label: "Effort Rules", icon: "📐" }, { href: "/admin/experience-multipliers", label: "Exp. Multipliers", icon: "📈" }, { href: "/admin/management-levels", label: "Mgmt Levels", icon: "📶" }, { href: "/admin/users", label: "Users", icon: "👤" }, { href: "/admin/settings", label: "Settings", icon: "⚙️" }, { href: "/admin/skill-import", label: "Skill Import", icon: "📥" }, ]; const managerNavItems = [ { href: "/admin/vacations", label: "Vacation Mgmt", icon: "🏖️" }, ]; function Sidebar({ userRole }: { userRole: string }) { const pathname = usePathname(); const [prefsOpen, setPrefsOpen] = useState(false); const visibleNavItems = allNavItems.filter((item) => item.roles.includes(userRole)); const showAdmin = userRole === "ADMIN"; const showManagerSection = userRole === "ADMIN" || userRole === "MANAGER"; return ( <> {prefsOpen && setPrefsOpen(false)} />} ); } export function AppShell({ children, userRole = "USER" }: { children: React.ReactNode; userRole?: string }) { return (
{children}
); }