import { Link, useLocation } from '@remix-run/react' import { Location } from 'react-router' import { NavigationSchema, NavigationSchemaItem, } from '../../../scripts/docs/navigation' import { WidgetSearch } from '../Widgets/WidgetSearch' import { BadgeNew } from '../BadgeNew' import { anchorActive, anchorHasNoLink, anchorStyles, anchorTitle, docsList, scrollArea, widgetContainer, } from './MenuDocs.css' import clsx from 'clsx' interface MenuDocsProps { submenu?: NavigationSchema onNavClick?: () => void } export const MenuDocs = ({ submenu, onNavClick }: MenuDocsProps) => { const location = useLocation() const handleNavClick = () => { if (onNavClick) { onNavClick() } } const isDocs = location.pathname.includes('docs') return ( ) } interface SubMenuSchema extends NavigationSchemaItem { location: Location onClick?: () => void } const renderSubMenu = ( { children, id, title, href, location, onClick, noPage, isNew, }: SubMenuSchema, level: number ) => { const handleClick = () => { if (onClick) { onClick() } } const hasRenderableChildren = children.length > 0 const isTitle = level === 0 const doesNotWantPage = Boolean(noPage) return (
  • {!doesNotWantPage ? ( {title} {isNew ? : null} ) : ( {title} {isNew ? : null} )} {hasRenderableChildren ? ( ) : null}
  • ) }