From eb7da996a7c2d617d276f296cac07a6fd5648664 Mon Sep 17 00:00:00 2001
From: Mohamed Bassem <me@mbassem.com>
Date: Sun, 27 Oct 2024 12:03:14 +0000
Subject: ui: Redesign the settings page and move it to its own layout

---
 apps/web/components/settings/sidebar/Sidebar.tsx | 34 ++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 apps/web/components/settings/sidebar/Sidebar.tsx

(limited to 'apps/web/components/settings/sidebar/Sidebar.tsx')

diff --git a/apps/web/components/settings/sidebar/Sidebar.tsx b/apps/web/components/settings/sidebar/Sidebar.tsx
new file mode 100644
index 00000000..247e0916
--- /dev/null
+++ b/apps/web/components/settings/sidebar/Sidebar.tsx
@@ -0,0 +1,34 @@
+import { redirect } from "next/navigation";
+import SidebarItem from "@/components/shared/sidebar/SidebarItem";
+import { getServerAuthSession } from "@/server/auth";
+
+import serverConfig from "@hoarder/shared/config";
+
+import { settingsSidebarItems } from "./items";
+
+export default async function Sidebar() {
+  const session = await getServerAuthSession();
+  if (!session) {
+    redirect("/");
+  }
+
+  return (
+    <aside className="flex h-[calc(100vh-64px)] w-60 flex-col gap-5 border-r p-4 ">
+      <div>
+        <ul className="space-y-2 text-sm font-medium">
+          {settingsSidebarItems.map((item) => (
+            <SidebarItem
+              key={item.name}
+              logo={item.icon}
+              name={item.name}
+              path={item.path}
+            />
+          ))}
+        </ul>
+      </div>
+      <div className="mt-auto flex items-center border-t pt-2 text-sm text-gray-400">
+        Hoarder v{serverConfig.serverVersion}
+      </div>
+    </aside>
+  );
+}
-- 
cgit v1.2.3-70-g09d2

