import { LayoutDashboard, Settings, SlidersHorizontal, Terminal } from 'lucide-react'; import { motion } from 'motion/react'; import { Link, useRouterState } from '@tanstack/react-router'; import { ScrollArea } from '@/components/ui/scroll-area'; import { Separator } from '@/components/ui/separator'; import { cn } from '@/lib/utils'; import { APP_NAME, APP_VERSION } from '@/types'; import type { AppPath } from '@/router'; export interface NavItem { to: AppPath; label: string; icon: typeof LayoutDashboard; description: string; } export const NAV_ITEMS: NavItem[] = [ { to: '/', label: '总览', icon: LayoutDashboard, description: '主机与服务状态' }, { to: '/config', label: '节点配置', icon: Settings, description: 'OneBot 协议端点' }, { to: '/logs', label: '日志', icon: Terminal, description: '实时事件流' }, { to: '/settings', label: '系统设置', icon: SlidersHorizontal, description: '主题与账号' }, ]; interface SidebarProps { collapsed?: boolean; onItemClick?: () => void; } export function Sidebar({ collapsed = false, onItemClick }: SidebarProps) { const pathname = useRouterState({ select: (s) => s.location.pathname }); return (
{/* Brand */}
SnowLuma
{!collapsed && (
{APP_NAME} v{APP_VERSION}
OneBot v11 控制台
)}
{/* Nav */}
{collapsed ? '©' : `© ${new Date().getFullYear()} SnowLuma`}
); }