import type { ReactNode } from 'react'; import { Link } from 'react-router'; import { User, LogOut, Terminal, TerminalSquare, FileText, FolderOpen, Server, Package, Bot, Sparkles, ClipboardList, ScrollText, Workflow, } from 'lucide-react'; import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; import type { UserWithToken } from 'hooks/useAuth'; import { useAuth } from 'hooks/useAuth'; import { PixelGrid } from '../LandingPage/components/PixelGrid'; import { useIsProduction } from 'hooks/useIsProduction'; import { useServerSettings } from '@/state/useServerSettings'; import { PasskeyGate } from './PasskeyGate'; import { Dock, type DockItem } from './Dock'; type DashboardLayoutProps = { children?: ReactNode; mobileFull?: boolean; }; export function DashboardLayout({ children, mobileFull }: DashboardLayoutProps) { const { user } = useAuth(); const isProduction = useIsProduction(); const { plugins } = useServerSettings(); const passkeyCount = (user as UserWithToken & { passkeyCount?: number })?.passkeyCount ?? 0; const dockItems: DockItem[] = [ { label: 'Chat', to: '/chat', icon: Terminal, color: '#60a5fa' }, ...(plugins?.FileBrowser !== false ? [{ label: 'Files', to: '/files', icon: FolderOpen, color: '#fbbf24' } as DockItem] : []), ...(plugins?.Terminal !== false ? [{ label: 'Terminal', to: '/terminal', icon: TerminalSquare, color: '#34d399' } as DockItem] : []), { label: 'Plans', to: '/plans', icon: FileText, color: '#f472b6' }, { label: 'Skills', to: '/skills', icon: Sparkles, color: '#c084fc' }, { label: 'Tasks', to: '/tasks', icon: ClipboardList, color: '#fb923c' }, { label: 'Processes', to: '/processes', icon: Workflow, color: '#2dd4bf' }, { label: 'Logs', to: '/task-logs', icon: ScrollText, color: '#94a3b8' }, ]; return (
{/* Background layer */}
{/* Content layer - above pixel grid */}
Officer Profile AI Settings Server Settings Resources Sign Out
{isProduction && passkeyCount === 0 ? : children}
); }