# Add the "Care Options" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/care-options) to this Pantheon Content Publisher (P1) Next.js project. Where to go for care: primary, video, urgent and emergency, with common examples, wait and cost cues, and a 911 line.

## Steps

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

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

/**
 * Care Options — "where to go for care": a card per option (primary care, telehealth, urgent
 * care, emergency room) with common examples, a wait/cost cue and how to get it, plus a
 * prominent "In an emergency call 911" line. Red is reserved for the 911 line.
 * Register: `CareOptionsBlock: careOptionsBlock` in puck.config.tsx.
 */

// spec: status-colors

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

export type CareOptionsProps = {
  heading: string;
  headingLevel: Heading;
  intro: string;
  emergencyTitle: string;
  emergencyText: string;
  options: {
    name: string;
    kind: "clinic" | "video" | "urgent" | "emergency";
    goodFor: string;
    wait: string;
    cost: string;
    howTo: string;
    linkLabel: string;
    href: string;
  }[];
  disclaimer: string;
  helpText: string;
  helpPhone: string;
};

const childLevel = { h1: "h2", h2: "h3", h3: "h4", h4: "h5" } as const;
const focusRing = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600";
const telHref = (p: string) => `tel:${(p || "").replace(/[^\d+]/g, "")}`;

const kindIcon: Record<string, string> = {
  clinic:
    "M9.293 2.293a1 1 0 0 1 1.414 0l7 7A1 1 0 0 1 17 11h-1v6a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-6H3a1 1 0 0 1-.707-1.707l7-7Z",
  video: "M3.25 4A2.25 2.25 0 0 0 1 6.25v7.5A2.25 2.25 0 0 0 3.25 16h7.5A2.25 2.25 0 0 0 13 13.75v-7.5A2.25 2.25 0 0 0 10.75 4h-7.5ZM19 4.75a.75.75 0 0 0-1.28-.53l-3 3a.75.75 0 0 0-.22.53v4.5c0 .199.079.39.22.53l3 3a.75.75 0 0 0 1.28-.53V4.75Z",
  urgent: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm.75-13a.75.75 0 0 0-1.5 0v5c0 .414.336.75.75.75h4a.75.75 0 0 0 0-1.5h-3.25V5Z",
  emergency:
    "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",
};
const phoneIcon =
  "M2 3.5A1.5 1.5 0 0 1 3.5 2h1.148a1.5 1.5 0 0 1 1.465 1.175l.513 2.31a1.5 1.5 0 0 1-1.02 1.745l-1.051.35a.5.5 0 0 0-.31.637 10.48 10.48 0 0 0 6.548 6.548.5.5 0 0 0 .637-.31l.35-1.05a1.5 1.5 0 0 1 1.745-1.021l2.31.513A1.5 1.5 0 0 1 18 15.352V16.5a1.5 1.5 0 0 1-1.5 1.5H15C7.82 18 2 12.18 2 5V3.5Z";
const arrow =
  "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";

export const careOptionsBlock: ComponentConfig<CareOptionsProps> = {
  label: "Care Options",
  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. Option names use the next level down." },
    },
    intro: { type: "textarea", label: "Intro" },
    emergencyTitle: {
      type: "text",
      label: "Emergency line",
      metadata: { help: "This line always shows above the cards. Left blank, it reads In an emergency, call 911." },
    },
    emergencyText: { type: "textarea", label: "Emergency text", metadata: { help: "One or two short sentences. Leave blank to show only the line." } },
    options: {
      type: "array",
      label: "Care options",
      min: 1,
      max: 6,
      getItemSummary: (item) => item?.name || "Care option",
      defaultItemProps: { name: "New option", kind: "clinic", goodFor: "", wait: "", cost: "", howTo: "", linkLabel: "", href: "" },
      arrayFields: {
        name: { type: "text", label: "Name" },
        kind: {
          type: "select",
          label: "Icon",
          options: [
            { label: "Clinic", value: "clinic" },
            { label: "Video visit", value: "video" },
            { label: "Urgent (clock)", value: "urgent" },
            { label: "Emergency (warning)", value: "emergency" },
          ],
        },
        goodFor: {
          type: "textarea",
          label: "Common reasons to go",
          metadata: { help: "One per line. Use widely accepted, general examples and have a clinician review them. Don't diagnose." },
        },
        wait: { type: "text", label: "Typical wait", metadata: { help: "A rough cue, like Usually same or next day." } },
        cost: { type: "text", label: "Typical cost", metadata: { help: "A rough cue, like Lowest cost. Sliding fee available." } },
        howTo: { type: "textarea", label: "How to get it" },
        linkLabel: { type: "text", label: "Link text", metadata: { help: "Leave blank to hide the link." } },
        href: { type: "text", label: "Link", metadata: { help: "A page, or tel: link for a phone number." } },
      },
    },
    disclaimer: { type: "textarea", label: "Disclaimer", metadata: { help: "Makes clear this is general information, not medical advice." } },
    helpText: { type: "text", label: "Help line text", metadata: { help: "Leave blank and remove the phone to hide." } },
    helpPhone: { type: "text", label: "Help line phone" },
  },
  defaultProps: {
    heading: "Where to go for care",
    headingLevel: "h2",
    intro: "Picking the right place can save you time and money. Here are some common reasons people use each kind of care at Lakeshore Community Health.",
    emergencyTitle: "In an emergency, call 911",
    emergencyText: "Call 911 or go to the nearest emergency room right away if you think a life is in danger. Don't wait to call us first.",
    options: [
      {
        name: "Primary care",
        kind: "clinic",
        goodFor: "Checkups and yearly physicals\nOngoing care for conditions like diabetes or high blood pressure\nShots and screenings\nReferrals to specialists",
        wait: "Usually within a week",
        cost: "Lowest cost. Sliding fee available.",
        howTo: "Call your clinic or book online. Your care team knows your history.",
        linkLabel: "Book a visit",
        href: "/appointments",
      },
      {
        name: "Video visit",
        kind: "video",
        goodFor: "Follow-up visits\nPrescription refills\nQuestions about a cold, rash or allergies\nTalk therapy and counseling",
        wait: "Often same day",
        cost: "Same as a clinic visit",
        howTo: "Sign in to the patient portal and pick Video visit. You'll need a phone or computer with a camera.",
        linkLabel: "Start a video visit",
        href: "/portal/video",
      },
      {
        name: "Urgent care",
        kind: "urgent",
        goodFor: "Sprains and minor cuts\nFever, cough or flu symptoms\nEar pain or a sore throat\nWhen your clinic is closed",
        wait: "Walk in. Waits are often under an hour.",
        cost: "Costs more than a clinic visit",
        howTo: "Walk in to Harbor Street Health Center, open evenings and Saturdays.",
        linkLabel: "See urgent care hours",
        href: "/clinics/harbor-street",
      },
      {
        name: "Emergency room",
        kind: "emergency",
        goodFor: "Chest pain or trouble breathing\nSigns of a stroke, like a drooping face or slurred speech\nHeavy bleeding or a serious injury\nPoisoning or overdose",
        wait: "Open 24/7. The most serious cases are seen first.",
        cost: "Highest cost",
        howTo: "Call 911 or go to the nearest hospital emergency room.",
        linkLabel: "",
        href: "",
      },
    ],
    disclaimer: "This guide is general information, not medical advice. If you're not sure where to go, call us and we'll help you decide.",
    helpText: "Not sure where to go? Call us, day or night.",
    helpPhone: "(555) 010-2000",
  },
  render: ({ heading, headingLevel, intro, emergencyTitle, emergencyText, options, disclaimer, helpText, helpPhone }) => {
    const H = headingLevel || "h2";
    const Sub = childLevel[H] ?? "h3";
    const list = (options ?? []).filter((o) => o?.name);
    const cols = list.length >= 4 ? "md:grid-cols-2 xl:grid-cols-4" : list.length === 3 ? "md:grid-cols-3" : list.length === 2 ? "md:grid-cols-2" : "";

    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">
          {heading || intro ? (
            <div className="max-w-2xl">
              {heading ? <H className="text-3xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-4xl">{heading}</H> : null}
              {intro ? <p className="mt-4 text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
            </div>
          ) : null}

          {(
            <div className="mt-10 flex flex-col gap-5 rounded-2xl bg-red-700 p-6 text-white sm:flex-row sm:items-center sm:justify-between sm:p-8">
              <div className="flex items-start gap-4">
                <span aria-hidden="true" className="grid size-11 shrink-0 place-items-center rounded-full bg-white text-red-700">
                  <svg viewBox="0 0 20 20" fill="currentColor" className="size-6">
                    <path fillRule="evenodd" d={kindIcon.emergency} clipRule="evenodd" />
                  </svg>
                </span>
                <div className="min-w-0">
                  <p className="text-2xl leading-tight font-bold tracking-tight text-balance">{emergencyTitle || "In an emergency, call 911"}</p>
                  {emergencyText ? <p className="mt-1.5 max-w-2xl text-base leading-7 text-pretty text-white">{emergencyText}</p> : null}
                </div>
              </div>
              <a
                href="tel:911"
                className="inline-flex min-h-14 shrink-0 items-center justify-center gap-3 rounded-xl bg-white px-6 py-3 text-xl font-bold text-red-800 shadow-sm transition hover:bg-red-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white"
              >
                <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-6">
                  <path fillRule="evenodd" d={phoneIcon} clipRule="evenodd" />
                </svg>
                Call 911
              </a>
            </div>
          )}

          {list.length ? (
            <ol role="list" className={`mt-10 grid grid-cols-1 gap-6 ${cols}`}>
              {list.map((o, i) => {
                const reasons = (o.goodFor || "").split("\n").map((l) => l.trim()).filter(Boolean);
                const isEmergency = o.kind === "emergency";
                return (
                  <li key={`${o.name}-${i}`}>
                    <article
                      className={`flex h-full flex-col rounded-2xl p-6 ring-1 ring-inset ${isEmergency ? "bg-red-50/60 ring-red-700/20" : "bg-neutral-50 ring-neutral-950/5"}`}
                    >
                      <div className="flex items-center gap-3">
                        <span
                          aria-hidden="true"
                          className={`grid size-10 shrink-0 place-items-center rounded-xl ${isEmergency ? "bg-red-700 text-white" : "bg-indigo-600 text-white"}`}
                        >
                          <svg viewBox="0 0 20 20" fill="currentColor" className="size-5">
                            <path fillRule="evenodd" d={kindIcon[o.kind] ?? kindIcon.clinic} clipRule="evenodd" />
                          </svg>
                        </span>
                        <Sub className="text-xl font-semibold tracking-tight text-neutral-950">{o.name}</Sub>
                      </div>

                      {reasons.length ? (
                        <div className="mt-5">
                          <p className="text-sm font-semibold text-neutral-950">Common reasons to go</p>
                          <ul role="list" className="mt-2 space-y-2">
                            {reasons.map((r, j) => (
                              <li key={j} className="flex gap-2.5 text-sm leading-6 text-neutral-700">
                                <span aria-hidden="true" className={`mt-2.5 size-1.5 shrink-0 rounded-full ${isEmergency ? "bg-red-700" : "bg-indigo-500"}`} />
                                <span className="min-w-0 text-pretty">{r}</span>
                              </li>
                            ))}
                          </ul>
                        </div>
                      ) : null}

                      {o.wait || o.cost ? (
                        <dl className="mt-5 grid grid-cols-1 gap-3 border-t border-neutral-950/10 pt-5 text-sm leading-6">
                          {o.wait ? (
                            <div>
                              <dt className="font-semibold text-neutral-950">Typical wait</dt>
                              <dd className="text-neutral-700">{o.wait}</dd>
                            </div>
                          ) : null}
                          {o.cost ? (
                            <div>
                              <dt className="font-semibold text-neutral-950">Cost</dt>
                              <dd className="text-neutral-700">{o.cost}</dd>
                            </div>
                          ) : null}
                        </dl>
                      ) : null}

                      {o.howTo ? (
                        <p className="mt-5 rounded-xl bg-white p-4 text-sm leading-6 text-pretty text-neutral-800 ring-1 ring-neutral-950/5">
                          <span className="block font-semibold text-neutral-950">How to get it</span>
                          {o.howTo}
                        </p>
                      ) : null}

                      {o.linkLabel ? (
                        <div className="mt-auto pt-5">
                          <a
                            href={o.href || "#"}
                            className={`group inline-flex min-h-11 items-center gap-2 rounded-lg text-sm font-semibold text-indigo-700 hover:text-indigo-900 ${focusRing}`}
                          >
                            {o.linkLabel}
                            <span className="sr-only">: {o.name}</span>
                            <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-4 transition motion-safe:group-hover:translate-x-0.5">
                              <path fillRule="evenodd" d={arrow} clipRule="evenodd" />
                            </svg>
                          </a>
                        </div>
                      ) : null}
                    </article>
                  </li>
                );
              })}
            </ol>
          ) : null}

          {disclaimer || helpText || helpPhone ? (
            <div className="mt-10 flex flex-col gap-5 border-t border-neutral-200 pt-8 lg:flex-row lg:items-center lg:justify-between">
              {disclaimer ? <p className="max-w-2xl text-sm leading-6 text-pretty text-neutral-600">{disclaimer}</p> : null}
              {helpText || helpPhone ? (
                <div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-4">
                  {helpText ? <p className="text-sm font-semibold text-neutral-950">{helpText}</p> : null}
                  {helpPhone ? (
                    <a
                      href={telHref(helpPhone)}
                      className={`inline-flex min-h-11 shrink-0 items-center justify-center gap-2 self-start rounded-lg bg-indigo-600 px-4 py-2.5 text-sm font-semibold text-white tabular-nums shadow-xs transition hover:bg-indigo-500 ${focusRing}`}
                    >
                      <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-4">
                        <path fillRule="evenodd" d={phoneIcon} clipRule="evenodd" />
                      </svg>
                      {helpPhone}
                    </a>
                  ) : null}
                </div>
              ) : null}
            </div>
          ) : null}
        </div>
      </section>
    );
  },
};
```
