All checks were successful
Staging Build / build (push) Successful in 2m46s
- Add is_required and allow_multiselect category toggles - Implement module-popover for product module assignment - Add cascade-protected deletion for categories and products - Add sidebar link with AdminNavLink active states
29 lines
706 B
TypeScript
29 lines
706 B
TypeScript
'use client'
|
|
|
|
import Link from 'next/link'
|
|
import { usePathname } from 'next/navigation'
|
|
import { ReactNode } from 'react'
|
|
|
|
interface AdminNavLinkProps {
|
|
href: string
|
|
children: ReactNode
|
|
}
|
|
|
|
export function AdminNavLink({ href, children }: AdminNavLinkProps) {
|
|
const pathname = usePathname()
|
|
const isActive = pathname === href
|
|
|
|
return (
|
|
<Link
|
|
href={href}
|
|
className={`flex items-center gap-3 px-3 py-2 rounded-lg transition-all ${
|
|
isActive
|
|
? 'bg-primary text-black font-semibold'
|
|
: 'text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-white hover:bg-slate-100 dark:hover:bg-white/5'
|
|
}`}
|
|
>
|
|
{children}
|
|
</Link>
|
|
)
|
|
}
|