import { Link, useRouterState } from "@tanstack/react-router"; import { LayoutDashboard, FolderOpen, Share2, Settings, Shield, Files, Users, HardDrive, ScrollText, Gauge, Box, } from "lucide-react"; import { Sidebar, SidebarContent, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarProvider, SidebarTrigger, SidebarHeader, } from "@/components/ui/sidebar"; import { MockupNav } from "./MockupNav"; const userItems = [ { to: "/app/dashboard", label: "Dashboard", icon: LayoutDashboard }, { to: "/app/files", label: "My files", icon: FolderOpen }, { to: "/app/shared", label: "Shared links", icon: Share2 }, { to: "/app/settings", label: "Settings", icon: Settings }, ]; const adminItems = [ { to: "/admin/overview", label: "Overview", icon: Gauge }, { to: "/admin/files", label: "Files", icon: Files }, { to: "/admin/users", label: "Users", icon: Users }, { to: "/admin/storage", label: "Storage", icon: HardDrive }, { to: "/admin/logs", label: "Logs", icon: ScrollText }, { to: "/admin/settings", label: "Settings", icon: Settings }, ]; export function AppShell({ variant, title, children, }: { variant: "user" | "admin"; title: string; children: React.ReactNode; }) { const pathname = useRouterState({ select: (s) => s.location.pathname }); const items = variant === "admin" ? adminItems : userItems; return (
warpbox.dev {variant === "admin" ? "Admin" : "Workspace"} {items.map((it) => ( {it.label} ))} {variant === "user" && ( Other Admin )}

{title}

A
{children}
); }