aboutsummaryrefslogtreecommitdiffstats
path: root/packages/web/app/dashboard/components/SidebarItem.tsx
blob: 74d20bc08368a67eeeef663bc29bc85384ae02c6 (plain) (blame)
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
"use client";

import { cn } from "@/lib/utils";
import Link from "next/link";
import { usePathname } from "next/navigation";

export default function SidebarItem({
  name,
  logo,
  path,
}: {
  name: string;
  logo: React.ReactNode;
  path: string;
}) {
  const currentPath = usePathname();
  return (
    <li
      className={cn(
        "rounded-lg  hover:bg-slate-100",
        path == currentPath ? "bg-gray-50" : "",
      )}
    >
      <Link href={path} className="flex w-full space-x-2 px-3 py-2">
        {logo}
        <span className="my-auto"> {name} </span>
      </Link>
    </li>
  );
}