"use client"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { LayoutDashboard, Users, Building2, Activity, ToggleLeft, ScrollText, LogOut, Shield, Mail, Send, Zap, FileText, Database, CreditCard, Landmark, SlidersHorizontal, LayoutTemplate, } from "lucide-react"; import { cn } from "@/lib/utils"; import { adminAuth } from "@/lib/admin-auth"; const adminNavItems = [ { name: "Overview", href: "/admin", icon: LayoutDashboard, exact: true }, { name: "Users", href: "/admin/users", icon: Users }, { name: "Workspaces", href: "/admin/workspaces", icon: Building2 }, { name: "Agencies", href: "/admin/agencies", icon: Landmark }, { name: "Plans", href: "/admin/plans", icon: CreditCard }, { name: "Modules", href: "/admin/modules", icon: ToggleLeft }, { name: "System Settings",href: "/admin/system-settings",icon: SlidersHorizontal }, { name: "Email Logs", href: "/admin/email-logs", icon: Mail }, { name: "Dispatch", href: "/admin/dispatch", icon: Send }, { name: "Automations", href: "/admin/automations", icon: Zap }, { name: "Templates", href: "/admin/templates", icon: LayoutTemplate }, { name: "Prompt Configs",href: "/admin/prompt-configs",icon: FileText }, { name: "Zoho Health", href: "/admin/zoho-health", icon: Database }, { name: "Monitoring", href: "/admin/monitoring", icon: Activity }, { name: "Audit Log", href: "/admin/audit-log", icon: ScrollText }, { name: "Runtime Events",href: "/admin/runtime-events",icon: Activity }, ]; interface AdminSidebarProps { adminUser?: { email: string; full_name: string; is_superuser: boolean } | null; } export function AdminSidebar({ adminUser }: AdminSidebarProps) { const pathname = usePathname(); const displayName = adminUser?.full_name || "Admin"; const displayEmail = adminUser?.email || ""; const initials = displayName .split(" ") .map((n) => n[0]) .join("") .toUpperCase() .slice(0, 2) || "SA"; return (
{displayName}
{displayEmail}