import { useState } from 'react' import { Layout, Menu, Switch, Badge, Tooltip, Avatar, Tag, Grid, Button } from 'antd' import { DashboardOutlined, BookOutlined, ApartmentOutlined, PlayCircleOutlined, SyncOutlined, ExperimentOutlined, CloudUploadOutlined, BranchesOutlined, BulbOutlined, BulbFilled, WifiOutlined, RocketOutlined, BarChartOutlined, SafetyCertificateOutlined, TranslationOutlined, } from '@ant-design/icons' import { useNavigate, useLocation } from 'react-router-dom' import { motion } from 'framer-motion' import { useAppStore } from '@/store/appStore' import { useWebSocket } from '@/hooks/useWebSocket' import { useT } from '@/i18n' const { Header, Sider, Content } = Layout const { useBreakpoint } = Grid export default function AppLayout({ children }: { children: React.ReactNode }) { const [collapsed, setCollapsed] = useState(false) const screens = useBreakpoint() const navigate = useNavigate() const location = useLocation() const { darkMode, toggleDark, wsEvents, lang, setLang } = useAppStore() const t = useT(lang) useWebSocket() const isNarrow = screens.xs && !screens.md const siderCollapsed = isNarrow ? true : collapsed const unreadEvents = wsEvents.filter(e => e.type !== 'pong' && e.type !== 'connected').length const menuItems = [ { type: 'group' as const, label: t.groupOverview, children: [ { key: '/', icon: , label: t.menuDashboard }, { key: '/evaluation', icon: , label: t.menuEvaluation }, ], }, { type: 'group' as const, label: t.groupSkillMgmt, children: [ { key: '/ingest', icon: , label: t.menuIngest }, { key: '/wiki', icon: , label: t.menuWiki }, { key: '/graph', icon: , label: t.menuGraph }, { key: '/lifecycle', icon: , label: t.menuLifecycle }, { key: '/versions', icon: , label: t.menuVersions }, ], }, { type: 'group' as const, label: t.groupAgentEvolution, children: [ { key: '/harness', icon: , label: t.menuHarness }, { key: '/execution', icon: , label: t.menuExecution }, { key: '/evolution', icon: , label: t.menuEvolution }, { key: '/demo', icon: , label: ( {t.menuDemo} DEMO ), }, ], }, ] return ( {!siderCollapsed ? (
S SkillWiki
) : ( S )}
navigate(key)} inlineCollapsed={siderCollapsed} style={{ borderRight: 0, marginTop: 8 }} />
{isNarrow ? t.appTitleShort : t.appTitle}
} unCheckedChildren={} />
{children}
) }