blob: 18efc889221a69c2f2d2039d2a5d836fb18512e7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import { redirect } from "next/navigation";
import AdminActions from "@/components/dashboard/admin/AdminActions";
import ServerStats from "@/components/dashboard/admin/ServerStats";
import UserList from "@/components/dashboard/admin/UserList";
import { getServerAuthSession } from "@/server/auth";
export default async function AdminPage() {
const session = await getServerAuthSession();
if (!session || session.user.role !== "admin") {
redirect("/");
}
return (
<>
<div className="rounded-md border bg-background p-4">
<ServerStats />
<AdminActions />
</div>
<div className="mt-4 rounded-md border bg-background p-4">
<UserList />
</div>
</>
);
}
|