);
}
diff --git a/apps/web/components/dashboard/admin/UserList.tsx b/apps/web/components/admin/UserList.tsx
similarity index 98%
rename from apps/web/components/dashboard/admin/UserList.tsx
rename to apps/web/components/admin/UserList.tsx
index 8c788ef4..3dfcaad1 100644
--- a/apps/web/components/dashboard/admin/UserList.tsx
+++ b/apps/web/components/admin/UserList.tsx
@@ -55,7 +55,7 @@ export default function UsersSection() {
}
return (
- <>
+
{t("admin.users_list.users_list")}
@@ -125,6 +125,6 @@ export default function UsersSection() {
))}
- >
+
);
}
diff --git a/apps/web/components/admin/sidebar/MobileSidebar.tsx b/apps/web/components/admin/sidebar/MobileSidebar.tsx
new file mode 100644
index 00000000..416b944c
--- /dev/null
+++ b/apps/web/components/admin/sidebar/MobileSidebar.tsx
@@ -0,0 +1,21 @@
+import MobileSidebarItem from "@/components/shared/sidebar/ModileSidebarItem";
+import { useTranslation } from "@/lib/i18n/server";
+
+import { adminSidebarItems } from "./items";
+
+export default async function MobileSidebar() {
+ const { t } = await useTranslation();
+ return (
+
+ );
+}
diff --git a/apps/web/components/admin/sidebar/Sidebar.tsx b/apps/web/components/admin/sidebar/Sidebar.tsx
new file mode 100644
index 00000000..8a5d615a
--- /dev/null
+++ b/apps/web/components/admin/sidebar/Sidebar.tsx
@@ -0,0 +1,36 @@
+import { redirect } from "next/navigation";
+import SidebarItem from "@/components/shared/sidebar/SidebarItem";
+import { useTranslation } from "@/lib/i18n/server";
+import { getServerAuthSession } from "@/server/auth";
+
+import serverConfig from "@hoarder/shared/config";
+
+import { adminSidebarItems } from "./items";
+
+export default async function Sidebar() {
+ const { t } = await useTranslation();
+ const session = await getServerAuthSession();
+ if (!session) {
+ redirect("/");
+ }
+
+ return (
+
+ );
+}
diff --git a/apps/web/components/admin/sidebar/items.tsx b/apps/web/components/admin/sidebar/items.tsx
new file mode 100644
index 00000000..78dfee34
--- /dev/null
+++ b/apps/web/components/admin/sidebar/items.tsx
@@ -0,0 +1,31 @@
+import { TFunction } from "i18next";
+import { Activity, ArrowLeft, Settings, Users } from "lucide-react";
+
+export 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",
+ },
+];
diff --git a/apps/web/components/dashboard/header/ProfileOptions.tsx b/apps/web/components/dashboard/header/ProfileOptions.tsx
index fc18e9d2..3d125606 100644
--- a/apps/web/components/dashboard/header/ProfileOptions.tsx
+++ b/apps/web/components/dashboard/header/ProfileOptions.tsx
@@ -16,7 +16,7 @@ import { LogOut, Moon, Paintbrush, Settings, Shield, Sun } from "lucide-react";
import { signOut, useSession } from "next-auth/react";
import { useTheme } from "next-themes";
-import { AdminNoticeBadge } from "../admin/AdminNotices";
+import { AdminNoticeBadge } from "../../admin/AdminNotices";
function DarkModeToggle() {
const { t } = useTranslation();
@@ -74,7 +74,7 @@ export default function SidebarProfileOptions() {
{session.user.role == "admin" && (
-
+
{t("admin.admin_settings")}