import { ReactNode, useState } from 'react' import { Layout, Menu, Typography, Button } from 'antd' import { DashboardOutlined, DatabaseOutlined, UserOutlined, SettingOutlined, BarChartOutlined, MenuUnfoldOutlined, MenuFoldOutlined, } from '@ant-design/icons' import { Link, useLocation } from 'react-router-dom' import { useAuthStore } from '../../stores/auth' const { Header, Sider, Content } = Layout const { Text } = Typography interface AppLayoutProps { children: ReactNode } function AppLayout({ children }: AppLayoutProps) { const location = useLocation() const { user, logout } = useAuthStore() const [collapsed, setCollapsed] = useState(false) const menuItems = [ { key: '/', icon: , label: 仪表盘 }, { key: '/datasources', icon: , label: 数据源 }, { key: '/data', icon: , label: 采集数据 }, { key: '/users', icon: , label: 用户管理 }, { key: '/settings', icon: , label: 系统配置 }, ] return (
{collapsed ? ( 🌏 ) : ( 智能星球 )}
{children}
) } export default AppLayout