import React, { ReactNode } from 'react'; import type { MenuProps } from 'antd'; import { Col, ConfigProvider, Flex, Menu, Row, Space, Typography } from 'antd'; import { createStyles } from 'antd-style'; const { Title, Paragraph } = Typography; const useStyles = createStyles(({ token }) => ({ navigationPopup: { padding: token.padding, minWidth: 480, background: token.colorBgElevated, borderRadius: token.borderRadiusLG, boxShadow: token.boxShadowSecondary, }, menuItem: { borderRadius: token.borderRadius, transition: `all ${token.motionDurationSlow}`, cursor: 'pointer', '&:hover': { background: 'rgba(0, 0, 0, 0.02)', }, }, menuItemSpace: { padding: token.paddingSM, }, leadingHeader: { margin: '0 !important', paddingBottom: token.paddingXS, borderBottom: `1px solid ${token.colorSplit}`, }, marginLess: { margin: '0 !important', }, })); const MenuItem = ({ title, description }: { title: string; description: string }) => { const { styles } = useStyles(); return (
{title} {description}
); }; const menuItems = [ { key: 'home', label: 'Home', }, { key: 'features', label: 'Features', children: [ { key: 'getting-started', label: ( ), }, { key: 'components', label: , }, { key: 'templates', label: , }, ], }, { key: 'resources', label: 'Resources', children: [ { key: 'blog', label: , }, { key: 'community', label: , }, ], }, ]; const App: React.FC = () => { const { styles } = useStyles(); const popupRender: MenuProps['popupRender'] = (_, { item }) => { return ( {item.title} {React.Children.map(item.children as ReactNode, (child) => { if (!React.isValidElement(child)) { return null; } return ( {child} ); })} ); }; return ( ); }; export default App;