This commit is contained in:
2025-04-04 12:33:03 +02:00
commit 0cec39717e
73 changed files with 6825 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
import React from "react";
import * as LucideIcons from "lucide-react";
import { Button } from "./ui/button";
import { cn } from "@/lib/utils";
function NavLink({ href, name, icon }: NavLink) {
const active = usePathname() === href;
const IconComponent = icon
? (LucideIcons[icon as keyof typeof LucideIcons] as LucideIcons.LucideIcon)
: null;
return (
<Button
asChild
size={"icon"}
variant={"ghost"}
className={cn(active && "text-primary bg-accent/25")}
>
<Link href={href}>{IconComponent && <IconComponent />}</Link>
</Button>
);
}
export default NavLink;