-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNavBar.tsx
More file actions
42 lines (35 loc) · 1.19 KB
/
NavBar.tsx
File metadata and controls
42 lines (35 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
'use client';
import classnames from "classnames";
import Link from 'next/link';
import { usePathname } from 'next/navigation';
import { AiFillBug } from "react-icons/ai";
const NavBar = () => {
const currentPath = usePathname()
const links = [
{ label: 'Dashboard', href: '/' },
{ label: 'Bugs', href: '/bugs' }
];
return (
<nav className="flex space-x-6 border-b mb-5 px-5 h-14 items-center">
<Link href="/">
<AiFillBug></AiFillBug>
</Link>
<ul className="flex space-x-6">
{links.map(link =>
<li key={link.href}>
<Link
className={classnames({
'text-zinc-900': link.href === currentPath,
'text-zinc-500': link.href !== currentPath,
'hover:text-zinc-800 transition-colors': true
})}
href={link.href}>
{link.label}
</Link>
</li>
)}
</ul>
</nav>
)
}
export default NavBar