# Add the "Impact Story" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/impact-story) to this Pantheon Content Publisher (P1) Next.js project. A magazine-style story about one person you served, with large photo, drop cap, margin stat and pull quote.

## Steps

1. Create `components/puck/impact-story-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 { impactStoryBlock } from "./components/puck/impact-story-block";`
3. Register it under `components` as `ImpactStoryBlock: impactStoryBlock`.
4. Add `"ImpactStoryBlock"` 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/impact-story-block.tsx`

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

/**
 * Impact Story — a long-form, magazine-style story about one person your work reached:
 * large photo, a drop-cap opening, one stat set in the margin and a pull quote.
 * Register: `ImpactStoryBlock: impactStoryBlock` in puck.config.tsx.
 */

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

export type ImpactStoryProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  dek: string;
  imageUrl: string;
  imageAlt: string;
  caption: string;
  body: string;
  opening: "dropcap" | "lead";
  statValue: string;
  statLabel: string;
  statSource: string;
  quote: string;
  quoteName: string;
  quoteRole: string;
  linkLabel: string;
  linkHref: string;
};

export const impactStoryBlock: ComponentConfig<ImpactStoryProps> = {
  label: "Impact Story",
  fields: {
    eyebrow: {
      type: "text",
      label: "Eyebrow",
      metadata: {
        help: "Small line above the headline, like the program name. Leave blank to hide it.",
      },
    },
    heading: { type: "textarea", label: "Headline" },
    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.",
      },
    },
    dek: {
      type: "textarea",
      label: "Summary",
      metadata: {
        help: "One or two sentences under the headline. Leave blank to hide it.",
      },
    },
    imageUrl: { type: "text", label: "Image URL" },
    imageAlt: {
      type: "text",
      label: "Image alt text",
      metadata: {
        help: "Describe the photo for screen reader users. Get consent before showing anyone you serve.",
      },
    },
    caption: {
      type: "text",
      label: "Caption",
      metadata: { help: "Shown under the photo. Leave blank to hide it." },
    },
    body: {
      type: "textarea",
      label: "Story",
      metadata: {
        help: "Blank lines start a new paragraph. The pull quote appears after the second paragraph.",
      },
    },
    opening: {
      type: "radio",
      label: "First paragraph",
      options: [
        { label: "Drop cap", value: "dropcap" },
        { label: "Larger lead", value: "lead" },
      ],
    },
    statValue: {
      type: "text",
      label: "Stat number",
      metadata: {
        help: "Short, like 94% or 1,200. Sits in the margin on wide screens. Leave blank to hide it.",
      },
    },
    statLabel: { type: "textarea", label: "Stat label" },
    statSource: {
      type: "text",
      label: "Stat source",
      metadata: {
        help: "Where the number comes from, like Source: 2025 program survey.",
      },
    },
    quote: {
      type: "textarea",
      label: "Pull quote",
      metadata: { help: "Leave blank to hide it." },
    },
    quoteName: { type: "text", label: "Quote name" },
    quoteRole: {
      type: "text",
      label: "Quote role",
      metadata: { help: "Like Mentee since 2023. Leave blank to hide it." },
    },
    linkLabel: {
      type: "text",
      label: "Link text",
      metadata: {
        help: "Shown at the end of the story. Leave blank to hide it.",
      },
    },
    linkHref: { type: "text", label: "Link" },
  },
  defaultProps: {
    eyebrow: "Mentor Match · Stories",
    heading: "The Tuesday table where Dani found her footing",
    headingLevel: "h2",
    dek: "Two years ago she was skipping class. This spring she walked into her first college visit with a list of questions and a mentor in the next seat.",
    imageUrl: "https://picsum.photos/seed/mentortable/1600/1000",
    imageAlt:
      "A teenager and an adult mentor working through a notebook together at a library table",
    caption:
      "Dani and her mentor, Ruth, at the Eastgate branch library, where they have met every Tuesday since 2023.",
    body: "Every Tuesday at four, Dani takes the same seat at the corner table of the Eastgate library. Ruth is usually there first, with two cups of cocoa and whatever Dani forgot to bring.\n\nWhen they were matched, Dani was fifteen and had missed more school than she had attended that fall. She did not want a mentor. She wanted to be left alone. Ruth, a retired bus driver, decided the first goal was simply to keep showing up.\n\nIt took most of a year. They worked on algebra, then on a résumé for a summer job at the garden center, then on the harder conversations about home. Our program staff checked in every month and connected the family with a tutor and a bus pass.\n\nThis spring, Dani asked Ruth to come with her on a campus visit. She brought a notebook of questions she had written herself. Ruth says she mostly carried the umbrella.",
    opening: "dropcap",
    statValue: "87%",
    statLabel: "of mentees matched for a full year improved school attendance",
    statSource:
      "Source: Riverbend Mentoring 2025 program records (sample data)",
    quote:
      "She never once told me what I should be. She just kept asking what I wanted, and waited until I had an answer.",
    quoteName: "Dani R.",
    quoteRole: "Mentee since 2023",
    linkLabel: "Read more stories",
    linkHref: "/stories",
  },
  render: ({
    eyebrow,
    heading,
    headingLevel,
    dek,
    imageUrl,
    imageAlt,
    caption,
    body,
    opening,
    statValue,
    statLabel,
    statSource,
    quote,
    quoteName,
    quoteRole,
    linkLabel,
    linkHref,
  }) => {
    const H = headingLevel || "h2";
    const paragraphs = (body || "")
      .split(/\n\s*\n/)
      .map((p) => p.trim())
      .filter(Boolean);
    const quoteAfter = Math.min(2, paragraphs.length);
    const hasStat = Boolean(statValue || statLabel);
    const firstClass =
      opening === "lead"
        ? "text-xl leading-8 text-neutral-900 sm:text-2xl sm:leading-9"
        : "flow-root text-neutral-800 first-letter:float-left first-letter:mt-1 first-letter:mr-3 first-letter:font-serif first-letter:text-6xl first-letter:leading-none first-letter:font-semibold first-letter:text-indigo-700 sm:first-letter:text-7xl";

    const pullQuote = quote ? (
      <figure className="my-10 border-l-2 border-indigo-600 pl-6 sm:my-12 sm:pl-8">
        <blockquote>
          <p className="font-serif text-2xl leading-snug text-pretty text-neutral-950 italic sm:text-3xl sm:leading-snug">
            <span aria-hidden="true" className="text-indigo-600">
              “
            </span>
            {quote}
            <span aria-hidden="true" className="text-indigo-600">
              ”
            </span>
          </p>
        </blockquote>
        {quoteName || quoteRole ? (
          <figcaption className="mt-5 text-sm leading-6 text-neutral-600">
            {quoteName ? (
              <span className="font-semibold text-neutral-950">
                {quoteName}
              </span>
            ) : null}
            {quoteName && quoteRole ? (
              <span aria-hidden="true"> · </span>
            ) : null}
            {quoteRole ? <span>{quoteRole}</span> : null}
          </figcaption>
        ) : null}
      </figure>
    ) : null;

    return (
      <section className="bg-white px-4 py-16 sm:px-6 sm:py-20 lg:px-8 lg:py-24">
        <article className="mx-auto max-w-7xl">
          <header className="mx-auto max-w-3xl text-center">
            {eyebrow ? (
              <p className="text-xs font-semibold tracking-widest text-indigo-700 uppercase">
                {eyebrow}
              </p>
            ) : null}
            {heading ? (
              <H className="mt-4 font-serif text-4xl leading-tight font-semibold tracking-tight text-balance text-neutral-950 sm:text-5xl lg:text-6xl lg:leading-none">
                {heading}
              </H>
            ) : null}
            {dek ? (
              <p className="mx-auto mt-6 max-w-2xl text-lg leading-8 text-pretty text-neutral-600">
                {dek}
              </p>
            ) : null}
          </header>

          {imageUrl ? (
            <figure className="mx-auto mt-12 max-w-5xl sm:mt-16">
              <img
                src={imageUrl}
                alt={imageAlt || ""}
                className="aspect-[3/2] w-full rounded-2xl bg-neutral-100 object-cover sm:aspect-[16/9]"
              />
              {caption ? (
                <figcaption className="mt-3 text-sm leading-6 text-pretty text-neutral-600">
                  {caption}
                </figcaption>
              ) : null}
            </figure>
          ) : null}

          <div className="mx-auto mt-12 grid max-w-5xl gap-10 sm:mt-16 lg:grid-cols-12 lg:gap-12">
            {hasStat ? (
              <aside className="border-y border-neutral-200 py-6 lg:col-span-3 lg:self-start lg:border-y-0 lg:border-t-2 lg:border-indigo-600 lg:pt-5 lg:pb-0">
                {statValue ? (
                  <p className="font-serif text-5xl font-semibold tracking-tight text-indigo-700 tabular-nums">
                    {statValue}
                  </p>
                ) : null}
                {statLabel ? (
                  <p className="mt-3 text-base leading-6 font-medium text-pretty text-neutral-900">
                    {statLabel}
                  </p>
                ) : null}
                {statSource ? (
                  <p className="mt-3 text-xs leading-5 text-neutral-600">
                    {statSource}
                  </p>
                ) : null}
              </aside>
            ) : null}

            <div
              className={
                hasStat
                  ? "lg:col-span-8 lg:col-start-5"
                  : "lg:col-span-8 lg:col-start-3"
              }
            >
              <div className="max-w-prose text-lg leading-8 text-pretty text-neutral-700">
                {paragraphs.map((para, i) => (
                  <div key={i}>
                    <p
                      className={`${i === 0 ? firstClass : ""} ${i > 0 ? "mt-6" : ""}`}
                    >
                      {para}
                    </p>
                    {i === quoteAfter - 1 ? pullQuote : null}
                  </div>
                ))}
                {paragraphs.length === 0 ? pullQuote : null}
              </div>

              {linkLabel ? (
                <div className="mt-12 max-w-prose border-t border-neutral-200 pt-8">
                  <a
                    href={linkHref || "#"}
                    className="group inline-flex min-h-11 items-center gap-2 rounded-lg text-base font-semibold text-indigo-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                  >
                    {linkLabel}
                    <svg
                      aria-hidden="true"
                      viewBox="0 0 20 20"
                      fill="currentColor"
                      className="size-5 transition group-hover:translate-x-1"
                    >
                      <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>
                </div>
              ) : null}
            </div>
          </div>
        </article>
      </section>
    );
  },
};
```
