-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.tsx
46 lines (41 loc) · 1.42 KB
/
header.tsx
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
43
44
45
46
"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { siteConfig } from "~/config/site";
import { cn } from "~/utils/cn";
import { ModeToggle } from "../mode-toggle";
export function Header() {
const pathname = usePathname();
return (
<header className="supports-backdrop-blur:bg-background/60 sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur">
<div className="container flex h-14 items-center">
<div className="mr-4 hidden md:flex">
<Link href="/" className="mr-6 flex items-center space-x-2">
<span className="hidden font-bold sm:inline-block">
{siteConfig.name}
</span>
</Link>
<nav className="flex items-center space-x-6 text-sm font-medium">
{siteConfig.navItems.map((link) => (
<Link
key={link.href}
href={link.href}
className={cn(
"transition-colors hover:text-foreground/80",
pathname === link.href
? "text-foreground"
: "text-foreground/60",
)}
>
{link.label}
</Link>
))}
</nav>
</div>
<div className="flex flex-1 items-center justify-between space-x-2 md:justify-end">
<ModeToggle />
</div>
</div>
</header>
);
}