# Add the "Insurance Accepted" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/insurance-accepted) to this Pantheon Content Publisher (P1) Next.js project. Accepted plans grouped by type, a sliding fee scale table by income, and a call-us box for coverage questions.

## Steps

1. Create `components/puck/insurance-accepted-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 { insuranceAcceptedBlock } from "./components/puck/insurance-accepted-block";`
3. Register it under `components` as `InsuranceAcceptedBlock: insuranceAcceptedBlock`.
4. Add `"InsuranceAcceptedBlock"` 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/insurance-accepted-block.tsx`

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

/**
 * Insurance Accepted — the plans a clinic takes, grouped by type (Medicaid, Medicare,
 * Marketplace, commercial), a sliding fee scale table by income, and a "Not sure? Call us" box.
 * Register: `InsuranceAcceptedBlock: insuranceAcceptedBlock` in puck.config.tsx.
 */

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

export type InsuranceAcceptedProps = {
  heading: string;
  headingLevel: Heading;
  intro: string;
  groups: { name: string; plans: string; note: string }[];
  feeHeading: string;
  feeIntro: string;
  incomeLabel: string;
  payLabel: string;
  feeRows: { income: string; pay: string }[];
  feeSource: string;
  contactHeading: string;
  contactText: string;
  phone: string;
  email: 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 check = "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";

export const insuranceAcceptedBlock: ComponentConfig<InsuranceAcceptedProps> = {
  label: "Insurance Accepted",
  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. Group names use the next level down." },
    },
    intro: { type: "textarea", label: "Intro" },
    groups: {
      type: "array",
      label: "Plan groups",
      min: 1,
      max: 8,
      getItemSummary: (item) => item?.name || "Plan group",
      defaultItemProps: { name: "New group", plans: "", note: "" },
      arrayFields: {
        name: { type: "text", label: "Group name", metadata: { help: "Like Medicaid plans or Marketplace plans." } },
        plans: { type: "textarea", label: "Plans", metadata: { help: "One plan per line, named the way it appears on the member's card." } },
        note: { type: "text", label: "Note", metadata: { help: "Optional, like Most plans; call to check yours." } },
      },
    },
    feeHeading: { type: "text", label: "Sliding fee heading", metadata: { help: "Leave blank and remove all rows to hide the sliding fee table." } },
    feeIntro: { type: "textarea", label: "Sliding fee intro" },
    incomeLabel: { type: "text", label: "Income column label" },
    payLabel: { type: "text", label: "Payment column label" },
    feeRows: {
      type: "array",
      label: "Sliding fee rows",
      min: 0,
      max: 8,
      getItemSummary: (item) => (item?.income ? `${item.income}${item.pay ? ` → ${item.pay}` : ""}` : "Row"),
      defaultItemProps: { income: "", pay: "" },
      arrayFields: {
        income: { type: "text", label: "Household income", metadata: { help: "Like 101% to 150% of the poverty level." } },
        pay: { type: "text", label: "What you pay", metadata: { help: "Like $30 per visit, or 50% off." } },
      },
    },
    feeSource: { type: "text", label: "Table source", metadata: { help: "Where the income levels come from, and the year. Shown under the table." } },
    contactHeading: { type: "text", label: "Contact heading", metadata: { help: "Leave blank, with no phone or email, to hide the contact box." } },
    contactText: { type: "textarea", label: "Contact text" },
    phone: { type: "text", label: "Phone" },
    email: { type: "text", label: "Email" },
  },
  defaultProps: {
    heading: "Insurance we accept",
    headingLevel: "h2",
    intro: "We take most plans in Lakeshore County. No insurance? You can still get care here. Our sliding fee scale lowers your cost based on income and family size.",
    groups: [
      { name: "Medicaid plans", plans: "Lakeshore State Medicaid\nGreat Lakes Community Health Plan\nBayview Family Care Medicaid\nHarborCare Kids (children's plan)", note: "" },
      { name: "Medicare", plans: "Original Medicare (Part A and Part B)\nNorthshore Medicare Advantage\nSilverPath Medicare Advantage", note: "" },
      { name: "Marketplace plans", plans: "Lakeshore Marketplace Bronze, Silver and Gold\nCommonWell Marketplace Plans", note: "Plans bought through the Health Insurance Marketplace." },
      { name: "Commercial plans", plans: "Meridian Mutual PPO\nTrueNorth Health HMO\nCoastline Employer Plans", note: "Most employer plans. Call to check yours." },
    ],
    feeHeading: "Sliding fee scale",
    feeIntro: "If you have no insurance, or your plan doesn't cover a visit, you may pay less. It's based on your household income compared to the federal poverty level.",
    incomeLabel: "Household income",
    payLabel: "What you pay for a medical visit",
    feeRows: [
      { income: "100% of the poverty level or less", pay: "$20 per visit" },
      { income: "101% to 150%", pay: "$35 per visit" },
      { income: "151% to 200%", pay: "$50 per visit" },
      { income: "Over 200%", pay: "Full fee. Ask about payment plans." },
    ],
    feeSource: "Sample figures. Income levels follow the HHS Poverty Guidelines (aspe.hhs.gov), updated each year.",
    contactHeading: "Not sure if we take your plan?",
    contactText: "Our patient services team can check your coverage, help you apply for Medicaid or Marketplace coverage, and sign you up for the sliding fee scale. It's free.",
    phone: "(555) 010-2100",
    email: "billing@lakeshorehealth.example.org",
  },
  render: ({ id, heading, headingLevel, intro, groups, feeHeading, feeIntro, incomeLabel, payLabel, feeRows, feeSource, contactHeading, contactText, phone, email }) => {
    const H = headingLevel || "h2";
    const Sub = childLevel[H] ?? "h3";
    const list = (groups ?? []).filter((g) => g?.name);
    const rows = (feeRows ?? []).filter((r) => r?.income);
    const captionId = `ins-${id || "block"}-fees`;
    const tel = (phone || "").replace(/[^\d+]/g, "");
    const mail = (email || "").trim();
    const hasContact = Boolean(contactHeading || tel || mail);

    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}

          {list.length ? (
            <div className="mt-10 grid grid-cols-1 gap-px overflow-hidden rounded-2xl bg-neutral-200 ring-1 ring-neutral-200 sm:mt-12 md:grid-cols-2 xl:grid-cols-4">
              {list.map((g, i) => {
                const plans = (g.plans || "").split("\n").map((p) => p.trim()).filter(Boolean);
                return (
                  <div key={`${g.name}-${i}`} className="bg-white p-6 sm:p-7">
                    <Sub className="text-base font-semibold text-neutral-950">{g.name}</Sub>
                    {g.note ? <p className="mt-1 text-sm leading-6 text-neutral-600">{g.note}</p> : null}
                    {plans.length ? (
                      <ul role="list" className="mt-4 space-y-2.5">
                        {plans.map((p, j) => (
                          <li key={j} className="flex gap-2.5 text-sm leading-6 text-neutral-800">
                            <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="mt-0.5 size-5 shrink-0 text-indigo-600">
                              <path fillRule="evenodd" d={check} clipRule="evenodd" />
                            </svg>
                            <span className="min-w-0 text-pretty">{p}</span>
                          </li>
                        ))}
                      </ul>
                    ) : null}
                  </div>
                );
              })}
            </div>
          ) : null}

          {(feeHeading && rows.length) || hasContact ? (
            <div className="mt-12 grid grid-cols-1 gap-8 lg:mt-16 lg:grid-cols-12 lg:gap-12">
              {feeHeading && rows.length ? (
                <div className={hasContact ? "lg:col-span-7" : "lg:col-span-12"}>
                  <Sub className="text-2xl font-semibold tracking-tight text-neutral-950">{feeHeading}</Sub>
                  {feeIntro ? <p className="mt-3 max-w-2xl text-base leading-7 text-pretty text-neutral-600">{feeIntro}</p> : null}
                  <div
                    role="region"
                    aria-labelledby={captionId}
                    tabIndex={0}
                    className={`relative mt-6 overflow-x-auto rounded-xl ring-1 ring-neutral-200 ${focusRing}`}
                  >
                    <table className="w-full min-w-72 text-left text-sm">
                      <caption id={captionId} className="sr-only">
                        {feeHeading}: {payLabel || "what you pay"} by {incomeLabel || "household income"}
                      </caption>
                      <thead className="bg-neutral-50">
                        <tr>
                          <th scope="col" className="px-4 py-3 font-semibold text-neutral-950 sm:px-5">
                            {incomeLabel || "Household income"}
                          </th>
                          <th scope="col" className="px-4 py-3 font-semibold text-neutral-950 sm:px-5">
                            {payLabel || "What you pay"}
                          </th>
                        </tr>
                      </thead>
                      <tbody className="divide-y divide-neutral-200">
                        {rows.map((r, i) => (
                          <tr key={`${r.income}-${i}`}>
                            <th scope="row" className="px-4 py-3.5 font-normal text-neutral-800 tabular-nums sm:px-5">
                              {r.income}
                            </th>
                            <td className="px-4 py-3.5 font-semibold text-neutral-950 tabular-nums sm:px-5">{r.pay}</td>
                          </tr>
                        ))}
                      </tbody>
                    </table>
                  </div>
                  {feeSource ? <p className="mt-3 text-xs leading-5 text-neutral-600">{feeSource}</p> : null}
                </div>
              ) : null}

              {hasContact ? (
                <aside
                  aria-label={contactHeading || "Insurance questions"}
                  className={`self-start rounded-2xl bg-indigo-50 p-6 ring-1 ring-indigo-600/15 ring-inset sm:p-8 ${feeHeading && rows.length ? "lg:col-span-5" : "lg:col-span-12"}`}
                >
                  {contactHeading ? <p className="text-xl font-semibold tracking-tight text-balance text-indigo-950">{contactHeading}</p> : null}
                  {contactText ? <p className="mt-2 text-base leading-7 text-pretty text-indigo-950/80">{contactText}</p> : null}
                  <div className="mt-6 flex flex-col gap-3">
                    {tel ? (
                      <a
                        href={`tel:${tel}`}
                        className={`inline-flex min-h-11 items-center justify-center gap-2 rounded-lg bg-indigo-600 px-5 py-2.5 text-base 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-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.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" clipRule="evenodd" />
                        </svg>
                        Call {phone}
                      </a>
                    ) : null}
                    {mail ? (
                      <a
                        href={`mailto:${mail}`}
                        className={`inline-flex min-h-11 min-w-0 items-center justify-center gap-2 rounded-lg bg-white px-4 py-2.5 text-sm font-semibold break-all text-indigo-700 ring-1 ring-indigo-200 ring-inset transition hover:bg-indigo-100 ${focusRing}`}
                      >
                        <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 shrink-0">
                          <path d="M3 4a2 2 0 0 0-2 2v1.161l8.441 4.221a1.25 1.25 0 0 0 1.118 0L19 7.162V6a2 2 0 0 0-2-2H3Z" />
                          <path d="m19 8.839-7.77 3.885a2.75 2.75 0 0 1-2.46 0L1 8.839V14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.839Z" />
                        </svg>
                        <span className="min-w-0">{mail}</span>
                      </a>
                    ) : null}
                  </div>
                </aside>
              ) : null}
            </div>
          ) : null}
        </div>
      </section>
    );
  },
};
```
