From d6dd76021226802adf5295b3243d6f2ae4fa5cc2 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Sun, 10 Mar 2024 17:59:58 +0000
Subject: refactor: Move all components to the top level directory

---
 packages/web/app/dashboard/components/Sidebar.tsx | 66 -----------------------
 1 file changed, 66 deletions(-)
 delete mode 100644 packages/web/app/dashboard/components/Sidebar.tsx

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

diff --git a/packages/web/app/dashboard/components/Sidebar.tsx b/packages/web/app/dashboard/components/Sidebar.tsx
deleted file mode 100644
index a5c1d7a5..00000000
--- a/packages/web/app/dashboard/components/Sidebar.tsx
+++ /dev/null
@@ -1,66 +0,0 @@
-import { Tag, Home, PackageOpen, Settings, Search, Shield } from "lucide-react";
-import { redirect } from "next/navigation";
-import SidebarItem from "./SidebarItem";
-import { getServerAuthSession } from "@/server/auth";
-import Link from "next/link";
-import SidebarProfileOptions from "./SidebarProfileOptions";
-import { Separator } from "@/components/ui/separator";
-import AllLists from "./AllLists";
-import serverConfig from "@hoarder/shared/config";
-import { api } from "@/server/api/client";
-
-export default async function Sidebar() {
-  const session = await getServerAuthSession();
-  if (!session) {
-    redirect("/");
-  }
-
-  const lists = await api.lists.list();
-
-  return (
-    <aside className="flex h-screen w-60 flex-col gap-5 border-r p-4">
-      <Link href={"/dashboard/bookmarks"}>
-        <div className="flex items-center rounded-lg px-1 text-slate-900">
-          <PackageOpen />
-          <span className="ml-2 text-base font-semibold">Hoarder</span>
-        </div>
-      </Link>
-      <hr />
-      <div>
-        <ul className="space-y-2 text-sm font-medium">
-          <SidebarItem
-            logo={<Home />}
-            name="Home"
-            path="/dashboard/bookmarks"
-          />
-          {serverConfig.meilisearch && (
-            <SidebarItem
-              logo={<Search />}
-              name="Search"
-              path="/dashboard/search"
-            />
-          )}
-          <SidebarItem logo={<Tag />} name="Tags" path="/dashboard/tags" />
-          <SidebarItem
-            logo={<Settings />}
-            name="Settings"
-            path="/dashboard/settings"
-          />
-          {session.user.role == "admin" && (
-            <SidebarItem
-              logo={<Shield />}
-              name="Admin"
-              path="/dashboard/admin"
-            />
-          )}
-        </ul>
-      </div>
-      <Separator />
-      <AllLists initialData={lists} />
-      <div className="mt-auto flex justify-between justify-self-end">
-        <div className="my-auto"> {session.user.name} </div>
-        <SidebarProfileOptions />
-      </div>
-    </aside>
-  );
-}
-- 
cgit v1.2.3-70-g09d2

