"use client"; import { ReactNode } from "react"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { Avatar, Box, Button, Divider, List, ListItemButton, ListItemText, Stack, Typography } from "@mui/material"; type User = { id: string; name?: string | null; email?: string | null; }; const NAV_ITEMS = [ { href: "/", label: "Overview" }, { href: "/proxy-hosts", label: "Proxy Hosts" }, { href: "/redirects", label: "Redirects" }, { href: "/dead-hosts", label: "Dead Hosts" }, { href: "/access-lists", label: "Access Lists" }, { href: "/certificates", label: "Certificates" }, { href: "/settings", label: "Settings" }, { href: "/audit-log", label: "Audit Log" } ] as const; export default function DashboardLayoutClient({ user, children }: { user: User; children: ReactNode }) { const pathname = usePathname(); return ( Caddy Proxy Manager {NAV_ITEMS.map((item) => { const selected = pathname === item.href; return ( ); })} {(user.name ?? user.email ?? "A").slice(0, 2).toUpperCase()} {user.name ?? user.email ?? "Admin"} Administrator
{children}
); }