# Add the "Footer — Nonprofit" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/footer-nonprofit) to this Pantheon Content Publisher (P1) Next.js project. Opens with a donate appeal, then mission, contact and link groups, and closes with the tax-status line, EIN and registration disclosure.

## Steps

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

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

/**
 * Footer (Nonprofit) — opens with a donate appeal, then mission, contact and link groups,
 * and closes with the tax-status line (EIN) and any state charity-registration disclosure.
 * Register: `FooterNonprofitBlock: footerNonprofitBlock` in puck.config.tsx.
 */

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

export type FooterNonprofitProps = {
  appealHeading: string;
  headingLevel: Heading;
  appealBody: string;
  donateLabel: string;
  donateHref: string;
  otherWaysLabel: string;
  otherWaysHref: string;
  orgName: string;
  mission: string;
  address: string;
  phone: string;
  email: string;
  navLabel: string;
  groups: { label: string; links: { label: string; href: string }[] }[];
  taxStatus: string;
  ein: string;
  disclosure: string;
  copyrightYear: string;
  legalLinks: { label: string; href: string }[];
};

const focusRing = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600";
const focusRingLight = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white";

const links = {
  type: "array" as const,
  getItemSummary: (item: { label?: string }) => item?.label || "Link",
  defaultItemProps: { label: "New link", href: "/" },
  arrayFields: {
    label: { type: "text" as const, label: "Label" },
    href: { type: "text" as const, label: "Link" },
  },
};

export const footerNonprofitBlock: ComponentConfig<FooterNonprofitProps> = {
  label: "Footer (Nonprofit)",
  fields: {
    appealHeading: { type: "textarea", label: "Appeal heading", metadata: { help: "The donate panel's headline. Leave blank, with the button, to hide the panel." } },
    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." },
    },
    appealBody: { type: "textarea", label: "Appeal text", metadata: { help: "What a gift does, in one or two sentences." } },
    donateLabel: { type: "text", label: "Donate button text" },
    donateHref: { type: "text", label: "Donate button link" },
    otherWaysLabel: { type: "text", label: "Secondary link text", metadata: { help: "Like Other ways to give. Leave blank to hide it." } },
    otherWaysHref: { type: "text", label: "Secondary link" },
    orgName: { type: "text", label: "Organization name" },
    mission: { type: "textarea", label: "Mission", metadata: { help: "One or two sentences. Leave blank to hide it." } },
    address: { type: "textarea", label: "Mailing address", metadata: { help: "One line per row. Many donors mail checks, so include it." } },
    phone: { type: "text", label: "Phone", metadata: { help: "Shown as typed. The tap-to-call link is built from the digits." } },
    email: { type: "text", label: "Email" },
    navLabel: { type: "text", label: "Navigation name", metadata: { help: "Read by screen readers, like Footer." } },
    groups: {
      type: "array",
      label: "Link groups",
      min: 0,
      max: 3,
      getItemSummary: (item) => item?.label || "Group",
      defaultItemProps: { label: "New group", links: [{ label: "New link", href: "/" }] },
      arrayFields: {
        label: { type: "text", label: "Group label" },
        links: { ...links, label: "Links", min: 1, max: 8 },
      },
    },
    taxStatus: {
      type: "textarea",
      label: "Tax status",
      metadata: { help: "Your legal status line, like a 501(c)(3) statement. Have your finance lead confirm the wording." },
    },
    ein: { type: "text", label: "EIN", metadata: { help: "Your Employer Identification Number, so donors and employers can verify you. Leave blank to hide it." } },
    disclosure: {
      type: "textarea",
      label: "Registration disclosure",
      metadata: { help: "Some states require a charitable-solicitation disclosure. Paste the exact text your counsel approved. Leave blank to hide it." },
    },
    copyrightYear: { type: "text", label: "Copyright year", metadata: { help: "Like 2026. Update it each January." } },
    legalLinks: { ...links, label: "Legal links", min: 0, max: 5 },
  },
  defaultProps: {
    appealHeading: "Tonight, 46 families will sleep somewhere safe.",
    headingLevel: "h2",
    appealBody: "A monthly gift of $35 covers one night of emergency shelter, meals and a caseworker in the morning.",
    donateLabel: "Give monthly",
    donateHref: "/donate?frequency=monthly",
    otherWaysLabel: "Other ways to give",
    otherWaysHref: "/give",
    orgName: "Safe Harbor House",
    mission: "We provide emergency shelter, legal advocacy and a path to stable housing for survivors of domestic violence across the Ohio Valley.",
    address: "Safe Harbor House\nPO Box 4410\nLouisville, KY 40204",
    phone: "(502) 555-0172",
    email: "giving@safeharborhouse.org",
    navLabel: "Footer",
    groups: [
      {
        label: "Get help",
        links: [
          { label: "24-hour crisis line", href: "/help/crisis" },
          { label: "Emergency shelter", href: "/help/shelter" },
          { label: "Legal advocacy", href: "/help/legal" },
          { label: "Safety planning", href: "/help/safety" },
        ],
      },
      {
        label: "Support us",
        links: [
          { label: "Donate", href: "/donate" },
          { label: "Volunteer", href: "/volunteer" },
          { label: "Wish list", href: "/wish-list" },
          { label: "Financials & 990s", href: "/financials" },
        ],
      },
    ],
    taxStatus: "Safe Harbor House is a registered 501(c)(3) nonprofit. Gifts are tax-deductible to the extent allowed by law.",
    ein: "12-3456789",
    disclosure: "",
    copyrightYear: "2026",
    legalLinks: [
      { label: "Privacy", href: "/privacy" },
      { label: "Donor privacy", href: "/donor-privacy" },
      { label: "Accessibility", href: "/accessibility" },
    ],
  },
  render: ({ id, appealHeading, headingLevel, appealBody, donateLabel, donateHref, otherWaysLabel, otherWaysHref, orgName, mission, address, phone, email, navLabel, groups, taxStatus, ein, disclosure, copyrightYear, legalLinks }) => {
    const H = headingLevel || "h2";
    const uid = `footer-np-${id}`;
    const lines = (address || "").split("\n").map((l) => l.trim()).filter(Boolean);
    const tel = (phone || "").replace(/[^\d+]/g, "");
    const mail = (email || "").trim();
    const cols = (groups ?? []).filter((g) => g?.label || (g?.links ?? []).some((l) => l?.label));
    const legal = (legalLinks ?? []).filter((l) => l?.label);
    const hasAppeal = Boolean(appealHeading || donateLabel);
    const hasAbout = Boolean(orgName || mission || lines.length || phone || mail);
    const hasTrust = Boolean(taxStatus || ein || disclosure);

    return (
      <footer className="bg-white px-4 pt-12 pb-8 sm:px-6 sm:pt-16 lg:px-8">
        <div className="mx-auto max-w-7xl">
          {hasAppeal ? (
            <div className="relative isolate overflow-hidden rounded-3xl bg-indigo-700 px-6 py-10 sm:px-10 sm:py-12 lg:flex lg:items-center lg:justify-between lg:gap-12 lg:px-14">
              <svg aria-hidden="true" viewBox="0 0 200 200" fill="currentColor" className="absolute -right-10 -bottom-16 -z-10 size-72 text-white/10 sm:size-96">
                <path d="M100 176s-72-42-72-96a40 40 0 0 1 72-24 40 40 0 0 1 72 24c0 54-72 96-72 96Z" />
              </svg>
              <div className="max-w-2xl">
                {appealHeading ? <H className="text-2xl leading-tight font-semibold tracking-tight text-balance text-white sm:text-3xl">{appealHeading}</H> : null}
                {appealBody ? <p className={`${appealHeading ? "mt-3" : ""} text-base leading-7 text-pretty text-indigo-100`}>{appealBody}</p> : null}
              </div>
              {donateLabel || otherWaysLabel ? (
                <div className="mt-8 flex flex-col gap-3 sm:flex-row sm:items-center lg:mt-0 lg:shrink-0 lg:flex-col lg:items-stretch">
                  {donateLabel ? (
                    <a
                      href={donateHref || "#"}
                      className={`inline-flex min-h-12 items-center justify-center gap-2 rounded-full bg-white px-7 text-base font-bold text-indigo-800 shadow-lg shadow-indigo-950/30 transition hover:bg-indigo-50 ${focusRingLight}`}
                    >
                      <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 text-indigo-600">
                        <path d="m9.653 16.915-.005-.003-.019-.01a20.759 20.759 0 0 1-1.162-.682 22.045 22.045 0 0 1-2.582-1.9C4.045 12.733 2 10.352 2 7.5a4.5 4.5 0 0 1 8-2.828A4.5 4.5 0 0 1 18 7.5c0 2.852-2.044 5.233-3.885 6.82a22.049 22.049 0 0 1-3.744 2.582l-.019.01-.005.003h-.002a.739.739 0 0 1-.69.001l-.002-.001Z" />
                      </svg>
                      {donateLabel}
                    </a>
                  ) : null}
                  {otherWaysLabel ? (
                    <a href={otherWaysHref || "#"} className={`inline-flex min-h-11 items-center justify-center rounded-full px-4 text-sm font-semibold text-white underline decoration-white/50 underline-offset-4 hover:decoration-white ${focusRingLight}`}>
                      {otherWaysLabel}
                    </a>
                  ) : null}
                </div>
              ) : null}
            </div>
          ) : null}

          {hasAbout || cols.length ? (
            <div className={`grid grid-cols-1 gap-12 lg:grid-cols-12 lg:gap-8 ${hasAppeal ? "mt-14 sm:mt-16" : ""}`}>
              {hasAbout ? (
                <div className="lg:col-span-5">
                  {orgName ? <p className="text-lg font-semibold tracking-tight text-neutral-950">{orgName}</p> : null}
                  {mission ? <p className="mt-3 max-w-md text-sm leading-6 text-pretty text-neutral-600">{mission}</p> : null}
                  {lines.length || phone || mail ? (
                    <div className="mt-6 grid grid-cols-1 gap-6 text-sm leading-6 sm:grid-cols-2">
                      {lines.length ? (
                        <address className="text-neutral-700 not-italic">
                          {lines.map((line, i) => (
                            <span key={i} className="block">
                              {line}
                            </span>
                          ))}
                        </address>
                      ) : null}
                      {phone || mail ? (
                        <ul role="list">
                          {phone ? (
                            <li>
                              <a href={tel ? `tel:${tel}` : "#"} className={`inline-flex min-h-11 items-center rounded font-medium text-neutral-900 tabular-nums hover:text-indigo-700 ${focusRing}`}>
                                {phone}
                              </a>
                            </li>
                          ) : null}
                          {mail ? (
                            <li>
                              <a href={`mailto:${mail}`} className={`inline-flex min-h-11 items-center rounded font-medium break-all text-neutral-900 hover:text-indigo-700 ${focusRing}`}>
                                {mail}
                              </a>
                            </li>
                          ) : null}
                        </ul>
                      ) : null}
                    </div>
                  ) : null}
                </div>
              ) : null}

              {cols.length ? (
                <nav aria-label={navLabel || "Footer"} className={`grid grid-cols-1 gap-10 ${cols.length >= 3 ? "sm:grid-cols-3" : cols.length === 2 ? "sm:grid-cols-2" : ""} ${hasAbout ? "lg:col-span-7" : "lg:col-span-12"}`}>
                  {cols.map((g, i) => {
                    const gid = `${uid}-g${i}`;
                    return (
                      <div key={`${g.label}-${i}`}>
                        {g.label ? (
                          <p id={gid} className="text-sm font-semibold text-neutral-950">
                            {g.label}
                          </p>
                        ) : null}
                        <ul role="list" aria-labelledby={g.label ? gid : undefined} className={g.label ? "mt-2" : ""}>
                          {(g.links ?? [])
                            .filter((l) => l?.label)
                            .map((l, j) => (
                              <li key={`${l.label}-${j}`}>
                                <a href={l.href || "#"} className={`inline-flex min-h-11 items-center rounded text-sm text-neutral-600 transition hover:text-indigo-700 ${focusRing}`}>
                                  {l.label}
                                </a>
                              </li>
                            ))}
                        </ul>
                      </div>
                    );
                  })}
                </nav>
              ) : null}
            </div>
          ) : null}

          {hasTrust ? (
            <div className="mt-12 flex flex-col gap-3 rounded-2xl bg-neutral-50 p-5 ring-1 ring-neutral-200 sm:flex-row sm:items-start sm:gap-5 sm:p-6">
              <svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" className="size-7 shrink-0 text-indigo-700">
                <path d="M12 3 4.5 6v5.5c0 4.5 3.2 8.4 7.5 9.5 4.3-1.1 7.5-5 7.5-9.5V6L12 3Z" strokeLinejoin="round" />
                <path d="m8.75 12 2.25 2.25 4.25-4.5" strokeLinecap="round" strokeLinejoin="round" />
              </svg>
              <div className="min-w-0 text-sm leading-6 text-neutral-700">
                {taxStatus || ein ? (
                  <p>
                    {taxStatus}
                    {ein ? (
                      <>
                        {taxStatus ? " " : ""}
                        <span className="font-semibold whitespace-nowrap text-neutral-950">
                          EIN <span className="tabular-nums">{ein}</span>
                        </span>
                      </>
                    ) : null}
                  </p>
                ) : null}
                {disclosure ? <p className={`${taxStatus || ein ? "mt-2" : ""} text-xs leading-5 text-pretty text-neutral-600`}>{disclosure}</p> : null}
              </div>
            </div>
          ) : null}

          {orgName || copyrightYear || legal.length ? (
            <div className="mt-8 flex flex-col gap-2 border-t border-neutral-200 pt-6 sm:flex-row sm:items-center sm:justify-between">
              {orgName || copyrightYear ? (
                <p className="text-sm text-neutral-600">
                  © {copyrightYear ? `${copyrightYear} ` : ""}
                  {orgName}
                </p>
              ) : null}
              {legal.length ? (
                <ul role="list" aria-label="Legal" className="-mx-2 flex flex-wrap">
                  {legal.map((l, i) => (
                    <li key={`${l.label}-${i}`}>
                      <a href={l.href || "#"} className={`inline-flex min-h-11 items-center rounded px-2 text-sm text-neutral-600 hover:text-indigo-700 ${focusRing}`}>
                        {l.label}
                      </a>
                    </li>
                  ))}
                </ul>
              ) : null}
            </div>
          ) : null}
        </div>
      </footer>
    );
  },
};
```
