diff --git a/services/web-ui/public/shell.jsx b/services/web-ui/public/shell.jsx new file mode 100644 index 0000000..58345d6 --- /dev/null +++ b/services/web-ui/public/shell.jsx @@ -0,0 +1,167 @@ +// shell.jsx - app shell: sidebar nav, topbar, route container + +const NAV_TREE = [ + { id: "home", label: "Home", icon: "home" }, + { id: "library", label: "Library", icon: "library" }, + { id: "projects", label: "Projects", icon: "folder" }, + { + id: "ingest", label: "Ingest", icon: "upload", group: true, + children: [ + { id: "upload", label: "Upload", icon: "upload" }, + { id: "recorders", label: "Recorders", icon: "record", badge: { kind: "live", text: "4" } }, + { id: "capture", label: "Capture", icon: "capture" }, + { id: "monitors", label: "Monitors", icon: "monitor" }, + ], + }, + { id: "jobs", label: "Jobs", icon: "jobs", badge: { kind: "neutral", text: "3" } }, + { id: "editor", label: "Editor", icon: "editor", badge: { kind: "dev", text: "DEV" } }, +]; + +const ADMIN_TREE = [ + { id: "users", label: "Users", icon: "users" }, + { id: "tokens", label: "Tokens", icon: "token" }, + { id: "containers", label: "Containers", icon: "container" }, + { id: "cluster", label: "Cluster", icon: "cluster" }, + { id: "settings", label: "Settings", icon: "settings" }, +]; + +function NavItem({ item, active, onSelect, depth = 0, openGroups, toggleGroup }) { + const isGroup = item.group && item.children; + const isOpen = isGroup && openGroups.has(item.id); + const isActive = active === item.id || (isGroup && item.children.some(c => c.id === active)); + + return ( + <> +