import { getServerSession } from "next-auth";
import AdminUserApprovals from "../../../components/AdminUserApprovals";
import { authOptions } from "../../../lib/auth";

export default async function AdminUsersPage() {
  const session = await getServerSession(authOptions);
  if (session?.user?.role !== "ADMIN" && session?.user?.role !== "SUPERADMIN") {
    return (
      <div className="card-muted text-center">
        <p className="text-slate-700">Nur für Admins.</p>
      </div>
    );
  }

  return <AdminUserApprovals role={session?.user?.role ?? null} />;
}
