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

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/footer-statement) to this Pantheon Content Publisher (P1) Next.js project. Brand-forward footer with a serif statement, one call to action, compact links and contact, and an oversized wordmark across the bottom.

## Steps

1. Create `components/puck/footer-statement-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 { footerStatementBlock } from "./components/puck/footer-statement-block";`
3. Register it under `components` as `FooterStatementBlock: footerStatementBlock`.
4. Add `"FooterStatementBlock"` 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-statement-block.tsx`

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

/**
 * Footer (Statement) — a brand-forward footer: one serif statement with a highlighted phrase,
 * a call to action, compact links and contact, and an oversized wordmark set across the bottom.
 * Wrap a phrase in *asterisks* to highlight it. Register: `FooterStatementBlock: footerStatementBlock` in puck.config.tsx.
 */

export type FooterStatementProps = {
  statement: string;
  ctaLabel: string;
  ctaHref: string;
  navLabel: string;
  links: { label: string; href: string }[];
  contactLines: string;
  email: string;
  socials: { label: string; href: string }[];
  wordmark: string;
  copyright: string;
};

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

function accent(text: string) {
  return text.split(/(\*[^*]+\*)/g).map((part, i) =>
    part.length > 2 && part.startsWith("*") && part.endsWith("*") ? (
      <em key={i} className="text-indigo-700 italic">
        {part.slice(1, -1)}
      </em>
    ) : (
      part
    ),
  );
}

const linkArray = {
  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 footerStatementBlock: ComponentConfig<FooterStatementProps> = {
  label: "Footer (Statement)",
  fields: {
    statement: {
      type: "textarea",
      label: "Statement",
      metadata: { help: "One sentence, under about 16 words. Wrap one phrase in *asterisks* to set it in the accent color." },
    },
    ctaLabel: { type: "text", label: "Link text", metadata: { help: "A single call to action beside the statement. Leave blank to hide it." } },
    ctaHref: { type: "text", label: "Link" },
    navLabel: { type: "text", label: "Navigation name", metadata: { help: "Read by screen readers, like Footer." } },
    links: { ...linkArray, label: "Links", min: 0, max: 8 },
    contactLines: { type: "textarea", label: "Address", metadata: { help: "One line per row. Leave blank to hide it." } },
    email: { type: "text", label: "Email" },
    socials: { ...linkArray, label: "Social links", min: 0, max: 5, metadata: { help: "Text links, like Instagram. Spelled out, they need no icons." } },
    wordmark: { type: "text", label: "Wordmark", metadata: { help: "Set huge across the bottom. One or two short words work best." } },
    copyright: { type: "text", label: "Copyright line", metadata: { help: "Like © 2026 Cedar Hollow Foundation. Leave blank to hide it." } },
  },
  defaultProps: {
    statement: "Since 1962 we have funded the *patient, unglamorous work* that keeps a river town whole.",
    ctaLabel: "Apply for a grant",
    ctaHref: "/grants",
    navLabel: "Footer",
    links: [
      { label: "Grants", href: "/grants" },
      { label: "Funds", href: "/funds" },
      { label: "Give", href: "/give" },
      { label: "Annual report", href: "/report" },
      { label: "Board & staff", href: "/people" },
      { label: "Contact", href: "/contact" },
    ],
    contactLines: "412 Front Street\nMarietta, OH 45750",
    email: "grants@cedarhollow.org",
    socials: [
      { label: "Instagram", href: "https://instagram.com/" },
      { label: "LinkedIn", href: "https://linkedin.com/" },
    ],
    wordmark: "Cedar Hollow",
    copyright: "© 2026 Cedar Hollow Foundation",
  },
  render: ({ statement, ctaLabel, ctaHref, navLabel, links, contactLines, email, socials, wordmark, copyright }) => {
    const items = (links ?? []).filter((l) => l?.label);
    const social = (socials ?? []).filter((s) => s?.label);
    const lines = (contactLines || "").split("\n").map((l) => l.trim()).filter(Boolean);
    const mail = (email || "").trim();
    const hasMiddle = items.length > 0 || lines.length > 0 || Boolean(mail) || social.length > 0;

    return (
      <footer className="overflow-hidden bg-neutral-100 px-4 pt-16 pb-6 sm:px-6 sm:pt-24 lg:px-8">
        <div className="mx-auto max-w-7xl">
          {statement || ctaLabel ? (
            <div className="flex flex-col gap-8 lg:flex-row lg:items-end lg:justify-between lg:gap-16">
              {statement ? (
                <p className="max-w-4xl font-serif text-3xl leading-tight tracking-tight text-balance text-neutral-950 sm:text-4xl lg:text-5xl">{accent(statement)}</p>
              ) : null}
              {ctaLabel ? (
                <a
                  href={ctaHref || "#"}
                  className={`group inline-flex min-h-12 shrink-0 items-center gap-3 self-start rounded-full border border-neutral-950 px-6 text-base font-semibold text-neutral-950 transition hover:bg-neutral-950 hover:text-white lg:self-auto ${focusRing}`}
                >
                  {ctaLabel}
                  <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 transition group-hover:translate-x-1 motion-reduce:transform-none">
                    <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}

          {hasMiddle ? (
            <div className={`grid grid-cols-1 gap-10 border-t border-neutral-300 pt-10 sm:grid-cols-2 lg:grid-cols-12 lg:gap-8 ${statement || ctaLabel ? "mt-14 sm:mt-20" : ""}`}>
              {items.length ? (
                <nav aria-label={navLabel || "Footer"} className="sm:col-span-2 lg:col-span-6">
                  <ul role="list" className="grid grid-cols-2 gap-x-8">
                    {items.map((l, i) => (
                      <li key={`${l.label}-${i}`}>
                        <a href={l.href || "#"} className={`inline-flex min-h-11 items-center rounded text-base font-medium text-neutral-800 underline-offset-4 hover:text-indigo-700 hover:underline ${focusRing}`}>
                          {l.label}
                        </a>
                      </li>
                    ))}
                  </ul>
                </nav>
              ) : null}
              {lines.length || mail ? (
                <div className="text-sm leading-6 text-neutral-700 lg:col-span-3">
                  {lines.length ? (
                    <address className="not-italic">
                      {lines.map((line, i) => (
                        <span key={i} className="block">
                          {line}
                        </span>
                      ))}
                    </address>
                  ) : null}
                  {mail ? (
                    <a href={`mailto:${mail}`} className={`mt-1 inline-flex min-h-11 items-center rounded break-all text-neutral-950 underline decoration-neutral-400 underline-offset-4 hover:decoration-indigo-700 ${focusRing}`}>
                      {mail}
                    </a>
                  ) : null}
                </div>
              ) : null}
              {social.length ? (
                <ul role="list" aria-label="Social media" className="text-sm lg:col-span-3 lg:text-right">
                  {social.map((s, i) => (
                    <li key={`${s.label}-${i}`}>
                      <a href={s.href || "#"} className={`group inline-flex min-h-11 items-center gap-1.5 rounded font-medium text-neutral-800 hover:text-indigo-700 ${focusRing}`}>
                        {s.label}
                        <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-4 text-neutral-500 transition group-hover:-translate-y-0.5 group-hover:translate-x-0.5 group-hover:text-indigo-700 motion-reduce:transform-none">
                          <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>
                      </a>
                    </li>
                  ))}
                </ul>
              ) : null}
            </div>
          ) : null}

          {wordmark ? (
            <p aria-hidden="true" className="mt-16 font-serif text-6xl leading-none font-medium tracking-tighter break-words text-neutral-950 select-none sm:mt-24 sm:text-8xl lg:text-9xl">
              {wordmark}
            </p>
          ) : null}

          {copyright ? <p className={`${wordmark ? "mt-6" : "mt-12"} text-xs text-neutral-600`}>{copyright}</p> : null}
        </div>
      </footer>
    );
  },
};
```
