import React, { useState } from 'react'; import { Outlet, NavLink, useNavigate } from 'react-router-dom'; import { useAuth } from '@/contexts/AuthContext'; import './FrontLayout.css'; const navGroups = [ { title: '智能体', items: [ { path: '/chat', icon: 'chat', label: 'AI聊天' }, { path: '/knowledge', icon: 'knowledge', label: '知识库' }, { path: '/market', icon: 'market', label: '技能市场' }, { path: '/evolution', icon: 'evolution', label: '进化看板' }, ], }, { title: 'IM Bot', items: [ { path: '/wechat-bot', icon: 'wechat', label: '微信Bot' }, { path: '/im-bots?platform=wecom', icon: 'wecom', label: '企业微信' }, { path: '/im-bots?platform=feishu', icon: 'feishu', label: '飞书' }, { path: '/im-bots?platform=qq', icon: 'qq', label: 'QQ' }, { path: '/im-bots?platform=wukong', icon: 'wukong', label: '悟空IM' }, ], }, { title: '资源中心', items: [ { path: '/app-services', icon: 'apps', label: '应用服务' }, { path: '/token', icon: 'token', label: 'Token驾驶舱' }, { path: '/pricing', icon: 'pricing', label: '会员订阅' }, { path: '/assets', icon: 'assets', label: '资产文件' }, ], }, ]; const bottomItems = [ { path: '/profile', icon: 'profile', label: '个人设置' }, { path: '/notifications', icon: 'notify', label: '消息通知' }, ]; const iconPaths: Record = { chat: , channel: , knowledge: , market: , apps: , token: , pricing: , profile: , notify: , assets: , evolution: , wechat: , wecom: , feishu: , qq: , wukong: , }; const FrontLayout: React.FC = () => { const { user, logout } = useAuth(); const navigate = useNavigate(); const [collapsed, setCollapsed] = useState(false); if (!user) { navigate('/login'); return null; } return (
{/* Sidebar */} {/* Main Content */}
); }; export default FrontLayout;