import { useState } from 'react'; import { Outlet, useNavigate, useLocation } from 'react-router-dom'; import { Layout, Menu, Button, Typography, Avatar, Dropdown } from 'antd'; import { MessageOutlined, ToolOutlined, HistoryOutlined, SettingOutlined, LogoutOutlined, UserOutlined, MenuFoldOutlined, MenuUnfoldOutlined, } from '@ant-design/icons'; import { useAuthStore } from '../../stores/authStore'; import Sidebar from './Sidebar'; const { Header, Sider, Content } = Layout; export default function AppLayout() { const [collapsed, setCollapsed] = useState(false); const navigate = useNavigate(); const location = useLocation(); const { user, logout } = useAuthStore(); const isChatRoute = location.pathname.startsWith('/chat'); const menuItems = [ { key: '/chat', icon: , label: 'Chat' }, { key: '/tools', icon: , label: 'Tools' }, { key: '/history', icon: , label: 'History' }, { key: '/settings', icon: , label: 'Settings' }, ]; const userMenuItems = [ { key: 'logout', icon: , label: 'Logout', onClick: () => { logout(); navigate('/login'); }, }, ]; return (
⚗️
EchemAgent
navigate(key)} style={{ flex: 1, justifyContent: 'center', background: 'transparent', borderBottom: 'none', color: 'rgba(255, 255, 255, 0.85)', }} theme="dark" />
} style={{ background: 'rgba(255, 255, 255, 0.3)' }} /> {user?.username}
{isChatRoute && (
)}
); }