From 5902664658a36e4afc81327eea9f8eef05561bcb Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Mon, 30 Dec 2024 12:15:35 +0000 Subject: refactor: Refactor sidebar into a shared component --- apps/web/app/admin/layout.tsx | 63 ++++++++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 21 deletions(-) (limited to 'apps/web/app/admin') diff --git a/apps/web/app/admin/layout.tsx b/apps/web/app/admin/layout.tsx index 0d876736..7b20b7ad 100644 --- a/apps/web/app/admin/layout.tsx +++ b/apps/web/app/admin/layout.tsx @@ -1,11 +1,41 @@ import { redirect } from "next/navigation"; import { AdminCard } from "@/components/admin/AdminCard"; import { AdminNotices } from "@/components/admin/AdminNotices"; -import MobileAdminSidebar from "@/components/admin/sidebar/MobileSidebar"; -import AdminSidebar from "@/components/admin/sidebar/Sidebar"; -import Header from "@/components/dashboard/header/Header"; -import { Separator } from "@/components/ui/separator"; +import MobileSidebar from "@/components/shared/sidebar/MobileSidebar"; +import Sidebar from "@/components/shared/sidebar/Sidebar"; +import SidebarLayout from "@/components/shared/sidebar/SidebarLayout"; import { getServerAuthSession } from "@/server/auth"; +import { TFunction } from "i18next"; +import { Activity, ArrowLeft, Settings, Users } from "lucide-react"; + +const adminSidebarItems = ( + t: TFunction, +): { + name: string; + icon: JSX.Element; + path: string; +}[] => [ + { + name: t("settings.back_to_app"), + icon: , + path: "/dashboard/bookmarks", + }, + { + name: t("admin.server_stats.server_stats"), + icon: , + path: "/admin/overview", + }, + { + name: t("admin.users_list.users_list"), + icon: , + path: "/admin/users", + }, + { + name: t("common.actions"), + icon: , + path: "/admin/actions", + }, +]; export default async function AdminLayout({ children, @@ -18,23 +48,14 @@ export default async function AdminLayout({ } return ( -
-
-
-
- -
-
-
- - -
-
- - {children} -
-
+ } + mobileSidebar={} + > +
+ + {children}
-
+ ); } -- cgit v1.2.3-70-g09d2