"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; // Stable background styles defined outside component to prevent regeneration const MAIN_BACKGROUND = "radial-gradient(circle at 12% -20%, rgba(99, 102, 241, 0.28), transparent 45%), radial-gradient(circle at 88% 8%, rgba(45, 212, 191, 0.24), transparent 46%), linear-gradient(160deg, rgba(2, 3, 9, 1) 0%, rgba(4, 10, 22, 1) 40%, rgba(2, 6, 18, 1) 100%)"; const OVERLAY_BACKGROUND = "radial-gradient(circle at 18% -12%, rgba(56, 189, 248, 0.18), transparent 42%), radial-gradient(circle at 86% 0%, rgba(168, 85, 247, 0.15), transparent 45%)"; 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}
); }