/**
* Ant Design application layout.
*/
import {
BookOutlined,
FileTextOutlined,
FolderOpenOutlined,
HomeOutlined,
InfoCircleOutlined,
} from '@ant-design/icons'
import { ConfigProvider, Layout, Typography } from 'antd'
import { Outlet, useLocation, useNavigate } from 'react-router-dom'
import SubMenu from '@/components/SubMenu'
import type { MenuRouteType } from '@/components/SubMenu'
const { Content, Header } = Layout
const menuItems: MenuRouteType[] = [
{ key: '/', icon: , label: 'Home' },
{ key: '/about', icon: , label: 'About' },
{
key: '/guide',
icon: ,
label: '指南',
children: [
{
key: '/guide/advanced',
icon: ,
label: '进阶',
children: [
{
key: '/guide/advanced/topic',
icon: ,
label: '三级标题',
},
],
},
],
},
]
const layoutTheme = {
components: {
Layout: {
headerPadding: 0,
},
},
}
function App(): JSX.Element {
const location = useLocation()
const navigate = useNavigate()
return (
React Template
navigate(key)}
routes={menuItems}
selectedKeys={[location.pathname]}
theme="dark"
/>
)
}
export default App