import { BarChart3, BellRing, BookOpenText, Download, ExternalLink, Folders, History, Image as ImageIcon, LayoutDashboard, Link2, LogOut, MessageSquareText, Orbit, ScrollText, Settings, Sparkles, Tags, } from 'lucide-react' import type { ReactNode } from 'react' import { NavLink } from 'react-router-dom' import { Badge } from '@/components/ui/badge' import { Button } from '@/components/ui/button' import { Separator } from '@/components/ui/separator' import { buildFrontendUrl } from '@/lib/frontend-url' import { cn } from '@/lib/utils' const primaryNav = [ { to: '/', label: '概览', description: '站点运营总览', icon: LayoutDashboard, }, { to: '/analytics', label: '数据分析', description: '搜索词与 AI 问答洞察', icon: BarChart3, }, { to: '/posts', label: '文章', description: 'Markdown 内容管理', icon: ScrollText, }, { to: '/categories', label: '分类', description: '分类目录与聚合统计', icon: Folders, }, { to: '/tags', label: '标签', description: '标签库与引用整理', icon: Tags, }, { to: '/backups', label: '备份', description: '全站导出与恢复', icon: Download, }, { to: '/revisions', label: '版本', description: '历史快照与一键回滚', icon: History, }, { to: '/comments', label: '评论', description: '审核与段落回复', icon: MessageSquareText, }, { to: '/friend-links', label: '友链', description: '友链申请与互链管理', icon: Link2, }, { to: '/reviews', label: '评测', description: '评测内容库', icon: BookOpenText, }, { to: '/media', label: '媒体库', description: '对象存储图片管理', icon: ImageIcon, }, { to: '/subscriptions', label: '订阅', description: '邮件 / Webhook 推送', icon: BellRing, }, { to: '/audit', label: '审计', description: '后台操作审计日志', icon: Settings, }, { to: '/settings', label: '设置', description: '品牌、资料与 AI 配置', icon: Settings, }, ] export function AppShell({ children, username, email, authSource, authProvider, loggingOut, canLogout, onLogout, }: { children: ReactNode username: string | null email: string | null authSource: string | null authProvider: string | null loggingOut: boolean canLogout: boolean onLogout: () => Promise }) { return (
新版管理工作台

当前登录:{username ?? 'admin'}

{authProvider ?? 'React + shadcn/ui 基础架构'}

{email ? (

{email}

) : authSource ? (

认证来源:{authSource}

) : null}
{primaryNav.map((item) => ( cn( 'rounded-full border px-3 py-2 text-sm whitespace-nowrap transition-colors', isActive ? 'border-primary/30 bg-primary/10 text-primary' : 'border-border/70 bg-background/60 text-muted-foreground', ) } > {item.label} ))}
{children}
) }