Gate setup and admin navigation
This commit is contained in:
@@ -1,15 +1,23 @@
|
||||
import Link from "next/link";
|
||||
import { Gauge, MonitorPlay, Shield, UserRoundPlus, UsersRound } from "lucide-react";
|
||||
import { Gauge, MonitorPlay, Shield, UsersRound } from "lucide-react";
|
||||
|
||||
const nav = [
|
||||
{ href: "/dashboard", label: "Dashboard", icon: Gauge },
|
||||
{ href: "/rooms/@admin", label: "Rooms", icon: MonitorPlay },
|
||||
{ href: "/friends", label: "Friends", icon: UsersRound },
|
||||
{ href: "/admin", label: "Admin", icon: Shield },
|
||||
{ href: "/setup", label: "Setup", icon: UserRoundPlus }
|
||||
{ href: "/friends", label: "Friends", icon: UsersRound }
|
||||
];
|
||||
|
||||
export function AppShell({ children, active = "Dashboard" }: { children: React.ReactNode; active?: string }) {
|
||||
export function AppShell({
|
||||
children,
|
||||
active = "Dashboard",
|
||||
isAdmin = false
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
active?: string;
|
||||
isAdmin?: boolean;
|
||||
}) {
|
||||
const visibleNav = isAdmin ? [...nav, { href: "/admin", label: "Admin", icon: Shield }] : nav;
|
||||
|
||||
return (
|
||||
<div className="app-shell">
|
||||
<aside className="sidebar">
|
||||
@@ -18,7 +26,7 @@ export function AppShell({ children, active = "Dashboard" }: { children: React.R
|
||||
<span>WatchLink</span>
|
||||
</Link>
|
||||
<nav className="nav-list" aria-label="Primary">
|
||||
{nav.map((item) => {
|
||||
{visibleNav.map((item) => {
|
||||
const Icon = item.icon;
|
||||
return (
|
||||
<Link key={item.href} href={item.href} className={`nav-item ${active === item.label ? "active" : ""}`}>
|
||||
|
||||
Reference in New Issue
Block a user