diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx new file mode 100644 index 0000000..30e3a29 --- /dev/null +++ b/src/app/admin/page.tsx @@ -0,0 +1,25 @@ +import SubmitDialogButton from "@/components/profile-settings/submit-dialog-button"; +import { auth } from "@/lib/auth"; +import { redirect } from "next/navigation"; + +export default async function AdminPage() { + const session = await auth(); + + if (!session || Number(session.user.id) !== Number(process.env.NEXT_PUBLIC_ADMIN_USER_ID)) redirect("/404"); + + return ( +
+
+

Admin Panel

+

View reports, set banners, etc.

+
+ + {/* Separator */} +
+
+ Reports +
+
+
+ ); +} diff --git a/src/app/profile/[id]/page.tsx b/src/app/profile/[id]/page.tsx index 4564530..67ecf34 100644 --- a/src/app/profile/[id]/page.tsx +++ b/src/app/profile/[id]/page.tsx @@ -108,9 +108,17 @@ export default async function ProfilePage({ params }: Props) {

Created: {user?.createdAt.toLocaleDateString("en-GB", { month: "long", day: "2-digit", year: "numeric" })}

+ +
+ {Number(session?.user.id) === Number(process.env.NEXT_PUBLIC_ADMIN_USER_ID) && ( + + + Admin + + )} {session?.user.id == id && ( - + Settings