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

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/footer-civic) to this Pantheon Content Publisher (P1) Next.js project. Seal and agency name, emergency line, address, office hours, phone and email, service links, social links and required policy links.

## Steps

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

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

/**
 * Footer (Government) — seal and agency name, an emergency line, address, office hours,
 * phone and email, service link groups, social links and the required policy links
 * (accessibility, privacy, public records). Register: `FooterCivicBlock: footerCivicBlock` in puck.config.tsx.
 */

type Platform = "facebook" | "instagram" | "x" | "linkedin" | "youtube" | "other";

export type FooterCivicProps = {
  sealImageUrl: string;
  sealImageAlt: string;
  agencyName: string;
  agencySubtitle: string;
  emergencyNote: string;
  visitLabel: string;
  address: string;
  directionsLabel: string;
  directionsHref: string;
  hours: { days: string; time: string }[];
  contactLabel: string;
  phone: string;
  phoneNote: string;
  email: string;
  navLabel: string;
  groups: { label: string; links: { label: string; href: string }[] }[];
  socials: { platform: Platform; label: string; href: string }[];
  policyLinks: { label: string; href: string }[];
  copyrightLine: string;
  lastUpdated: string;
};

const platformNames: Record<Platform, string> = {
  facebook: "Facebook",
  instagram: "Instagram",
  x: "X",
  linkedin: "LinkedIn",
  youtube: "YouTube",
  other: "Website",
};

function SocialIcon({ platform }: { platform: Platform }) {
  const cls = "size-5";
  switch (platform) {
    case "facebook":
      return (
        <svg aria-hidden="true" viewBox="0 0 24 24" fill="currentColor" className={cls}>
          <path d="M14.5 8H13a1 1 0 0 0-1 1v2h2.5l-.4 3H12v7H9v-7H7v-3h2V8.6A3.6 3.6 0 0 1 12.6 5h1.9v3Z" />
        </svg>
      );
    case "instagram":
      return (
        <svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" className={cls}>
          <rect x="3.5" y="3.5" width="17" height="17" rx="5" />
          <circle cx="12" cy="12" r="3.75" />
          <circle cx="17.25" cy="6.75" r="1" fill="currentColor" stroke="none" />
        </svg>
      );
    case "x":
      return (
        <svg aria-hidden="true" viewBox="0 0 24 24" fill="currentColor" className={cls}>
          <path d="M4 4h4.6l11.4 16h-4.6L4 4Z" />
          <path d="M18.4 4h1.9l-6.4 7.3-1-1.4L18.4 4ZM10.9 13.2l1 1.4L5.6 20H3.7l7.2-6.8Z" />
        </svg>
      );
    case "linkedin":
      return (
        <svg aria-hidden="true" viewBox="0 0 24 24" fill="currentColor" className={cls}>
          <path
            fillRule="evenodd"
            clipRule="evenodd"
            d="M4.5 3h15A1.5 1.5 0 0 1 21 4.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 19.5v-15A1.5 1.5 0 0 1 4.5 3Zm2.25 7v7.5h2.5V10h-2.5ZM8 5.9a1.4 1.4 0 1 0 0 2.8 1.4 1.4 0 0 0 0-2.8ZM11 10v7.5h2.5v-4c0-1 .6-1.6 1.4-1.6.8 0 1.3.6 1.3 1.6v4h2.5v-4.6c0-2.2-1.2-3.1-2.8-3.1-1.1 0-1.9.5-2.4 1.2V10H11Z"
          />
        </svg>
      );
    case "youtube":
      return (
        <svg aria-hidden="true" viewBox="0 0 24 24" fill="currentColor" className={cls}>
          <path fillRule="evenodd" clipRule="evenodd" d="M5 5h14a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V8a3 3 0 0 1 3-3Zm5 4v6l5.2-3L10 9Z" />
        </svg>
      );
    default:
      return (
        <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className={cls}>
          <path d="M12.232 4.232a2.5 2.5 0 0 1 3.536 3.536l-1.225 1.224a.75.75 0 0 0 1.061 1.06l1.224-1.224a4 4 0 0 0-5.656-5.656l-3 3a4 4 0 0 0 .225 5.865.75.75 0 0 0 .977-1.138 2.5 2.5 0 0 1-.142-3.667l3-3Z" />
          <path d="M11.603 7.963a.75.75 0 0 0-.977 1.138 2.5 2.5 0 0 1 .142 3.667l-3 3a2.5 2.5 0 0 1-3.536-3.536l1.225-1.224a.75.75 0 0 0-1.061-1.06l-1.224 1.224a4 4 0 1 0 5.656 5.656l3-3a4 4 0 0 0-.225-5.865Z" />
        </svg>
      );
  }
}

const focusRing = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600";
const groupLabel = "text-xs font-semibold tracking-widest text-neutral-600 uppercase";

const linkList = {
  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 footerCivicBlock: ComponentConfig<FooterCivicProps> = {
  label: "Footer (Government)",
  fields: {
    sealImageUrl: { type: "text", label: "Seal image URL", metadata: { help: "Your seal or logo, ideally a square SVG. Leave blank for a generic emblem." } },
    sealImageAlt: { type: "text", label: "Seal alt text", metadata: { help: "Usually blank: the agency name beside it says the same thing." } },
    agencyName: { type: "text", label: "Agency name" },
    agencySubtitle: { type: "text", label: "Subtitle", metadata: { help: "Like the state or a department name. Leave blank to hide it." } },
    emergencyNote: { type: "text", label: "Emergency line", metadata: { help: "Shown in the top band, like For emergencies, call 911. Leave blank to hide it." } },
    visitLabel: { type: "text", label: "Visit label", metadata: { help: "Small label over the address and hours, like Visit." } },
    address: { type: "textarea", label: "Address", metadata: { help: "One line per row, exactly as it should appear." } },
    directionsLabel: { type: "text", label: "Directions link text", metadata: { help: "Leave blank to hide it." } },
    directionsHref: { type: "text", label: "Directions link", metadata: { help: "A maps URL or your own directions page." } },
    hours: {
      type: "array",
      label: "Office hours",
      min: 0,
      max: 7,
      getItemSummary: (item) => (item?.days ? `${item.days}: ${item.time || ""}` : "Hours"),
      defaultItemProps: { days: "Saturday", time: "Closed" },
      arrayFields: {
        days: { type: "text", label: "Days", metadata: { help: "Like Monday–Friday." } },
        time: { type: "text", label: "Hours", metadata: { help: "Like 8 a.m.–4:30 p.m., or Closed." } },
      },
    },
    contactLabel: { type: "text", label: "Contact label", metadata: { help: "Small label over the phone and email, like Contact." } },
    phone: { type: "text", label: "Phone", metadata: { help: "Shown as typed. The tap-to-call link is built from the digits." } },
    phoneNote: { type: "text", label: "Phone note", metadata: { help: "A short line under the number, like Or dial 311 inside city limits." } },
    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: { ...linkList, label: "Links", min: 1, max: 8 },
      },
    },
    socials: {
      type: "array",
      label: "Social links",
      min: 0,
      max: 6,
      getItemSummary: (item) => item?.label || platformNames[item?.platform as Platform] || "Social link",
      defaultItemProps: { platform: "facebook", label: "", href: "" },
      arrayFields: {
        platform: {
          type: "select",
          label: "Platform",
          options: [
            { label: "Facebook", value: "facebook" },
            { label: "Instagram", value: "instagram" },
            { label: "X", value: "x" },
            { label: "LinkedIn", value: "linkedin" },
            { label: "YouTube", value: "youtube" },
            { label: "Other", value: "other" },
          ],
        },
        label: { type: "text", label: "Screen reader label", metadata: { help: "Optional. Defaults to the platform name." } },
        href: { type: "text", label: "Profile link" },
      },
    },
    policyLinks: {
      ...linkList,
      label: "Policy links",
      min: 0,
      max: 8,
      metadata: { help: "Accessibility, privacy, public records and nondiscrimination notices. Many agencies are required to link these from every page." },
    },
    copyrightLine: { type: "text", label: "Copyright line", metadata: { help: "Like © 2026 City of Riverbend. Leave blank to hide it." } },
    lastUpdated: { type: "text", label: "Last updated", metadata: { help: "Optional, like Page updated October 2, 2026." } },
  },
  defaultProps: {
    sealImageUrl: "",
    sealImageAlt: "",
    agencyName: "City of Riverbend",
    agencySubtitle: "Office of the Mayor & City Council",
    emergencyNote: "For emergencies, call 911.",
    visitLabel: "Visit",
    address: "Riverbend City Hall\n200 Main Street\nRiverbend, KY 40202",
    directionsLabel: "Directions & parking",
    directionsHref: "/city-hall",
    hours: [
      { days: "Monday–Friday", time: "8 a.m.–4:30 p.m." },
      { days: "Saturday–Sunday", time: "Closed" },
    ],
    contactLabel: "Contact",
    phone: "(502) 555-0100",
    phoneNote: "Or dial 311 inside city limits",
    email: "info@riverbend.gov",
    navLabel: "Footer",
    groups: [
      {
        label: "Services",
        links: [
          { label: "Pay a utility bill", href: "/pay" },
          { label: "Trash & recycling", href: "/trash" },
          { label: "Permits & licenses", href: "/permits" },
          { label: "Report a pothole", href: "/311" },
        ],
      },
      {
        label: "Government",
        links: [
          { label: "Mayor's office", href: "/mayor" },
          { label: "City council", href: "/council" },
          { label: "Agendas & minutes", href: "/meetings" },
          { label: "Jobs with the city", href: "/jobs" },
        ],
      },
    ],
    socials: [
      { platform: "facebook", label: "", href: "https://facebook.com/" },
      { platform: "x", label: "", href: "https://x.com/" },
      { platform: "youtube", label: "", href: "https://youtube.com/" },
    ],
    policyLinks: [
      { label: "Accessibility", href: "/accessibility" },
      { label: "Privacy policy", href: "/privacy" },
      { label: "Open records requests", href: "/open-records" },
      { label: "Nondiscrimination (Title VI)", href: "/title-vi" },
      { label: "Language assistance", href: "/language" },
    ],
    copyrightLine: "© 2026 City of Riverbend",
    lastUpdated: "",
  },
  render: ({ id, sealImageUrl, sealImageAlt, agencyName, agencySubtitle, emergencyNote, visitLabel, address, directionsLabel, directionsHref, hours, contactLabel, phone, phoneNote, email, navLabel, groups, socials, policyLinks, copyrightLine, lastUpdated }) => {
    const uid = `footer-civic-${id}`;
    const lines = (address || "").split("\n").map((l) => l.trim()).filter(Boolean);
    const rows = (hours ?? []).filter((h) => h?.days || h?.time);
    const tel = (phone || "").replace(/[^\d+]/g, "");
    const mail = (email || "").trim();
    const cols = (groups ?? []).filter((g) => g?.label || (g?.links ?? []).some((l) => l?.label));
    const social = (socials ?? []).filter((s) => s?.href);
    const policy = (policyLinks ?? []).filter((l) => l?.label);
    const hasVisit = lines.length > 0 || Boolean(directionsLabel) || rows.length > 0;
    const hasContact = Boolean(phone || mail) || social.length > 0;
    const hasBand = Boolean(agencyName || sealImageUrl || emergencyNote);

    return (
      <footer className="bg-neutral-50">
        {hasBand ? (
          <div className="bg-indigo-900 px-4 py-6 sm:px-6 lg:px-8">
            <div className="mx-auto flex max-w-7xl flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
              <div className="flex items-center gap-4">
                {sealImageUrl ? (
                  <img src={sealImageUrl} alt={sealImageAlt || ""} className="size-14 shrink-0 rounded-full bg-white p-1" />
                ) : agencyName ? (
                  <svg aria-hidden="true" viewBox="0 0 64 64" className="size-14 shrink-0">
                    <circle cx="32" cy="32" r="31" fill="white" />
                    <circle cx="32" cy="32" r="26" fill="none" stroke="currentColor" strokeWidth="1.25" strokeDasharray="2 2.6" className="text-indigo-900" />
                    <circle cx="32" cy="32" r="20" fill="none" stroke="currentColor" strokeOpacity="0.45" className="text-indigo-900" />
                    <path fill="currentColor" className="text-indigo-900" d="M32 18.5l3.1 9.6h10.1l-8.2 5.9 3.1 9.6-8.1-5.9-8.1 5.9 3.1-9.6-8.2-5.9h10.1z" />
                  </svg>
                ) : null}
                {agencyName ? (
                  <div className="min-w-0">
                    <p className="text-xl leading-tight font-bold tracking-tight text-white">{agencyName}</p>
                    {agencySubtitle ? <p className="mt-0.5 text-sm text-indigo-100">{agencySubtitle}</p> : null}
                  </div>
                ) : null}
              </div>
              {emergencyNote ? (
                <p className="inline-flex items-center gap-2 self-start rounded-full bg-white px-4 py-2 text-sm font-semibold text-indigo-950 sm:self-auto">
                  <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-4 shrink-0 text-indigo-700">
                    <path fillRule="evenodd" d="M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-8-5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 10 5Zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" clipRule="evenodd" />
                  </svg>
                  {emergencyNote}
                </p>
              ) : null}
            </div>
          </div>
        ) : null}

        <div className="px-4 py-12 sm:px-6 lg:px-8 lg:py-16">
          <div className="mx-auto grid max-w-7xl grid-cols-1 gap-10 sm:grid-cols-2 lg:grid-cols-4 lg:gap-8">
            {hasVisit ? (
              <div>
                {visitLabel ? <p className={groupLabel}>{visitLabel}</p> : null}
                {lines.length ? (
                  <address className="mt-3 text-sm leading-6 text-neutral-800 not-italic">
                    {lines.map((line, i) => (
                      <span key={i} className={`block ${i === 0 ? "font-semibold text-neutral-950" : ""}`}>
                        {line}
                      </span>
                    ))}
                  </address>
                ) : null}
                {directionsLabel ? (
                  <a href={directionsHref || "#"} className={`mt-1 inline-flex min-h-11 items-center rounded text-sm font-semibold text-indigo-800 underline decoration-indigo-300 underline-offset-4 hover:decoration-indigo-800 ${focusRing}`}>
                    {directionsLabel}
                  </a>
                ) : null}
                {rows.length ? (
                  <dl className="mt-3 grid grid-cols-1 gap-y-1 border-t border-neutral-200 pt-3 text-sm leading-6">
                    {rows.map((h, i) => (
                      <div key={`${h.days}-${i}`} className="flex flex-wrap justify-between gap-x-4">
                        <dt className="text-neutral-700">{h.days}</dt>
                        <dd className="font-medium text-neutral-950 tabular-nums">{h.time}</dd>
                      </div>
                    ))}
                  </dl>
                ) : null}
              </div>
            ) : null}

            {hasContact ? (
              <div>
                {contactLabel ? <p className={groupLabel}>{contactLabel}</p> : null}
                <ul role="list" className="mt-3 space-y-1 text-sm">
                  {phone ? (
                    <li>
                      <a href={tel ? `tel:${tel}` : "#"} className={`inline-flex min-h-11 flex-col justify-center rounded ${focusRing}`}>
                        <span className="text-lg font-semibold text-neutral-950 tabular-nums underline decoration-neutral-300 underline-offset-4 hover:decoration-indigo-700">{phone}</span>
                      </a>
                      {phoneNote ? <p className="text-neutral-700">{phoneNote}</p> : null}
                    </li>
                  ) : null}
                  {mail ? (
                    <li>
                      <a href={`mailto:${mail}`} className={`inline-flex min-h-11 items-center rounded break-all text-indigo-800 underline decoration-indigo-300 underline-offset-4 hover:decoration-indigo-800 ${focusRing}`}>
                        {mail}
                      </a>
                    </li>
                  ) : null}
                </ul>
                {social.length ? (
                  <ul role="list" aria-label="Social media" className="mt-4 flex flex-wrap gap-2">
                    {social.map((s, i) => {
                      const platform = (s.platform || "other") as Platform;
                      return (
                        <li key={`${s.href}-${i}`}>
                          <a href={s.href} className={`inline-flex size-11 items-center justify-center rounded-lg bg-white text-indigo-900 ring-1 ring-neutral-300 transition hover:bg-indigo-900 hover:text-white ${focusRing}`}>
                            <SocialIcon platform={platform} />
                            <span className="sr-only">{s.label || platformNames[platform] || "Social link"}</span>
                          </a>
                        </li>
                      );
                    })}
                  </ul>
                ) : null}
              </div>
            ) : null}

            {cols.length ? (
              <nav aria-label={navLabel || "Footer"} className="grid grid-cols-1 gap-10 sm:col-span-2 sm:grid-cols-2 lg:gap-8">
                {cols.map((g, i) => {
                  const gid = `${uid}-g${i}`;
                  return (
                    <div key={`${g.label}-${i}`}>
                      {g.label ? (
                        <p id={gid} className={groupLabel}>
                          {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 font-medium text-neutral-800 underline-offset-4 hover:text-indigo-800 hover:underline ${focusRing}`}>
                                {l.label}
                              </a>
                            </li>
                          ))}
                      </ul>
                    </div>
                  );
                })}
              </nav>
            ) : null}
          </div>
        </div>

        {policy.length || copyrightLine || lastUpdated ? (
          <div className="border-t border-neutral-200 bg-white px-4 py-4 sm:px-6 lg:px-8">
            <div className="mx-auto flex max-w-7xl flex-col gap-2 lg:flex-row lg:items-center lg:justify-between">
              {policy.length ? (
                <nav aria-label="Policies">
                  <ul role="list" className="-mx-2 flex flex-wrap">
                    {policy.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-700 underline underline-offset-4 hover:text-indigo-800 ${focusRing}`}>
                          {l.label}
                        </a>
                      </li>
                    ))}
                  </ul>
                </nav>
              ) : null}
              {copyrightLine || lastUpdated ? (
                <p className="text-sm text-neutral-600">
                  {copyrightLine}
                  {copyrightLine && lastUpdated ? <span aria-hidden="true"> · </span> : null}
                  {lastUpdated}
                </p>
              ) : null}
            </div>
          </div>
        ) : null}
      </footer>
    );
  },
};
```
