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
47
48
|
"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { NAV } from "@/lib/nav";
export function AppNav() {
const pathname = usePathname();
return (
<nav
className="sticky top-0 z-30 flex items-center justify-between h-14 px-6"
style={{
background: "var(--bg-card)",
color: "var(--text)",
borderBottom: "1px solid var(--border)",
}}
>
<div className="flex items-center gap-8">
<span
className="text-sm font-bold tracking-tight"
style={{ fontFamily: "var(--font-display)" }}
>
Personal Dashboard
</span>
<div className="flex gap-6">
{NAV.map((a) => {
const active =
a.href === "/" ? pathname === "/" : pathname.startsWith(a.href);
return (
<Link
key={a.href}
href={a.href}
className="text-xs uppercase tracking-widest"
style={{
fontFamily: "var(--font-display)",
color: active ? "var(--text)" : "var(--text-muted)",
}}
>
{a.label}
</Link>
);
})}
</div>
</div>
</nav>
);
}
|