feat: empty admin page
This commit is contained in:
parent
950a461fb1
commit
ddc7cd92d2
2 changed files with 34 additions and 1 deletions
25
src/app/admin/page.tsx
Normal file
25
src/app/admin/page.tsx
Normal file
|
|
@ -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 (
|
||||
<div className="bg-amber-50 border-2 border-amber-500 rounded-2xl shadow-lg p-4 flex flex-col gap-4">
|
||||
<div>
|
||||
<h2 className="text-2xl font-bold">Admin Panel</h2>
|
||||
<p className="text-sm text-zinc-500">View reports, set banners, etc.</p>
|
||||
</div>
|
||||
|
||||
{/* Separator */}
|
||||
<div className="flex items-center gap-4 text-zinc-500 text-sm font-medium my-1">
|
||||
<hr className="flex-grow border-zinc-300" />
|
||||
<span>Reports</span>
|
||||
<hr className="flex-grow border-zinc-300" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -108,9 +108,17 @@ export default async function ProfilePage({ params }: Props) {
|
|||
<h4 className="text-sm" title={`${user?.createdAt.toLocaleTimeString("en-GB", { timeZone: "UTC" })} UTC`}>
|
||||
Created: {user?.createdAt.toLocaleDateString("en-GB", { month: "long", day: "2-digit", year: "numeric" })}
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col items-end justify-end gap-1">
|
||||
{Number(session?.user.id) === Number(process.env.NEXT_PUBLIC_ADMIN_USER_ID) && (
|
||||
<Link href="/admin" className="pill button !px-4 !py-1.5 text-sm w-min !justify-start">
|
||||
<Icon icon="mdi:shield-moon" className="text-lg mr-2" />
|
||||
<span>Admin</span>
|
||||
</Link>
|
||||
)}
|
||||
{session?.user.id == id && (
|
||||
<Link href="/profile/settings" className="pill button absolute right-0 bottom-0 !px-4">
|
||||
<Link href="/profile/settings" className="pill button !px-4 w-full h-min !justify-start">
|
||||
<Icon icon="material-symbols:settings-rounded" className="text-2xl mr-2" />
|
||||
<span>Settings</span>
|
||||
</Link>
|
||||
|
|
|
|||
Loading…
Reference in a new issue