Files
lunaqrmenu/app/admin/components/AdminNavItem.tsx
2026-05-15 19:37:30 +03:00

22 lines
478 B
TypeScript

'use client';
import React from 'react';
import { usePathname } from 'next/navigation';
import NextLink from 'next/link';
interface NavItemProps {
href: string;
children: React.ReactNode;
}
export default function AdminNavItem({ href, children }: NavItemProps) {
const pathname = usePathname();
const isActive = pathname === href;
return (
<NextLink href={href} className={`admin-nav-item ${isActive ? 'active' : ''}`}>
{children}
</NextLink>
);
}