2026-01-30 03:49:53 +00:00
|
|
|
import Image from "next/image";
|
2026-01-30 04:31:01 +00:00
|
|
|
import Link from "next/link";
|
2026-01-30 03:49:53 +00:00
|
|
|
|
|
|
|
|
interface NavItemProps {
|
|
|
|
|
icon: string;
|
|
|
|
|
label: string;
|
|
|
|
|
isActive: boolean;
|
2026-01-30 04:31:01 +00:00
|
|
|
href: string;
|
2026-01-30 03:49:53 +00:00
|
|
|
}
|
|
|
|
|
|
2026-01-30 04:31:01 +00:00
|
|
|
export default function NavItem({ icon, label, isActive, href }: NavItemProps) {
|
2026-01-30 03:49:53 +00:00
|
|
|
return (
|
2026-01-30 04:31:01 +00:00
|
|
|
<Link
|
|
|
|
|
href={href}
|
2026-01-30 03:49:53 +00:00
|
|
|
className={`
|
|
|
|
|
rounded-xl
|
|
|
|
|
pl-4
|
|
|
|
|
flex
|
|
|
|
|
items-center
|
|
|
|
|
gap-2
|
|
|
|
|
h-[42px]
|
|
|
|
|
w-full
|
|
|
|
|
overflow-hidden
|
|
|
|
|
transition-colors
|
|
|
|
|
${isActive
|
2026-01-30 04:31:01 +00:00
|
|
|
? 'bg-fill-secondary-click dark:bg-gray-700'
|
|
|
|
|
: 'hover:bg-gray-50 dark:hover:bg-gray-700'
|
2026-01-30 03:49:53 +00:00
|
|
|
}
|
|
|
|
|
`}
|
|
|
|
|
>
|
|
|
|
|
<div className="w-[22px] h-[22px] flex-shrink-0 relative">
|
|
|
|
|
<Image
|
|
|
|
|
src={icon}
|
|
|
|
|
alt={label}
|
|
|
|
|
width={22}
|
|
|
|
|
height={22}
|
|
|
|
|
className="w-full h-full"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<span
|
|
|
|
|
className={`
|
|
|
|
|
text-sm
|
|
|
|
|
leading-[150%]
|
|
|
|
|
${isActive
|
2026-01-30 04:31:01 +00:00
|
|
|
? 'text-text-primary dark:text-white font-bold'
|
|
|
|
|
: 'text-text-tertiary dark:text-gray-400 font-medium'
|
2026-01-30 03:49:53 +00:00
|
|
|
}
|
|
|
|
|
`}
|
|
|
|
|
>
|
|
|
|
|
{label}
|
|
|
|
|
</span>
|
2026-01-30 04:31:01 +00:00
|
|
|
</Link>
|
2026-01-30 03:49:53 +00:00
|
|
|
);
|
|
|
|
|
}
|