# Add the "CTA with Testimonial" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/cta-testimonial) to this Pantheon Content Publisher (P1) Next.js project. A large serif pull quote with portrait and attribution beside a CTA card with a primary button and a secondary link.

## Steps

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

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

/**
 * CTA with Testimonial — one person's words make the ask: a large pull quote with an optional
 * portrait and attribution, set beside a heading, short body and two calls to action.
 * Register: `CtaTestimonialBlock: ctaTestimonialBlock` in puck.config.tsx.
 */

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

export type CtaTestimonialProps = {
  quote: string;
  name: string;
  role: string;
  imageUrl: string;
  imageAlt: string;
  heading: string;
  headingLevel: Heading;
  body: string;
  primaryLabel: string;
  primaryHref: string;
  secondaryLabel: string;
  secondaryHref: string;
  quoteSide: "left" | "right";
};

export const ctaTestimonialBlock: ComponentConfig<CtaTestimonialProps> = {
  label: "CTA with Testimonial",
  fields: {
    quote: { type: "textarea", label: "Quote", metadata: { help: "One or two sentences in the person's own words. Quotation marks are added for you." } },
    name: { type: "text", label: "Name" },
    role: { type: "text", label: "Role or context", metadata: { help: "Such as \"Class of 2026, first-generation student\". Leave blank to hide it." } },
    imageUrl: { type: "text", label: "Portrait URL", metadata: { help: "A photo of the person quoted, with their permission. Leave blank to hide it." } },
    imageAlt: { type: "text", label: "Portrait alt text", metadata: { help: "Describe the photo, such as \"Maya Torres in the campus greenhouse\"." } },
    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." },
    },
    body: { type: "textarea", label: "Body" },
    primaryLabel: { type: "text", label: "Primary button text", metadata: { help: "Leave blank to hide the button." } },
    primaryHref: { type: "text", label: "Primary button link" },
    secondaryLabel: { type: "text", label: "Secondary link text", metadata: { help: "Leave blank to hide the link." } },
    secondaryHref: { type: "text", label: "Secondary link" },
    quoteSide: {
      type: "radio",
      label: "Quote side",
      options: [
        { label: "Left", value: "left" },
        { label: "Right", value: "right" },
      ],
      metadata: { help: "Which side the quote sits on wide screens. On phones the quote always comes first." },
    },
  },
  defaultProps: {
    quote:
      "I was the first in my family to fill out a financial aid form. The scholarship didn't just cover tuition, it meant I could quit my second job and actually sleep before exams.",
    name: "Maya Torres",
    role: "Class of 2026, Environmental Science",
    imageUrl: "https://picsum.photos/seed/scholar/640/800",
    imageAlt: "Maya Torres smiling in a campus greenhouse",
    heading: "Fund the next first-generation scholar",
    headingLevel: "h2",
    body: "The Opportunity Fund closes the gap between financial aid and the real cost of a degree. Gifts of any size are pooled and awarded each fall.",
    primaryLabel: "Give to the Opportunity Fund",
    primaryHref: "/give/opportunity-fund",
    secondaryLabel: "Read more student stories",
    secondaryHref: "/stories",
    quoteSide: "left",
  },
  render: ({ quote, name, role, imageUrl, imageAlt, heading, headingLevel, body, primaryLabel, primaryHref, secondaryLabel, secondaryHref, quoteSide }) => {
    const H = headingLevel || "h2";
    const hasQuote = Boolean(quote);
    const hasCta = Boolean(heading || body || primaryLabel || secondaryLabel);
    if (!hasQuote && !hasCta) return <></>;
    const right = quoteSide === "right";

    return (
      <section className="bg-neutral-50 px-4 py-16 sm:px-6 sm:py-20 lg:px-8 lg:py-24">
        <div className={`mx-auto grid grid-cols-1 items-center gap-12 lg:gap-16 ${hasQuote && hasCta ? "max-w-7xl lg:grid-cols-12" : "max-w-3xl"}`}>
          {hasQuote ? (
            <figure className={`relative ${hasCta ? `lg:col-span-7 ${right ? "lg:order-2" : ""}` : ""}`}>
              <svg aria-hidden="true" viewBox="0 0 64 48" fill="currentColor" className="size-12 text-indigo-600 sm:size-14">
                <path d="M0 48V28C0 12.5 8.2 3.2 24.5 0l3 6.6C19.3 9 15 13.8 14.4 21H26v27H0Zm38 0V28C38 12.5 46.2 3.2 62.5 0l3 6.6C57.3 9 53 13.8 52.4 21H64v27H38Z" />
              </svg>
              <blockquote className="mt-6">
                <p className="font-serif text-2xl leading-snug text-pretty text-neutral-950 sm:text-3xl lg:text-4xl lg:leading-tight">
                  &ldquo;{quote}&rdquo;
                </p>
              </blockquote>
              {name || role || imageUrl ? (
                <figcaption className="mt-8 flex items-center gap-4">
                  {imageUrl ? (
                    <img src={imageUrl} alt={imageAlt || ""} className="size-16 shrink-0 rounded-full object-cover ring-4 ring-white sm:size-20" />
                  ) : null}
                  <span className="min-w-0 border-l-2 border-indigo-600 pl-4">
                    {name ? <span className="block text-base font-semibold text-neutral-950">{name}</span> : null}
                    {role ? <span className="block text-sm leading-6 text-neutral-600">{role}</span> : null}
                  </span>
                </figcaption>
              ) : null}
            </figure>
          ) : null}

          {hasCta ? (
            <div className={hasQuote ? `lg:col-span-5 ${right ? "lg:order-1" : ""}` : ""}>
              <div className="rounded-3xl bg-white p-6 shadow-sm ring-1 ring-neutral-200 sm:p-10">
                {heading ? <H className="text-2xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-3xl">{heading}</H> : null}
                {body ? <p className={`text-base leading-7 text-pretty text-neutral-600 ${heading ? "mt-4" : ""}`}>{body}</p> : null}
                {primaryLabel || secondaryLabel ? (
                  <div className={`flex flex-col gap-3 ${heading || body ? "mt-8" : ""}`}>
                    {primaryLabel ? (
                      <a
                        href={primaryHref || "#"}
                        className="inline-flex min-h-12 items-center justify-center rounded-lg bg-indigo-600 px-6 py-3 text-center text-base font-semibold text-white shadow-xs transition hover:bg-indigo-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                      >
                        {primaryLabel}
                      </a>
                    ) : null}
                    {secondaryLabel ? (
                      <a
                        href={secondaryHref || "#"}
                        className="inline-flex min-h-11 items-center justify-center rounded-lg px-6 py-3 text-center text-base font-semibold text-indigo-700 ring-1 ring-indigo-200 ring-inset transition hover:bg-indigo-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                      >
                        {secondaryLabel}
                      </a>
                    ) : null}
                  </div>
                ) : null}
              </div>
            </div>
          ) : null}
        </div>
      </section>
    );
  },
};
```
