'use client'; import { useSetAtom } from 'jotai'; import Link from 'next/link'; import { usePathname, useRouter } from 'next/navigation'; import type { PropsWithChildren } from 'react'; import { isDrawerOpenAtom } from '@/stores/drawer'; import { cx } from '@/styles/cva'; export function NavigationItem({ node, packageName, version, children, }: PropsWithChildren<{ readonly node: any; readonly packageName: string; readonly version: string; }>) { const router = useRouter(); const pathname = usePathname(); const setDrawerOpen = useSetAtom(isDrawerOpenAtom); const href = `/docs/packages/${packageName}/${version}/${node.href}`; return ( setDrawerOpen(false)} onMouseEnter={() => router.prefetch(href)} onTouchStart={() => router.prefetch(href)} prefetch={false} title={node.name} // @ts-expect-error - unstable_dynamicOnHover is not part of the public types unstable_dynamicOnHover > {children} ); }