# Add the "Content + Image" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/content-split) to this Pantheon Content Publisher (P1) Next.js project. Editorial text with a checklist and link beside a captioned image. The workhorse section.

## Steps

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

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

/**
 * Content Split — an image beside a heading, paragraphs, a short checklist and a link.
 * Image stacks first on mobile and can sit on either side on desktop, with an optional caption.
 * Register: `ContentSplitBlock: contentSplitBlock` in puck.config.tsx.
 */

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

export type ContentSplitProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  body: string;
  checklist: { text: string }[];
  ctaLabel: string;
  ctaHref: string;
  imageUrl: string;
  imageAlt: string;
  imageCaption: string;
  imageSide: "left" | "right";
};

export const contentSplitBlock: ComponentConfig<ContentSplitProps> = {
  label: "Content Split",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "Small line above the heading. Leave blank to hide it." } },
    heading: { type: "textarea", 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." },
    },
    body: { type: "textarea", label: "Body", metadata: { help: "Blank lines start a new paragraph." } },
    checklist: {
      type: "array",
      label: "Checklist",
      min: 0,
      max: 8,
      getItemSummary: (item) => item?.text?.slice(0, 48) || "Item",
      defaultItemProps: { text: "Another reason to get involved" },
      arrayFields: {
        text: { type: "text", label: "Text" },
      },
      metadata: { help: "Short points shown with check marks. Remove every item to hide the list." },
    },
    ctaLabel: { type: "text", label: "Link text", metadata: { help: "Leave blank to hide the link." } },
    ctaHref: { type: "text", label: "Link", metadata: { help: "A path (/volunteer), full URL, #anchor, mailto: or tel:." } },
    imageUrl: { type: "text", label: "Image URL" },
    imageAlt: { type: "text", label: "Image alt text", metadata: { help: "Describe the photo for screen reader users. Leave blank only if it's purely decorative." } },
    imageCaption: { type: "text", label: "Image caption", metadata: { help: "Shown under the photo, like a credit or location. Leave blank to hide it." } },
    imageSide: {
      type: "radio",
      label: "Image side",
      options: [
        { label: "Left", value: "left" },
        { label: "Right", value: "right" },
      ],
    },
  },
  defaultProps: {
    eyebrow: "Volunteer",
    heading: "Two hours a month can change a whole block",
    headingLevel: "h2",
    body: "Our neighborhood stewards adopt a park, a trail segment or a schoolyard garden and keep it thriving season after season.\n\nNo experience needed. We provide training, tools and a crew lead who knows every corner of the site.",
    checklist: [
      { text: "Flexible weekend and weekday evening shifts" },
      { text: "Gloves, tools and water provided on site" },
      { text: "Family-friendly, with roles for ages 8 and up" },
      { text: "Service hours verified for school and court programs" },
    ],
    ctaLabel: "Become a steward",
    ctaHref: "/volunteer",
    imageUrl: "https://picsum.photos/seed/stewards/1200/1000",
    imageAlt: "Volunteers in work gloves planting native grasses along a creek bank",
    imageCaption: "Stewards restoring the Mill Creek trail, spring 2025",
    imageSide: "left",
  },
  render: ({ eyebrow, heading, headingLevel, body, checklist, ctaLabel, ctaHref, imageUrl, imageAlt, imageCaption, imageSide }) => {
    const H = headingLevel || "h2";
    const imageRight = imageSide === "right";
    const paragraphs = (body || "").split(/\n\s*\n/).map((p) => p.trim()).filter(Boolean);
    const items = (checklist ?? []).filter((item) => item?.text);
    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 grid gap-10 ${imageUrl ? "max-w-7xl lg:grid-cols-2 lg:items-center lg:gap-16 xl:gap-24" : "max-w-3xl"}`}>
          {imageUrl ? (
            <figure className={imageRight ? "lg:order-last" : undefined}>
              <img
                src={imageUrl}
                alt={imageAlt || ""}
                className="aspect-[4/3] w-full rounded-2xl bg-neutral-100 object-cover shadow-xl ring-1 ring-neutral-900/5 lg:aspect-[5/6]"
              />
              {imageCaption ? (
                <figcaption className="mt-4 flex items-start gap-3 text-sm leading-6 text-neutral-600">
                  <span aria-hidden="true" className="mt-3 h-px w-6 shrink-0 bg-indigo-600" />
                  <span>{imageCaption}</span>
                </figcaption>
              ) : null}
            </figure>
          ) : null}

          <div>
            {eyebrow ? <p className="text-sm font-semibold tracking-wide text-indigo-700 uppercase">{eyebrow}</p> : null}
            {heading ? (
              <H className={`${eyebrow ? "mt-3" : ""} text-3xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-4xl`}>{heading}</H>
            ) : null}
            {paragraphs.length > 0 ? (
              <div className="mt-6 space-y-4 text-lg leading-8 text-pretty text-neutral-600">
                {paragraphs.map((para, i) => (
                  <p key={i}>{para}</p>
                ))}
              </div>
            ) : null}
            {items.length > 0 ? (
              <ul role="list" className="mt-8 space-y-3 border-t border-neutral-200 pt-8">
                {items.map((item, i) => (
                  <li key={`${item.text}-${i}`} className="flex gap-3 text-base leading-7 text-neutral-800">
                    <span aria-hidden="true" className="mt-1 grid size-5 shrink-0 place-items-center rounded-full bg-indigo-600 text-white">
                      <svg viewBox="0 0 16 16" fill="currentColor" className="size-3.5">
                        <path fillRule="evenodd" d="M12.416 3.376a.75.75 0 0 1 .208 1.04l-5 7.5a.75.75 0 0 1-1.154.114l-3-3a.75.75 0 0 1 1.06-1.06l2.353 2.353 4.493-6.74a.75.75 0 0 1 1.04-.207Z" clipRule="evenodd" />
                      </svg>
                    </span>
                    <span>{item.text}</span>
                  </li>
                ))}
              </ul>
            ) : null}
            {ctaLabel ? (
              <a
                href={ctaHref || "#"}
                className="mt-10 inline-flex min-h-11 items-center justify-center gap-1.5 rounded-lg bg-indigo-600 px-5 py-3 text-base font-semibold text-white shadow-sm transition hover:bg-indigo-500 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
              >
                {ctaLabel}
                <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-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}
          </div>
        </div>
      </section>
    );
  },
};
```
