import type { NavItemWithChildren } from '@rspress/core'; import { matchNavbar, useLocation } from '@rspress/core/runtime'; import { Link, Tag } from '@rspress/core/theme'; import cls from 'clsx'; import './index.scss'; type Items = NavItemWithChildren['items']; interface HoverGroupProps { items?: Items; customChildren?: React.ReactNode; isOpen: boolean; /** * @default center */ position?: 'left' | 'center' | 'right'; activeMatcher?: (item: Items[number]) => boolean; } function HoverGroupItem({ item, activeMatcher, depth = 0, }: { item: Items[number]; activeMatcher?: (item: Items[number]) => boolean; depth?: number; }) { const { pathname } = useLocation(); if ('items' in item && item.items && item.items.length > 0) { const hasLink = 'link' in item && item.link; return ( <> {hasLink && (