import type { Metadata } from "next";
import { createUserAction } from "@/actions/users";
import { UserForm } from "@/components/admin/UserForm";
import { requireAdmin } from "@/lib/auth/dal";
import { listAllTags } from "@/lib/services/tags";

export const metadata: Metadata = { title: "New account" };

export default async function NewUserPage() {
  await requireAdmin();
  const allTags = await listAllTags();

  return (
    <div>
      <h1 className="mb-6 text-2xl font-bold tracking-tight text-ink-bright">New account</h1>
      <UserForm allTags={allTags} action={createUserAction} />
    </div>
  );
}
