File size: 3,880 Bytes
9580dce | 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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | "use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
import {
Brain,
Castle,
BookOpen,
Lightbulb,
Puzzle,
Swords,
Wand2,
Code2,
User,
LayoutDashboard,
Settings,
BarChart3,
BrainCircuit,
MessageSquare,
} from "lucide-react";
type NavItem = {
href: string;
label: string;
icon: React.ReactNode;
color: string;
};
const NAV_ITEMS: NavItem[] = [
{
href: "/",
label: "Dashboard",
icon: <LayoutDashboard size={18} />,
color: "rgba(255,255,255,0.7)",
},
{
href: "/chess",
label: "Chess",
icon: <Castle size={18} />,
color: "var(--color-chess)",
},
{
href: "/reading",
label: "Deep Reading",
icon: <BookOpen size={18} />,
color: "var(--color-reading)",
},
{
href: "/feynman",
label: "Feynman",
icon: <Lightbulb size={18} />,
color: "var(--color-feynman)",
},
{
href: "/logic",
label: "Logic Puzzles",
icon: <Puzzle size={18} />,
color: "var(--color-logic)",
},
{
href: "/critical-thinking",
label: "Critical Thinking",
icon: <Swords size={18} />,
color: "var(--color-critical-thinking)",
},
{
href: "/quests",
label: "Skill Quests",
icon: <Wand2 size={18} />,
color: "var(--color-quests)",
},
{
href: "/coding",
label: "Coding Training",
icon: <Code2 size={18} />,
color: "var(--color-coding)",
},
{
href: "/debate",
label: "Debate Arena",
icon: <MessageSquare size={18} />,
color: "var(--color-critical-thinking)",
},
{
href: "/coach",
label: "Coach",
icon: <BrainCircuit size={18} />,
color: "#6366f1",
},
{
href: "/stats",
label: "Stats",
icon: <BarChart3 size={18} />,
color: "rgba(255,255,255,0.7)",
},
{
href: "/profile",
label: "Profile",
icon: <User size={18} />,
color: "rgba(255,255,255,0.7)",
},
{
href: "/settings",
label: "Settings",
icon: <Settings size={18} />,
color: "rgba(255,255,255,0.7)",
},
];
export function SidebarNav() {
const pathname = usePathname();
return (
<aside
className="hidden md:flex flex-col w-56 min-h-screen shrink-0 border-r"
style={{
background: "var(--surface-1)",
borderColor: "rgba(255,255,255,0.06)",
}}
>
{/* Logo */}
<div className="flex items-center gap-2 px-5 py-5 border-b" style={{ borderColor: "rgba(255,255,255,0.06)" }}>
<Brain size={22} style={{ color: "var(--primary)" }} />
<span className="font-bold text-lg tracking-tight" style={{ fontFamily: "var(--font-mono)" }}>
RotNot
</span>
</div>
{/* Nav items */}
<nav className="flex flex-col gap-0.5 px-3 py-4 flex-1">
{NAV_ITEMS.map((item) => {
const isActive =
item.href === "/"
? pathname === "/"
: pathname.startsWith(item.href);
return (
<Link
key={item.href}
href={item.href}
className="flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-150"
style={{
color: isActive ? item.color : "var(--text-secondary)",
background: isActive
? `color-mix(in srgb, ${item.color} 12%, transparent)`
: "transparent",
}}
>
<span style={{ color: isActive ? item.color : "var(--text-muted)" }}>
{item.icon}
</span>
{item.label}
</Link>
);
})}
</nav>
{/* Footer */}
<div
className="px-5 py-4 border-t text-xs"
style={{ borderColor: "rgba(255,255,255,0.06)", color: "var(--text-muted)" }}
>
Fight brain rot.
</div>
</aside>
);
}
|