24 lines
768 B
TypeScript
24 lines
768 B
TypeScript
import type { Metadata } from "next";
|
|||
|
|
import { notFound } from "next/navigation";
|
||
|
|
|
||
|
|
import { requireMe } from "@/lib/server";
|
||
|
|
|
||
|
|
import { AdminUsers } from "./AdminUsers";
|
||
|
|
|
||
|
|
export const metadata: Metadata = { title: "Admin" };
|
||
|
|
|
||
|
|
export default async function AdminPage() {
|
||
|
|
const me = await requireMe("/admin");
|
||
|
|
// Non-admins see the same 404 as for a missing page.
|
||
|
|
if (!me.user.roles.includes("admin")) notFound();
|
||
|
|
return (
|
||
|
|
<main className="page" style={{ maxWidth: 1180 }}>
|
||
|
|
<div className="page-head">
|
||
|
|
<h1>Felhasználók</h1>
|
||
|
|
<p className="muted">Szerepkörök és kreditek kezelése. A prémium és a VIP szerepkör nyitja meg a drágább elemző modelleket.</p>
|
||
|
|
</div>
|
||
|
|
<AdminUsers selfId={me.user.id} />
|
||
|
|
</main>
|
||
|
|
);
|
||
|
|
}
|