# Add the "Get Help" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/get-help) to this Pantheon Content Publisher (P1) Next.js project. Plain-language service cards (who it's for, what to bring, how to get it) with a tap-to-call help line.

## Steps

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

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

/**
 * Get Help — plain-language service cards for people looking for help: who each service is
 * for, what to bring and how to get it, plus a prominent call-now line and a language note.
 * Register: `GetHelpBlock: getHelpBlock` in puck.config.tsx.
 */

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

export type GetHelpProps = {
  heading: string;
  headingLevel: Heading;
  intro: string;
  crisisHeading: string;
  crisisBody: string;
  crisisLabel: string;
  crisisPhone: string;
  crisisNote: string;
  services: {
    name: string;
    whoFor: string;
    bring: string;
    howTo: string;
    linkLabel: string;
    href: string;
  }[];
  languageNote: string;
  languageLinkLabel: string;
  languageHref: string;
};

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

const telHref = (phone: string) =>
  `tel:${(phone || "").replace(/[^\d+]/g, "")}`;

export const getHelpBlock: ComponentConfig<GetHelpProps> = {
  label: "Get Help",
  fields: {
    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. Service names use the next level down.",
      },
    },
    intro: {
      type: "textarea",
      label: "Intro",
      metadata: {
        help: "Keep it short and plain. Short words and short sentences help everyone.",
      },
    },
    crisisHeading: {
      type: "text",
      label: "Urgent help heading",
      metadata: {
        help: "Leave this and the phone number blank to hide the urgent help box.",
      },
    },
    crisisBody: { type: "textarea", label: "Urgent help text" },
    crisisLabel: {
      type: "text",
      label: "Phone line name",
      metadata: { help: "Like 24/7 help line." },
    },
    crisisPhone: {
      type: "text",
      label: "Phone number",
      metadata: {
        help: "Write it the way people should read it. It becomes a tap-to-call link.",
      },
    },
    crisisNote: {
      type: "text",
      label: "Emergency note",
      metadata: {
        help: "Like If you are in danger, call 911. Leave blank to hide it.",
      },
    },
    services: {
      type: "array",
      label: "Services",
      min: 1,
      max: 9,
      getItemSummary: (item) => item?.name || "Service",
      defaultItemProps: {
        name: "New service",
        whoFor: "",
        bring: "",
        howTo: "",
        linkLabel: "Learn more",
        href: "#",
      },
      arrayFields: {
        name: { type: "text", label: "Service name" },
        whoFor: {
          type: "textarea",
          label: "Who it's for",
          metadata: { help: "Who can get this help. Leave blank to hide it." },
        },
        bring: {
          type: "textarea",
          label: "What to bring",
          metadata: {
            help: "One item per line. Leave blank to hide the list.",
          },
        },
        howTo: {
          type: "textarea",
          label: "How to get it",
          metadata: { help: "Where to go, when, or who to call." },
        },
        linkLabel: {
          type: "text",
          label: "Link text",
          metadata: {
            help: "Screen readers also hear the service name. Leave blank to hide the link.",
          },
        },
        href: { type: "text", label: "Link" },
      },
    },
    languageNote: {
      type: "text",
      label: "Language note",
      metadata: {
        help: "Like Help is available in Spanish, Vietnamese and ASL. Leave blank to hide it.",
      },
    },
    languageLinkLabel: {
      type: "text",
      label: "Language link text",
      metadata: { help: "Leave blank to hide it." },
    },
    languageHref: { type: "text", label: "Language link" },
  },
  defaultProps: {
    heading: "Get help today",
    headingLevel: "h2",
    intro:
      "Our help is free. You do not need an appointment for most services. Pick what you need below to see who it is for and what to bring.",
    crisisHeading: "Need help right now?",
    crisisBody:
      "Call or text us any time, day or night. A real person will answer.",
    crisisLabel: "24/7 help line",
    crisisPhone: "(555) 010-4357",
    crisisNote: "If you are in danger, call 911.",
    services: [
      {
        name: "Free groceries",
        whoFor:
          "Anyone who lives in Marlow County and needs food. You do not need to show proof of income.",
        bring:
          "A bag or box if you have one\nAny ID with your name (not required)",
        howTo:
          "Come to our pantry Monday to Saturday, 10 a.m. to 2 p.m. You can visit once a week.",
        linkLabel: "See pantry hours",
        href: "/help/food",
      },
      {
        name: "Help paying rent",
        whoFor:
          "Families who are behind on rent or got a notice to leave their home.",
        bring:
          "Your lease\nThe notice from your landlord\nA recent pay stub or benefits letter",
        howTo:
          "Call our help line or come in on Tuesday or Thursday. We will help you fill out the form.",
        linkLabel: "Start a rent help request",
        href: "/help/rent",
      },
      {
        name: "Free tax help",
        whoFor:
          "Households that earn less than $67,000 a year. Open January to April.",
        bring:
          "Photo ID\nSocial Security cards for everyone on your return\nAll your W-2 and 1099 forms",
        howTo:
          "Book a time online or call us. Most visits take about one hour.",
        linkLabel: "Book a tax visit",
        href: "/help/taxes",
      },
    ],
    languageNote:
      "Help is available in Spanish, Vietnamese and American Sign Language (ASL). Free interpreters for any language.",
    languageLinkLabel: "Ask for an interpreter",
    languageHref: "/help/language",
  },
  render: ({
    heading,
    headingLevel,
    intro,
    crisisHeading,
    crisisBody,
    crisisLabel,
    crisisPhone,
    crisisNote,
    services,
    languageNote,
    languageLinkLabel,
    languageHref,
  }) => {
    const H = headingLevel || "h2";
    const Sub = childHeading[headingLevel] || "h3";
    const list = (services ?? []).filter((s) => s?.name);
    const hasCrisis = Boolean(crisisHeading || crisisPhone);
    const cols =
      list.length === 1
        ? ""
        : list.length === 2 || list.length === 4
          ? "md:grid-cols-2"
          : "md:grid-cols-2 lg:grid-cols-3";

    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 max-w-7xl">
          <div
            className={`grid gap-8 lg:gap-16 ${hasCrisis ? "lg:grid-cols-12 lg:items-center" : ""}`}
          >
            <div className={hasCrisis ? "lg:col-span-7" : "max-w-3xl"}>
              {heading ? (
                <H className="text-3xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-4xl lg:text-5xl">
                  {heading}
                </H>
              ) : null}
              {intro ? (
                <p className="mt-5 max-w-2xl text-xl leading-8 text-pretty text-neutral-700">
                  {intro}
                </p>
              ) : null}
            </div>

            {hasCrisis ? (
              <aside
                aria-label={crisisHeading || crisisLabel || "Urgent help"}
                className="rounded-2xl bg-neutral-950 p-6 text-white sm:p-8 lg:col-span-5"
              >
                {crisisHeading ? (
                  <p className="text-xl font-semibold tracking-tight">
                    {crisisHeading}
                  </p>
                ) : null}
                {crisisBody ? (
                  <p className="mt-2 text-base leading-7 text-pretty text-neutral-300">
                    {crisisBody}
                  </p>
                ) : null}
                {crisisPhone ? (
                  <a
                    href={telHref(crisisPhone)}
                    className="group mt-6 flex min-h-16 items-center gap-4 rounded-xl bg-white px-4 py-3 text-neutral-950 transition hover:bg-indigo-50 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-white sm:px-5"
                  >
                    <span
                      aria-hidden="true"
                      className="grid size-11 shrink-0 place-items-center rounded-full bg-indigo-600 text-white transition group-hover:bg-indigo-700"
                    >
                      <svg
                        viewBox="0 0 20 20"
                        fill="currentColor"
                        className="size-5"
                      >
                        <path
                          fillRule="evenodd"
                          d="M2 3.5A1.5 1.5 0 0 1 3.5 2h1.148a1.5 1.5 0 0 1 1.465 1.175l.716 3.223a1.5 1.5 0 0 1-1.052 1.767l-.933.267c-.41.117-.643.555-.48.95a11.542 11.542 0 0 0 6.254 6.254c.395.163.833-.07.95-.48l.267-.933a1.5 1.5 0 0 1 1.767-1.052l3.223.716A1.5 1.5 0 0 1 18 15.352V16.5a1.5 1.5 0 0 1-1.5 1.5H15c-1.149 0-2.263-.15-3.326-.43A13.022 13.022 0 0 1 2.43 8.326 13.019 13.019 0 0 1 2 5V3.5Z"
                          clipRule="evenodd"
                        />
                      </svg>
                    </span>
                    <span className="min-w-0">
                      {crisisLabel ? (
                        <span className="block text-sm font-medium text-neutral-600">
                          {crisisLabel}
                        </span>
                      ) : null}
                      <span className="block text-2xl font-semibold tracking-tight tabular-nums sm:text-3xl">
                        {crisisPhone}
                      </span>
                    </span>
                  </a>
                ) : null}
                {crisisNote ? (
                  <p className="mt-4 flex items-start gap-2 text-sm leading-6 font-medium text-white">
                    <svg
                      aria-hidden="true"
                      viewBox="0 0 20 20"
                      fill="currentColor"
                      className="mt-0.5 size-5 shrink-0 text-neutral-400"
                    >
                      <path
                        fillRule="evenodd"
                        d="M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 9a.75.75 0 0 0 0 1.5h.253a.25.25 0 0 1 .244.304l-.459 2.066A1.75 1.75 0 0 0 10.747 15H11a.75.75 0 0 0 0-1.5h-.253a.25.25 0 0 1-.244-.304l.459-2.066A1.75 1.75 0 0 0 9.253 9H9Z"
                        clipRule="evenodd"
                      />
                    </svg>
                    {crisisNote}
                  </p>
                ) : null}
              </aside>
            ) : null}
          </div>

          {list.length ? (
            <ul role="list" className={`mt-12 grid gap-6 sm:mt-16 ${cols}`}>
              {list.map((s, i) => {
                const bring = (s.bring || "")
                  .split("\n")
                  .map((l) => l.trim())
                  .filter(Boolean);
                return (
                  <li
                    key={`${s.name}-${i}`}
                    className="flex flex-col rounded-2xl bg-white p-6 ring-1 ring-neutral-200 sm:p-8"
                  >
                    <Sub className="text-2xl font-semibold tracking-tight text-neutral-950">
                      {s.name}
                    </Sub>
                    <dl className="mt-6 flex-1 space-y-6 text-base leading-7">
                      {s.whoFor ? (
                        <div>
                          <dt className="text-sm font-semibold text-indigo-700">
                            Who it's for
                          </dt>
                          <dd className="mt-1 text-pretty text-neutral-800">
                            {s.whoFor}
                          </dd>
                        </div>
                      ) : null}
                      {bring.length ? (
                        <div>
                          <dt className="text-sm font-semibold text-indigo-700">
                            What to bring
                          </dt>
                          <dd className="mt-2">
                            <ul role="list" className="space-y-2">
                              {bring.map((b, j) => (
                                <li
                                  key={j}
                                  className="flex gap-3 text-neutral-800"
                                >
                                  <svg
                                    aria-hidden="true"
                                    viewBox="0 0 20 20"
                                    fill="currentColor"
                                    className="mt-1 size-5 shrink-0 text-indigo-600"
                                  >
                                    <path
                                      fillRule="evenodd"
                                      d="M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z"
                                      clipRule="evenodd"
                                    />
                                  </svg>
                                  <span className="min-w-0">{b}</span>
                                </li>
                              ))}
                            </ul>
                          </dd>
                        </div>
                      ) : null}
                      {s.howTo ? (
                        <div className="rounded-xl bg-neutral-50 p-4">
                          <dt className="text-sm font-semibold text-indigo-700">
                            How to get it
                          </dt>
                          <dd className="mt-1 text-pretty text-neutral-800">
                            {s.howTo}
                          </dd>
                        </div>
                      ) : null}
                    </dl>
                    {s.linkLabel ? (
                      <a
                        href={s.href || "#"}
                        className="group mt-6 inline-flex min-h-11 items-center gap-2 self-start rounded-lg text-base font-semibold 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"
                      >
                        {s.linkLabel}
                        <span className="sr-only">: {s.name}</span>
                        <svg
                          aria-hidden="true"
                          viewBox="0 0 20 20"
                          fill="currentColor"
                          className="size-5 transition group-hover:translate-x-0.5"
                        >
                          <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}
                  </li>
                );
              })}
            </ul>
          ) : null}

          {languageNote || languageLinkLabel ? (
            <div className="mt-10 flex flex-col gap-4 rounded-2xl bg-indigo-50 p-6 sm:flex-row sm:items-center sm:justify-between sm:p-8">
              {languageNote ? (
                <p className="flex items-start gap-3 text-base leading-7 font-medium text-pretty text-indigo-950">
                  <svg
                    aria-hidden="true"
                    viewBox="0 0 20 20"
                    fill="currentColor"
                    className="mt-1 size-5 shrink-0 text-indigo-700"
                  >
                    <path d="M7.75 2.75a.75.75 0 0 0-1.5 0v1.258a32.987 32.987 0 0 0-3.599.278.75.75 0 1 0 .198 1.487A31.545 31.545 0 0 1 8.7 5.545 19.381 19.381 0 0 1 7 9.56a19.418 19.418 0 0 1-1.002-2.05.75.75 0 0 0-1.384.577 20.935 20.935 0 0 0 1.492 2.91 19.613 19.613 0 0 1-3.828 4.154.75.75 0 1 0 .945 1.164A21.116 21.116 0 0 0 7 12.331c.095.132.192.262.29.391a.75.75 0 0 0 1.194-.91c-.204-.266-.4-.538-.59-.815a20.888 20.888 0 0 0 2.333-5.332c.31.031.618.068.924.108a.75.75 0 0 0 .198-1.487 32.832 32.832 0 0 0-3.599-.278V2.75Z" />
                    <path
                      fillRule="evenodd"
                      d="M13 8a.75.75 0 0 1 .671.415l4.25 8.5a.75.75 0 1 1-1.342.67L15.787 16h-5.573l-.793 1.585a.75.75 0 1 1-1.342-.67l4.25-8.5A.75.75 0 0 1 13 8Zm2.037 6.5L13 10.427 10.964 14.5h4.073Z"
                      clipRule="evenodd"
                    />
                  </svg>
                  {languageNote}
                </p>
              ) : null}
              {languageLinkLabel ? (
                <a
                  href={languageHref || "#"}
                  className="inline-flex min-h-11 shrink-0 items-center justify-center rounded-lg bg-white px-4 py-2.5 text-base font-semibold text-indigo-700 ring-1 ring-indigo-200 transition ring-inset hover:bg-indigo-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                >
                  {languageLinkLabel}
                </a>
              ) : null}
            </div>
          ) : null}
        </div>
      </section>
    );
  },
};
```
