From 4fae8f04f546d2b3f6053870d93385fa36af4742 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Fri, 9 Feb 2024 15:32:04 +0000
Subject: [ui] Adding the favourites and archive pages

---
 .../web/app/dashboard/components/SidebarItem.tsx   | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 packages/web/app/dashboard/components/SidebarItem.tsx

(limited to 'packages/web/app/dashboard/components/SidebarItem.tsx')

diff --git a/packages/web/app/dashboard/components/SidebarItem.tsx b/packages/web/app/dashboard/components/SidebarItem.tsx
new file mode 100644
index 00000000..e6a00d72
--- /dev/null
+++ b/packages/web/app/dashboard/components/SidebarItem.tsx
@@ -0,0 +1,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-slate-100" : "",
+      )}
+    >
+      <Link href={path} className="flex w-full space-x-2 px-3 py-2">
+        {logo}
+        <span className="my-auto"> {name} </span>
+      </Link>
+    </li>
+  );
+}
-- 
cgit v1.2.3-70-g09d2

