Spaces:
Sleeping
Sleeping
Download frontend/components/Sidebar/NavItem.tsx from axeronis/microfunnel-api: direct link, hf CLI and curl.
- Browser
- Download file 1.94 kB
-
https://huggingface.co/spaces/axeronis/microfunnel-api/resolve/main/frontend/components/Sidebar/NavItem.tsx
- Command line
-
hf download hf://spaces/axeronis/microfunnel-api/frontend/components/Sidebar/NavItem.tsx
-
curl -L -o NavItem.tsx https://huggingface.co/spaces/axeronis/microfunnel-api/resolve/main/frontend/components/Sidebar/NavItem.tsx
1.94 kB
| 'use client' | |
| import Link from 'next/link' | |
| import { cn } from '@/lib/utils' | |
| import type { LucideIcon } from 'lucide-react' | |
| interface NavItemProps { | |
| href: string | |
| icon: LucideIcon | |
| label: string | |
| isActive: boolean | |
| variant?: 'default' | 'admin' | |
| } | |
| export function NavItem({ href, icon: Icon, label, isActive, variant = 'default' }: NavItemProps) { | |
| const isAdmin = variant === 'admin' | |
| return ( | |
| <Link | |
| href={href} | |
| className={cn( | |
| "flex items-center gap-3 px-4 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative border", | |
| isAdmin ? ( | |
| isActive | |
| ? "text-white bg-red-500/10 border-red-500/50 shadow-[0_0_15px_-3px_rgba(220,38,38,0.3)]" | |
| : "text-red-400 border-transparent hover:bg-red-500/5 hover:border-red-500/20" | |
| ) : ( | |
| isActive | |
| ? "text-white bg-indigo-500/10 border-indigo-500/50 shadow-[0_0_15px_-3px_rgba(99,102,241,0.3)]" | |
| : "text-slate-400 border-transparent hover:text-white hover:bg-white/5 hover:border-white/10" | |
| ) | |
| )} | |
| > | |
| <Icon | |
| className={cn( | |
| "w-4 h-4 transition-colors", | |
| isAdmin ? ( | |
| isActive ? "text-red-500" : "text-red-400" | |
| ) : ( | |
| isActive ? "text-indigo-400" : "text-slate-500 group-hover:text-indigo-400" | |
| ) | |
| )} | |
| /> | |
| <span className={isAdmin ? "font-mono font-bold" : ""}>{label}</span> | |
| {isActive && ( | |
| <div className={cn( | |
| "ml-auto w-1.5 h-1.5 rounded-full animate-pulse", | |
| isAdmin ? "bg-red-500" : "bg-indigo-500" | |
| )} /> | |
| )} | |
| </Link> | |
| ) | |
| } | |