import Link from "next/link";
import type { Metadata } from "next";
import { createProgram } from "@/app/actions/admin";
import { PageHeader } from "@/app/admin/_components/ui";
import ProgramForm from "@/app/admin/_components/ProgramForm";

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

export default function NewProgramPage() {
  return (
    <div>
      <PageHeader
        title="Add program"
        description="Create a learning format card for the homepage."
        action={
          <Link
            href="/admin/programs"
            className="text-sm font-semibold text-[#1f3fb8] hover:underline"
          >
            ← Back
          </Link>
        }
      />
      <ProgramForm action={createProgram} submitLabel="Create program" />
    </div>
  );
}
