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

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/footer-minimal) to this Pantheon Content Publisher (P1) Next.js project. One line: copyright, a few links, an optional note and a back-to-top link, in light or dark.

## Steps

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

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

/**
 * Footer (Minimal) — a single line: copyright, a few links, an optional note and a back-to-top link.
 * For landing pages, microsites and apps where the footer should stay out of the way.
 * Register: `FooterMinimalBlock: footerMinimalBlock` in puck.config.tsx.
 */

export type FooterMinimalProps = {
  copyright: string;
  navLabel: string;
  links: { label: string; href: string }[];
  note: string;
  backToTopLabel: string;
  tone: "light" | "dark";
};

const tones = {
  light: {
    root: "border-t border-neutral-200 bg-white",
    text: "text-neutral-600",
    link: "text-neutral-700 hover:text-indigo-700",
    top: "text-neutral-900 ring-neutral-300 hover:bg-neutral-50",
    ring: "focus-visible:outline-indigo-600",
    dot: "text-neutral-300",
  },
  dark: {
    root: "bg-neutral-950",
    text: "text-neutral-400",
    link: "text-neutral-300 hover:text-white",
    top: "text-white ring-white/25 hover:bg-white/10",
    ring: "focus-visible:outline-white",
    dot: "text-neutral-600",
  },
};

export const footerMinimalBlock: ComponentConfig<FooterMinimalProps> = {
  label: "Footer (Minimal)",
  fields: {
    copyright: { type: "text", label: "Copyright line", metadata: { help: "Like © 2026 Riverbend Summer Reading. Leave blank to hide it." } },
    navLabel: { type: "text", label: "Navigation name", metadata: { help: "Read by screen readers, like Footer." } },
    links: {
      type: "array",
      label: "Links",
      min: 0,
      max: 5,
      getItemSummary: (item) => item?.label || "Link",
      defaultItemProps: { label: "New link", href: "/" },
      arrayFields: {
        label: { type: "text", label: "Label" },
        href: { type: "text", label: "Link" },
      },
    },
    note: { type: "text", label: "Note", metadata: { help: "A short aside, like a funding credit. Leave blank to hide it." } },
    backToTopLabel: { type: "text", label: "Back-to-top text", metadata: { help: "Links to the top of the page. Leave blank to hide it." } },
    tone: {
      type: "radio",
      label: "Tone",
      options: [
        { label: "Light", value: "light" },
        { label: "Dark", value: "dark" },
      ],
    },
  },
  defaultProps: {
    copyright: "© 2026 Riverbend Public Library",
    navLabel: "Footer",
    links: [
      { label: "Accessibility", href: "/accessibility" },
      { label: "Privacy", href: "/privacy" },
      { label: "Contact", href: "/contact" },
    ],
    note: "Summer Reading is funded in part by the Friends of the Library.",
    backToTopLabel: "Back to top",
    tone: "light",
  },
  render: ({ copyright, navLabel, links, note, backToTopLabel, tone }) => {
    const t = tones[tone] ?? tones.light;
    const items = (links ?? []).filter((l) => l?.label);
    if (!copyright && !items.length && !note && !backToTopLabel) return <></>;
    const ring = `focus-visible:outline-2 focus-visible:outline-offset-2 ${t.ring}`;

    return (
      <footer className={`px-4 py-4 sm:px-6 lg:px-8 ${t.root}`}>
        <div className="mx-auto flex max-w-7xl flex-col gap-x-6 gap-y-2 text-sm md:flex-row md:items-center">
          <div className="flex min-w-0 flex-1 flex-col gap-x-6 gap-y-1 sm:flex-row sm:flex-wrap sm:items-center">
            {copyright ? <p className={`py-2.5 ${t.text}`}>{copyright}</p> : null}
            {items.length ? (
              <nav aria-label={navLabel || "Footer"}>
                <ul role="list" className="-mx-2 flex flex-wrap items-center">
                  {items.map((l, i) => (
                    <li key={`${l.label}-${i}`} className="flex items-center">
                      {i > 0 ? (
                        <span aria-hidden="true" className={t.dot}>
                          ·
                        </span>
                      ) : null}
                      <a href={l.href || "#"} className={`inline-flex min-h-11 items-center rounded px-2 font-medium transition ${t.link} ${ring}`}>
                        {l.label}
                      </a>
                    </li>
                  ))}
                </ul>
              </nav>
            ) : null}
            {note ? <p className={`py-2.5 text-pretty md:ml-auto ${t.text}`}>{note}</p> : null}
          </div>
          {backToTopLabel ? (
            <a
              href="#top"
              className={`group inline-flex min-h-11 shrink-0 items-center gap-1.5 self-start rounded-full px-4 font-semibold ring-1 ring-inset transition md:self-auto ${t.top} ${ring}`}
            >
              {backToTopLabel}
              <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-4 transition group-hover:-translate-y-0.5 motion-reduce:transform-none">
                <path fillRule="evenodd" d="M10 17a.75.75 0 0 1-.75-.75V5.612L5.29 9.77a.75.75 0 0 1-1.08-1.04l5.25-5.5a.75.75 0 0 1 1.08 0l5.25 5.5a.75.75 0 1 1-1.08 1.04l-3.96-4.158V16.25A.75.75 0 0 1 10 17Z" clipRule="evenodd" />
              </svg>
            </a>
          ) : null}
        </div>
      </footer>
    );
  },
};
```
