# Add the "Program Finder" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/program-finder) to this Pantheon Content Publisher (P1) Next.js project. Degree and certificate cards showing credential, school, format and length, each card a single link.

## Steps

1. Create `components/puck/program-finder-block.tsx` with the exact file contents below. If `components/puck/` doesn't exist, find the folder where this project keeps its Puck components (look at the imports in `puck.config.tsx`) and put it there.
2. In `puck.config.tsx`, import it: `import { programFinderBlock } from "./components/puck/program-finder-block";`
3. Register it under `components` as `ProgramFinderBlock: programFinderBlock`.
4. Add `"ProgramFinderBlock"` to the best-fitting entry in `categories` (this block's library category is "Higher ed"). Create a category only if none fits.
5. Run the project's type check (usually `pnpm typecheck`) and resolve anything project-specific.
6. If `package.json` has a `sync:registry` script, tell the user it must run (or that CI will run it) before the new component appears in the P1 editor.

## Rules

- Do not add dependencies. The block is self-contained by design: one type-only import from `@puckeditor/core`, Tailwind v4 classes, no client JavaScript.
- Keep the files as-is unless the user asks for changes. The accent color is `indigo-*`; if the project has brand colors, offer to swap them with a find-and-replace on `indigo-`.
- Images are plain `imageUrl` + `imageAlt` text fields. If this project defines a P1 media-library field (search for `"p1-media"`), offer to switch to it.
- Don't change prop names in `defaultProps`. Content editors' saved pages depend on them.

## File: `components/puck/program-finder-block.tsx`

```tsx
import type { ComponentConfig } from "@puckeditor/core";

/**
 * Program Finder — a browsable grid of degrees and certificates, each card a single
 * link with its credential, school, format and length. Three across on desktop.
 * Register: `ProgramFinderBlock: programFinderBlock` in puck.config.tsx.
 */

type Heading = "h1" | "h2" | "h3" | "h4";

type Program = {
  name: string;
  degree: string;
  school: string;
  format: string;
  duration: string;
  href: string;
};

export type ProgramFinderProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  programs: Program[];
  allLabel: string;
  allHref: string;
};

const childHeading = { h1: "h2", h2: "h3", h3: "h4", h4: "h5" } as const;

export const programFinderBlock: ComponentConfig<ProgramFinderProps> = {
  label: "Program Finder",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "Small line above the heading. Leave blank to hide it." } },
    heading: { type: "text", label: "Heading" },
    headingLevel: {
      type: "select",
      label: "Heading level",
      options: [
        { label: "H1", value: "h1" },
        { label: "H2", value: "h2" },
        { label: "H3", value: "h3" },
        { label: "H4", value: "h4" },
      ],
      metadata: { help: "Sets the page outline for screen readers and search. The look doesn't change." },
    },
    intro: { type: "textarea", label: "Intro" },
    programs: {
      type: "array",
      label: "Programs",
      min: 1,
      max: 24,
      getItemSummary: (item) => [item?.degree, item?.name].filter(Boolean).join(" ") || "Program",
      defaultItemProps: {
        name: "New program",
        degree: "B.A.",
        school: "College of Arts and Sciences",
        format: "On campus",
        duration: "4 years",
        href: "/programs",
      },
      arrayFields: {
        name: { type: "text", label: "Program name" },
        degree: { type: "text", label: "Credential", metadata: { help: "Short form, such as B.S., M.A., Ph.D. or Certificate." } },
        school: { type: "text", label: "School or college" },
        format: { type: "text", label: "Format", metadata: { help: "How it's delivered, such as On campus · Online. Leave blank to hide it." } },
        duration: { type: "text", label: "Length", metadata: { help: "Such as 4 years or 12 months. Leave blank to hide it." } },
        href: { type: "text", label: "Link", metadata: { help: "The program's page. The whole card links here." } },
      },
    },
    allLabel: { type: "text", label: "All programs link text", metadata: { help: "Leave blank to hide it." } },
    allHref: { type: "text", label: "All programs link" },
  },
  defaultProps: {
    eyebrow: "Undergraduate and graduate",
    heading: "Find your program",
    headingLevel: "h2",
    intro: "More than 140 degrees and certificates across six colleges, with flexible formats for first-year students, transfers and working professionals.",
    programs: [
      {
        name: "Nursing",
        degree: "B.S.N.",
        school: "School of Nursing and Health Sciences",
        format: "On campus",
        duration: "4 years",
        href: "/programs/nursing-bsn",
      },
      {
        name: "Computer Science",
        degree: "B.S.",
        school: "College of Engineering and Computing",
        format: "On campus · Online",
        duration: "4 years",
        href: "/programs/computer-science-bs",
      },
      {
        name: "Public Administration",
        degree: "M.P.A.",
        school: "Harlan School of Public Affairs",
        format: "Online · Evening",
        duration: "2 years",
        href: "/programs/public-administration-mpa",
      },
      {
        name: "English and Creative Writing",
        degree: "B.A.",
        school: "College of Arts and Sciences",
        format: "On campus",
        duration: "4 years",
        href: "/programs/english-creative-writing-ba",
      },
      {
        name: "Data Analytics",
        degree: "Certificate",
        school: "School of Professional Studies",
        format: "Online",
        duration: "9 months",
        href: "/programs/data-analytics-certificate",
      },
      {
        name: "Environmental Science",
        degree: "M.S.",
        school: "College of Arts and Sciences",
        format: "On campus · Field research",
        duration: "2 years",
        href: "/programs/environmental-science-ms",
      },
    ],
    allLabel: "Browse all programs",
    allHref: "/programs",
  },
  render: ({ eyebrow, heading, headingLevel, intro, programs, allLabel, allHref }) => {
    const H = headingLevel || "h2";
    const Sub = childHeading[headingLevel] || "h3";
    const list = (programs ?? []).filter((p) => p?.name);
    const hasHeader = Boolean(eyebrow || heading || intro || allLabel);
    return (
      <section className="bg-white px-4 py-16 sm:px-6 sm:py-20 lg:px-8 lg:py-24">
        <div className="mx-auto max-w-7xl">
          {hasHeader ? (
            <div className="flex flex-col gap-6 border-b border-neutral-200 pb-10 lg:flex-row lg:items-end lg:justify-between lg:gap-16">
              <div className="max-w-2xl">
                {eyebrow ? <p className="text-sm font-semibold tracking-wide text-indigo-700 uppercase">{eyebrow}</p> : null}
                {heading ? (
                  <H className={`text-3xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-4xl lg:text-5xl ${eyebrow ? "mt-3" : ""}`}>{heading}</H>
                ) : null}
                {intro ? <p className="mt-5 text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
              </div>
              {allLabel ? (
                <a
                  href={allHref || "#"}
                  className="group inline-flex min-h-11 shrink-0 items-center gap-2 self-start rounded-lg px-1 text-base font-semibold text-indigo-700 hover:text-indigo-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 lg:self-auto"
                >
                  {allLabel}
                  <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 transition group-hover:translate-x-0.5">
                    <path fillRule="evenodd" d="M3 10a.75.75 0 0 1 .75-.75h10.64l-3.22-3.22a.75.75 0 1 1 1.06-1.06l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 1 1-1.06-1.06l3.22-3.22H3.75A.75.75 0 0 1 3 10Z" clipRule="evenodd" />
                  </svg>
                </a>
              ) : null}
            </div>
          ) : null}
          {list.length ? (
            <ul role="list" className={`grid gap-4 sm:grid-cols-2 sm:gap-6 lg:grid-cols-3 ${hasHeader ? "mt-10 sm:mt-12" : ""}`}>
              {list.map((program, i) => (
                <li
                  key={`${program.name}-${i}`}
                  className="group relative flex flex-col rounded-2xl bg-white p-6 ring-1 ring-neutral-200 transition motion-safe:hover:-translate-y-0.5 hover:shadow-lg hover:shadow-neutral-900/5 hover:ring-indigo-300 sm:p-7"
                >
                  <div className="flex items-start justify-between gap-4">
                    {program.degree ? (
                      <p className="inline-flex min-h-8 items-center rounded-md bg-indigo-50 px-2.5 text-sm font-semibold tracking-wide text-indigo-800 ring-1 ring-indigo-600/15 ring-inset">
                        {program.degree}
                      </p>
                    ) : (
                      <span />
                    )}
                    <span
                      aria-hidden="true"
                      className="grid size-9 shrink-0 place-items-center rounded-full bg-neutral-100 text-neutral-700 transition group-hover:bg-indigo-600 group-hover:text-white"
                    >
                      <svg viewBox="0 0 20 20" fill="currentColor" className="size-4">
                        <path fillRule="evenodd" d="M5.22 14.78a.75.75 0 0 0 1.06 0l7.22-7.22v5.69a.75.75 0 0 0 1.5 0v-7.5a.75.75 0 0 0-.75-.75h-7.5a.75.75 0 0 0 0 1.5h5.69l-7.22 7.22a.75.75 0 0 0 0 1.06Z" clipRule="evenodd" />
                      </svg>
                    </span>
                  </div>
                  <Sub className="mt-6 text-xl leading-7 font-semibold tracking-tight text-balance text-neutral-950">
                    <a
                      href={program.href || "#"}
                      className="after:absolute after:inset-0 after:rounded-2xl focus-visible:outline-none focus-visible:after:outline-2 focus-visible:after:outline-offset-2 focus-visible:after:outline-indigo-600"
                    >
                      {program.name}
                      {program.degree ? <span className="sr-only">, {program.degree}</span> : null}
                    </a>
                  </Sub>
                  {program.school ? <p className="mt-2 text-sm leading-6 text-neutral-600">{program.school}</p> : null}
                  {program.format || program.duration ? (
                    <div className="mt-auto pt-6">
                    <dl className="flex flex-wrap gap-x-5 gap-y-2 border-t border-neutral-100 pt-5 text-sm text-neutral-700">
                      {program.format ? (
                        <div className="flex items-center gap-1.5">
                          <dt>
                            <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-4 text-neutral-500">
                              <path fillRule="evenodd" d="m9.69 18.933.003.001C9.89 19.02 10 19 10 19s.11.02.308-.066l.002-.001.006-.003.018-.008a5.741 5.741 0 0 0 .281-.14c.186-.096.446-.24.757-.433.62-.384 1.445-.966 2.274-1.765C15.302 14.988 17 12.493 17 9A7 7 0 1 0 3 9c0 3.492 1.698 5.988 3.355 7.584a13.731 13.731 0 0 0 2.273 1.765 11.842 11.842 0 0 0 .976.544l.062.029.018.008.006.003ZM10 11.25a2.25 2.25 0 1 0 0-4.5 2.25 2.25 0 0 0 0 4.5Z" clipRule="evenodd" />
                            </svg>
                            <span className="sr-only">Format</span>
                          </dt>
                          <dd>{program.format}</dd>
                        </div>
                      ) : null}
                      {program.duration ? (
                        <div className="flex items-center gap-1.5">
                          <dt>
                            <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-4 text-neutral-500">
                              <path fillRule="evenodd" d="M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm.75-13a.75.75 0 0 0-1.5 0v5c0 .414.336.75.75.75h4a.75.75 0 0 0 0-1.5h-3.25V5Z" clipRule="evenodd" />
                            </svg>
                            <span className="sr-only">Length</span>
                          </dt>
                          <dd>{program.duration}</dd>
                        </div>
                      ) : null}
                    </dl>
                    </div>
                  ) : null}
                </li>
              ))}
            </ul>
          ) : null}
        </div>
      </section>
    );
  },
};
```
