feat: add prisma support, admin panel and auth
This commit is contained in:
22
app/admin/components/AdminNavItem.tsx
Normal file
22
app/admin/components/AdminNavItem.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import Link from 'next/use-pathname';
|
||||
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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user