import { Drawer, Menu } from 'antd'; import { Link } from 'dumi'; import isEqual from 'fast-deep-equal'; import { uniq } from 'lodash'; import { useState } from 'react'; import { Center } from 'react-layout-kit'; import { activePathSel, useSiteStore } from '../../store'; import { useStyles } from './style'; const Burger = () => { const [opened, setOpened] = useState(false); const { styles, cx } = useStyles(); const nav = useSiteStore((s) => s.navData, isEqual); const sidebar = useSiteStore((s) => s.sidebar, isEqual); const activePath = useSiteStore(activePathSel); const pathname = useSiteStore((s) => s.location.pathname); return (
{ setOpened(!opened); }} >
({ label: {item.title}, key: item.activePath! || item.link!, children: (item.activePath || item.link) === activePath && sidebar?.map((group) => { return ( !group.link && { label: group.title, type: 'group', children: group.children.map((item) => ({ label: ( { setOpened(false); }} > {item.title} ), key: `s-${item.link}`, })), } ); }), }))} />
); }; export default Burger;