# Add the "Press Quotes" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/press-quotes) to this Pantheon Content Publisher (P1) Next.js project. In-the-news pull quotes with typeset outlet wordmarks, dates and links to the original stories.

## Steps

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

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

/**
 * Press Quotes — "In the news" pull quotes from coverage, each with a typeset outlet
 * wordmark, date and link to the story. The first quote leads at a larger size.
 * Register: `PressQuotesBlock: pressQuotesBlock` in puck.config.tsx.
 */

type Heading = "h1" | "h2" | "h3" | "h4";
type Wordmark = "serif" | "caps" | "italic" | "bold";

type PressQuote = { outlet: string; wordmark: Wordmark; quote: string; date: string; href: string };

export type PressQuotesProps = {
  heading: string;
  headingLevel: Heading;
  quotes: PressQuote[];
  linkLabel: string;
  note: string;
};

const wordmarkClass: Record<Wordmark, string> = {
  serif: "font-serif text-xl font-semibold tracking-tight",
  caps: "text-sm font-bold tracking-widest uppercase",
  italic: "font-serif text-xl font-medium italic tracking-tight",
  bold: "text-lg font-black tracking-tighter",
};

const linkClass =
  "inline-flex min-h-11 items-center gap-1.5 rounded-md text-sm font-semibold text-indigo-700 hover:text-indigo-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600";

export const pressQuotesBlock: ComponentConfig<PressQuotesProps> = {
  label: "Press Quotes",
  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." },
    },
    quotes: {
      type: "array",
      label: "Coverage",
      min: 1,
      max: 7,
      getItemSummary: (item) => item?.outlet?.slice(0, 48) || "Press quote",
      defaultItemProps: { outlet: "Outlet name", wordmark: "serif", quote: "A line from the story, quoted exactly.", date: "", href: "" },
      arrayFields: {
        outlet: { type: "text", label: "Outlet" },
        wordmark: {
          type: "select",
          label: "Wordmark style",
          options: [
            { label: "Serif", value: "serif" },
            { label: "Spaced capitals", value: "caps" },
            { label: "Serif italic", value: "italic" },
            { label: "Heavy sans", value: "bold" },
          ],
          metadata: { help: "How the outlet name is typeset. Pick the style closest to the publication's masthead." },
        },
        quote: { type: "textarea", label: "Quote", metadata: { help: "Quote the published story word for word, and only from coverage you can link to." } },
        date: { type: "text", label: "Date", metadata: { help: "Publication date as you'd like it shown, such as \"March 12, 2025\"." } },
        href: { type: "text", label: "Story link", metadata: { help: "Link to the original story. Leave blank to hide the link." } },
      },
    },
    linkLabel: { type: "text", label: "Link text", metadata: { help: "Shown under each quote that has a link." } },
    note: { type: "text", label: "Note", metadata: { help: "Small line under the quotes. Leave blank to hide it." } },
  },
  defaultProps: {
    heading: "In the news",
    headingLevel: "h2",
    linkLabel: "Read the story",
    note: "Sample coverage for illustration. Outlets shown are fictional.",
    quotes: [
      {
        outlet: "The Riverbend Ledger",
        wordmark: "serif",
        quote: "What began as a single bookmobile has quietly become the most dependable link between the county's rural schools and its libraries.",
        date: "March 12, 2025",
        href: "#",
      },
      {
        outlet: "Commonfield Radio",
        wordmark: "caps",
        quote: "Volunteers here talk about the program the way people talk about a neighbor they can count on.",
        date: "January 28, 2025",
        href: "#",
      },
      {
        outlet: "Quarry Street Weekly",
        wordmark: "italic",
        quote: "A model other towns are already borrowing from.",
        date: "November 4, 2024",
        href: "#",
      },
    ],
  },
  render: ({ heading, headingLevel, quotes, linkLabel, note }) => {
    const H = headingLevel || "h2";
    const list = (quotes ?? []).filter((q) => q?.quote);
    const [lead, ...rest] = list;
    const cta = linkLabel || "Read the story";

    const attribution = (q: PressQuote, large: boolean) => (
      <figcaption className={`${large ? "mt-8" : "mt-5"} flex flex-col gap-1`}>
        {q.outlet ? (
          <cite className={`text-neutral-950 ${q.wordmark === "italic" ? "" : "not-italic"} ${wordmarkClass[q.wordmark] || wordmarkClass.serif}`}>{q.outlet}</cite>
        ) : null}
        {q.date ? <p className="text-sm text-neutral-600">{q.date}</p> : null}
        {q.href ? (
          <a href={q.href} className={linkClass}>
            {cta}
            {q.outlet ? <span className="sr-only"> in {q.outlet}</span> : null}
            <svg aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" className="size-3.5">
              <path d="M6.2 3.5a.75.75 0 0 0 0 1.5h3.74l-6.2 6.2a.75.75 0 1 0 1.06 1.06l6.2-6.2v3.74a.75.75 0 0 0 1.5 0V4.25a.75.75 0 0 0-.75-.75H6.2Z" />
            </svg>
          </a>
        ) : null}
      </figcaption>
    );

    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 ? (
            <div className="flex items-center gap-4">
              <H className="shrink-0 text-sm font-semibold tracking-widest text-indigo-700 uppercase">{heading}</H>
              <span aria-hidden="true" className="h-px flex-1 bg-neutral-200" />
            </div>
          ) : null}

          {lead ? (
            <div className={`${heading ? "mt-10 sm:mt-12" : ""} grid grid-cols-1 gap-12 lg:grid-cols-12 lg:gap-16`}>
              <figure className={rest.length ? "lg:col-span-7" : "lg:col-span-10"}>
                <blockquote className="font-serif text-3xl leading-tight font-medium tracking-tight text-pretty text-neutral-950 sm:text-4xl sm:leading-tight">
                  <p>
                    <span aria-hidden="true" className="text-indigo-600">“</span>
                    {lead.quote}
                    <span aria-hidden="true" className="text-indigo-600">”</span>
                  </p>
                </blockquote>
                {attribution(lead, true)}
              </figure>

              {rest.length ? (
                <ul role="list" className="divide-y divide-neutral-200 border-t border-neutral-200 lg:col-span-5 lg:border-t-0 lg:border-l lg:pl-12">
                  {rest.map((q, i) => (
                    <li key={`${q.outlet}-${i}`} className="py-8 lg:first:pt-0 lg:last:pb-0">
                      <figure>
                        <blockquote className="text-lg leading-8 text-pretty text-neutral-800">
                          <p>“{q.quote}”</p>
                        </blockquote>
                        {attribution(q, false)}
                      </figure>
                    </li>
                  ))}
                </ul>
              ) : null}
            </div>
          ) : null}

          {note ? <p className="mt-12 text-xs leading-5 text-neutral-600">{note}</p> : null}
        </div>
      </section>
    );
  },
};
```
