import React from 'react'; import { useAuth } from '../../hooks/useAuth'; import { PencilSquareIcon, FolderOpenIcon, CpuChipIcon, CogIcon, UserCircleIcon, ShieldCheckIcon } from '@heroicons/react/24/outline'; interface SidebarProps { activeSection: string; onSectionChange: (section: string) => void; } const Sidebar: React.FC = ({ activeSection, onSectionChange }) => { const { user, signOut } = useAuth(); const menuItems = [ { id: 'creation', label: '创作中心', icon: PencilSquareIcon, description: 'AI驱动的小说创作' }, { id: 'projects', label: '作品管理', icon: FolderOpenIcon, description: '管理您的小说项目' }, { id: 'ai-models', label: 'AI模型', icon: CpuChipIcon, description: '配置和管理AI模型' }, { id: 'settings', label: '系统设置', icon: CogIcon, description: '个人设置和系统配置' } ]; // 管理员菜单项 if (user?.role === 'admin') { menuItems.push({ id: 'admin', label: '管理控制台', icon: ShieldCheckIcon, description: '系统管理和监控' }); } return (
{/* 头部 Logo */}
📚

NovelForge

Sentinel Pro

{/* 导航菜单 */}
{menuItems.map((item) => { const Icon = item.icon; return ( ); })}
{/* 底部用户信息 */}
{/* 用户信息 */}
{user?.full_name || user?.username || '用户'}
{user?.role === 'admin' ? '管理员' : '已认证'}
{/* 安全状态 */}
设备已绑定
安全
{/* 退出按钮 */}
); }; export default Sidebar;