mirror of
https://github.com/vas3k/TaxHacker.git
synced 2026-01-06 05:30:08 -06:00
36 lines
930 B
TypeScript
36 lines
930 B
TypeScript
"use client"
|
|
|
|
import { buttonVariants } from "@/components/ui/button"
|
|
import { cn } from "@/lib/utils"
|
|
import Link from "next/link"
|
|
import { usePathname } from "next/navigation"
|
|
|
|
interface SidebarNavProps extends React.HTMLAttributes<HTMLElement> {
|
|
items: {
|
|
href: string
|
|
title: string
|
|
}[]
|
|
}
|
|
|
|
export function SideNav({ className, items, ...props }: SidebarNavProps) {
|
|
const pathname = usePathname()
|
|
|
|
return (
|
|
<nav className={cn("flex flex-wrap space-x-2 lg:flex-col lg:space-x-0 lg:space-y-1", className)} {...props}>
|
|
{items.map((item) => (
|
|
<Link
|
|
key={item.href}
|
|
href={item.href}
|
|
className={cn(
|
|
buttonVariants({ variant: "ghost" }),
|
|
pathname === item.href ? "bg-muted hover:bg-muted" : "hover:bg-transparent hover:underline",
|
|
"justify-start"
|
|
)}
|
|
>
|
|
{item.title}
|
|
</Link>
|
|
))}
|
|
</nav>
|
|
)
|
|
}
|