import type { Metadata } from "next";
import { createPageAction } from "@/actions/pages";
import { PageForm } from "@/components/admin/PageForm";
import { requireAdmin } from "@/lib/auth/dal";

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

export default async function NewPagePage() {
  await requireAdmin();
  return (
    <div>
      <h1 className="mb-6 text-2xl font-bold tracking-tight text-ink-bright">New page</h1>
      <PageForm action={createPageAction} />
    </div>
  );
}
