import type { ReactNode } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { Activity, LayoutDashboard, Settings, Sparkles, Terminal } from 'lucide-react'; import { Sidebar } from './Sidebar'; import { useTheme } from '../../contexts/ThemeContext'; type Page = '总览' | '配置' | '日志'; interface MainLayoutProps { activePage: Page; onNavigate: (page: Page) => void; status: string; onLogout: () => void; children: ReactNode; } const pageMeta: Record = { '总览': { title: '总览', subtitle: '查看当前接入的 QQ 账号及服务运行状态', badge: '控制台视图', icon: LayoutDashboard }, '配置': { title: '节点配置', subtitle: '管理 OneBot 协议端点与通信参数', badge: '协议编排', icon: Settings }, '日志': { title: '日志', subtitle: '查看后端运行日志与实时事件流', badge: 'SSE 实时流', icon: Terminal }, }; export function MainLayout({ activePage, onNavigate, status, onLogout, children }: MainLayoutProps) { const meta = pageMeta[activePage]; const { resolved } = useTheme(); const dark = resolved === 'dark'; const PageIcon = meta.icon; const runtimeLabel = status === '已连接' ? '运行中' : status; return (
{/* Full-screen ambient gradient — matches login page */}
{/* Animated orbs */}
{/* Sidebar */} {/* Main content */}
{/* Top highlight */}
{/* Grid texture overlay */}
{/* Accent glow in corner */}
{/* Page header */}
{/* Icon */}
{/* Title block */}

{meta.title}

{meta.badge}

{meta.subtitle}

运行状态
{runtimeLabel}
{/* Page content */}
{children} © {new Date().getFullYear()} SnowLuma. All rights reserved.
); }