48 lines
1.1 KiB
TypeScript
48 lines
1.1 KiB
TypeScript
"use client";
|
|
|
|
import { cn } from "@/lib/utils";
|
|
import { BookOpenTextIcon, SignatureIcon, UserIcon } from "lucide-react";
|
|
import Link from "next/link";
|
|
import { usePathname } from "next/navigation";
|
|
|
|
const menuItems = [
|
|
{
|
|
href: "/account",
|
|
label: "Profile",
|
|
icon: UserIcon,
|
|
},
|
|
{
|
|
href: "/account/citizenship",
|
|
label: "Citizenship",
|
|
icon: BookOpenTextIcon,
|
|
}
|
|
];
|
|
|
|
export function AccountMenu() {
|
|
const pathname = usePathname();
|
|
|
|
return (
|
|
<div className="flex flex-col md:w-56 gap-2 md:mx-16 shrink-0">
|
|
{menuItems.map((item) => {
|
|
const Icon = item.icon;
|
|
const active = pathname === item.href;
|
|
|
|
return (
|
|
<Link
|
|
href={item.href}
|
|
key={item.href}
|
|
className={cn(
|
|
"flex flex-row gap-2 items-center underline-offset-8 decoration-2 duration-200",
|
|
active
|
|
? "text-foreground underline mb-1.5"
|
|
: "text-muted-foreground hover:text-foreground hover:underline"
|
|
)}
|
|
>
|
|
<Icon size={16} />
|
|
<span>{item.label}</span>
|
|
</Link>
|
|
);
|
|
})}
|
|
</div>
|
|
);
|
|
} |