import * as React from 'react' import cx from 'classnames' import { getPathWithNoTrailingSlash } from '../../lib/url' import { MenuToggle } from './MenuToggle' import { useScreenType } from '../../hooks/useScreenType' import { MenuItem } from './MenuItem' const itemUrl = (url: string) => getPathWithNoTrailingSlash(url) export interface IMenuProps { items: any[] } export const Menu: React.FC = props => { const isMobile = useScreenType(['phone', 'tablet']) const [open, setOpen] = React.useState(false) const onClick = React.useCallback( () => { setOpen(!open) }, [open] ) return ( {isMobile ? ( ) : props.items.map((item, index) => (
  • ))}
    ) }