'use client' import type { AdminNavigationItem } from '@admin/types/navigation' import { SidebarMenuButton } from '@admin/components/ui/sidebar' import { useQueryClient } from '@tanstack/react-query' import Link from 'next/link' import { usePathname } from 'next/navigation' export function AdminNavLink({ href, exact = false, prefetch, children }: { href: string exact?: boolean prefetch?: AdminNavigationItem['prefetch'] children: React.ReactNode }) { const pathname = usePathname() const queryClient = useQueryClient() const isActive = exact || href === '/admin' ? pathname === href : pathname === href || pathname.startsWith(`${href}/`) const runPrefetch = () => void prefetch?.(queryClient) return ( } > {children} ) }