# Add the "Donor Wall" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/donor-wall) to this Pantheon Content Publisher (P1) Next.js project. Donor names grouped by giving tier in flowing columns, with gift ranges and an anonymous donor count.

## Steps

1. Create `components/puck/donor-wall-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 { donorWallBlock } from "./components/puck/donor-wall-block";`
3. Register it under `components` as `DonorWallBlock: donorWallBlock`.
4. Add `"DonorWallBlock"` to the best-fitting entry in `categories` (this block's library category is "Social proof"). 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/donor-wall-block.tsx`

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

/**
 * Donor Wall — supporter names grouped by giving tier, in flowing columns, with tier
 * headings, gift ranges and a count of donors who asked to stay anonymous.
 * Register: `DonorWallBlock: donorWallBlock` in puck.config.tsx.
 */

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

type Tier = { name: string; range: string; donors: string };

export type DonorWallProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  tiers: Tier[];
  anonymousCount: string;
  period: string;
  correctionsText: string;
  correctionsHref: string;
};

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

const names = (raw?: string) =>
  (raw || "")
    .split(/\n/)
    .map((n) => n.trim())
    .filter(Boolean);

const nameSize = (i: number) => {
  if (i === 0) return "font-serif text-xl leading-snug text-neutral-950";
  if (i === 1) return "font-serif text-lg leading-snug text-neutral-950";
  return "text-base leading-7 text-neutral-800";
};

const columns = (i: number) => {
  if (i === 0) return "columns-1 sm:columns-2";
  return "columns-1 sm:columns-2 xl:columns-3";
};

export const donorWallBlock: ComponentConfig<DonorWallProps> = {
  label: "Donor Wall",
  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", metadata: { help: "Optional sentence under the heading. Leave blank to hide it." } },
    tiers: {
      type: "array",
      label: "Giving tiers",
      min: 1,
      max: 10,
      getItemSummary: (item) => {
        const count = names(item?.donors).length;
        return [item?.name, count ? `${count} ${count === 1 ? "name" : "names"}` : ""].filter(Boolean).join(" · ").slice(0, 48) || "Tier";
      },
      defaultItemProps: { name: "Tier name", range: "", donors: "" },
      arrayFields: {
        name: { type: "text", label: "Tier name", metadata: { help: "List tiers from largest to smallest. The first two get larger type." } },
        range: { type: "text", label: "Gift range", metadata: { help: "Such as \"$10,000 and above\". Leave blank to hide it." } },
        donors: { type: "textarea", label: "Names", metadata: { help: "One donor per line, exactly as they asked to be listed." } },
      },
    },
    anonymousCount: {
      type: "text",
      label: "Anonymous donors",
      metadata: { help: "How many donors asked not to be named. Shown as a closing line. Leave blank to hide it." },
    },
    period: { type: "text", label: "Giving period", metadata: { help: "Such as \"Gifts received July 1, 2024 – June 30, 2025\"." } },
    correctionsText: { type: "text", label: "Corrections text", metadata: { help: "Such as \"See a mistake? Let us know.\" Leave blank to hide it." } },
    correctionsHref: { type: "text", label: "Corrections link", metadata: { help: "An email (mailto:) or contact page link." } },
  },
  defaultProps: {
    eyebrow: "Honor roll",
    heading: "Thank you to the people who keep the lights on",
    headingLevel: "h2",
    intro: "Every name here helped a neighbor find a warm meal, a ride to an appointment or a quiet place to study this year.",
    period: "Gifts received July 1, 2024 – June 30, 2025",
    anonymousCount: "47",
    correctionsText: "See a mistake in your listing? Let us know.",
    correctionsHref: "mailto:giving@example.org",
    tiers: [
      {
        name: "Cornerstone Circle",
        range: "$10,000 and above",
        donors: "The Alvarez–Brennan Family\nHollis Family Trust\nRiverbend Community Foundation\nDrs. Naomi and Peter Szabo",
      },
      {
        name: "Builders",
        range: "$2,500 – $9,999",
        donors: "Grace and Tomás Ibarra\nCedar Valley Credit Union\nThe Okonkwo Family\nMargaret Lindqvist\nNorthside Rotary Club\nDavid and Ellen Fairbanks",
      },
      {
        name: "Neighbors",
        range: "$500 – $2,499",
        donors:
          "Ruth Abernathy\nJames and Kim Bae\nThe Castellano Family\nLena Dubois\nHarold Eng\nPriya and Sam Fernandes\nMaya Goldberg\nThe Hartwell Family\nOmar Jaffe\nBeth Kaminski\nLuis Moreno\nNora Patel\nThe Quist Family\nElla Rasmussen",
      },
      {
        name: "Friends",
        range: "Up to $499",
        donors:
          "Ada Barnes\nCarlos Benítez\nJune Carter-Hale\nMichael Dunn\nSofia Esposito\nFrank and Lou Gibbs\nHana Ito\nMarcus Jefferson\nRebecca Klein\nTheo Lam\nIris Montgomery\nKwame Owusu\nSara Petrov\nWill Reyes\nDana Stokes\nVictor Tran\nGwen Underwood\nAlba Vega\nRosa Whitfield\nYusuf Zaman",
      },
    ],
  },
  render: ({ id, eyebrow, heading, headingLevel, intro, tiers, anonymousCount, period, correctionsText, correctionsHref }) => {
    const H = headingLevel || "h2";
    const Sub = subLevel[headingLevel || "h2"];
    const list = (tiers ?? []).filter((t) => t?.name || names(t?.donors).length);
    const anon = parseInt(String(anonymousCount ?? "").replace(/[^0-9]/g, ""), 10);
    const hasAnon = Number.isFinite(anon) && anon > 0;
    const hasHeader = Boolean(eyebrow || heading || intro || period);

    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 grid max-w-7xl grid-cols-1 gap-12 lg:grid-cols-12 lg:gap-16">
          {hasHeader ? (
            <div className="lg:col-span-4">
              <div className="lg:sticky lg:top-8">
                {eyebrow ? <p className="text-sm font-semibold tracking-wide text-indigo-700 uppercase">{eyebrow}</p> : null}
                {heading ? <H className={`${eyebrow ? "mt-3" : ""} text-3xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-4xl`}>{heading}</H> : null}
                {intro ? <p className="mt-4 text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
                {period ? <p className="mt-6 text-sm font-medium text-neutral-800">{period}</p> : null}
                {correctionsText ? (
                  correctionsHref ? (
                    <p className="mt-2 text-sm">
                      <a
                        href={correctionsHref}
                        className="inline-flex min-h-11 items-center rounded-sm font-medium text-indigo-700 underline decoration-indigo-300 underline-offset-4 hover:decoration-indigo-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                      >
                        {correctionsText}
                      </a>
                    </p>
                  ) : (
                    <p className="mt-2 text-sm text-neutral-600">{correctionsText}</p>
                  )
                ) : null}
              </div>
            </div>
          ) : null}

          <div className={hasHeader ? "lg:col-span-8" : "lg:col-span-12"}>
            {list.map((tier, i) => {
              const donors = names(tier.donors);
              const headingId = `${id || "donor-wall"}-tier-${i}`;
              return (
                <div key={`${tier.name}-${i}`} className={`${i > 0 ? "mt-12 sm:mt-14" : ""} border-t-2 ${i === 0 ? "border-indigo-600" : "border-neutral-950"} pt-5`}>
                  <div className="flex flex-col gap-1 sm:flex-row sm:items-baseline sm:justify-between sm:gap-6">
                    {tier.name ? (
                      <Sub id={headingId} className="text-lg font-semibold text-neutral-950">
                        {tier.name}
                      </Sub>
                    ) : null}
                    {tier.range || donors.length ? (
                      <p className="text-sm text-neutral-600 tabular-nums">
                        {tier.range}
                        {tier.range && donors.length ? " · " : ""}
                        {donors.length ? `${donors.length} ${donors.length === 1 ? "donor" : "donors"}` : ""}
                      </p>
                    ) : null}
                  </div>
                  {donors.length ? (
                    <ul role="list" aria-labelledby={tier.name ? headingId : undefined} className={`mt-6 gap-x-10 ${columns(i)}`}>
                      {donors.map((d, j) => (
                        <li key={`${d}-${j}`} className={`break-inside-avoid py-1 break-words ${nameSize(i)}`}>
                          {d}
                        </li>
                      ))}
                    </ul>
                  ) : null}
                </div>
              );
            })}

            {hasAnon ? (
              <p className="mt-12 flex items-center gap-3 rounded-xl bg-neutral-50 px-5 py-4 text-base text-neutral-800 ring-1 ring-neutral-950/5">
                <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 shrink-0 text-indigo-600">
                  <path d="M10 17.5s-6.5-3.9-6.5-8.6A3.6 3.6 0 0 1 10 6.6a3.6 3.6 0 0 1 6.5 2.3c0 4.7-6.5 8.6-6.5 8.6Z" />
                </svg>
                <span>
                  And <span className="font-semibold tabular-nums">{anon.toLocaleString("en-US")}</span> {anon === 1 ? "donor who" : "donors who"} asked to give
                  without being named.
                </span>
              </p>
            ) : null}
          </div>
        </div>
      </section>
    );
  },
};
```
