# Add the "Awards Row" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/awards-row) to this Pantheon Content Publisher (P1) Next.js project. Awards and accreditations drawn as CSS seals with year, full title, issuer and an optional verification link.

## Steps

1. Create `components/puck/awards-row-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 { awardsRowBlock } from "./components/puck/awards-row-block";`
3. Register it under `components` as `AwardsRowBlock: awardsRowBlock`.
4. Add `"AwardsRowBlock"` 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/awards-row-block.tsx`

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

/**
 * Awards Row — awards, ratings and accreditations as CSS-drawn seals (no artwork needed),
 * each with its full title, issuer, year and an optional link to the announcement.
 * Register: `AwardsRowBlock: awardsRowBlock` in puck.config.tsx.
 */

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

type Award = { sealText: string; title: string; issuer: string; year: string; href: string };

export type AwardsRowProps = {
  heading: string;
  headingLevel: Heading;
  intro: string;
  awards: Award[];
  note: string;
};

const subLevel = { h1: "h2", h2: "h3", h3: "h4", h4: "h5" } as const;

const Seal = ({ text, year, filled }: { text: string; year: string; filled: boolean }) => (
  <div aria-hidden="true" className="relative mx-auto w-fit">
    <svg viewBox="0 0 40 28" className={`absolute top-full left-1/2 -mt-6 h-12 w-auto -translate-x-1/2 ${filled ? "text-indigo-900" : "text-indigo-300"}`} fill="currentColor">
      <path d="M8 0h10v28l-5-5-5 5V0Zm14 0h10v28l-5-5-5 5V0Z" />
    </svg>
    <div
      className={`relative grid size-32 place-items-center rounded-full p-1.5 shadow-sm sm:size-36 ${
        filled ? "bg-indigo-700 ring-4 ring-indigo-100" : "bg-indigo-50 ring-1 ring-indigo-200"
      }`}
    >
      <div
        className={`flex size-full flex-col items-center justify-center gap-1 rounded-full border-2 border-dashed px-3 text-center ${
          filled ? "border-indigo-300 text-white" : "border-indigo-300 text-indigo-900"
        }`}
      >
        {year ? <span className={`text-xs font-semibold tracking-widest tabular-nums ${filled ? "text-indigo-100" : "text-indigo-700"}`}>{year}</span> : null}
        {text ? <span className="text-sm leading-tight font-bold tracking-wide text-balance uppercase sm:text-base sm:leading-tight">{text}</span> : null}
        <svg viewBox="0 0 44 8" fill="currentColor" className={`h-2 w-auto ${filled ? "text-indigo-200" : "text-indigo-400"}`}>
          {[4, 13, 22, 31, 40].map((cx) => (
            <path key={cx} d={`M${cx} 1l3 3-3 3-3-3Z`} />
          ))}
        </svg>
      </div>
    </div>
  </div>
);

export const awardsRowBlock: ComponentConfig<AwardsRowProps> = {
  label: "Awards Row",
  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." },
    },
    intro: { type: "textarea", label: "Intro", metadata: { help: "Optional sentence under the heading. Leave blank to hide it." } },
    awards: {
      type: "array",
      label: "Awards",
      min: 1,
      max: 8,
      getItemSummary: (item) => [item?.title, item?.year].filter(Boolean).join(" · ").slice(0, 48) || "Award",
      defaultItemProps: { sealText: "Award", title: "Full award name", issuer: "Who gave it", year: "2025", href: "" },
      arrayFields: {
        sealText: { type: "text", label: "Seal text", metadata: { help: "One or two short words inside the seal, like \"4-Star\" or \"Accredited\"." } },
        title: { type: "text", label: "Award name", metadata: { help: "The full, official name. Shown under the seal." } },
        issuer: { type: "text", label: "Issued by" },
        year: { type: "text", label: "Year", metadata: { help: "Shown inside the seal, such as 2025 or 2023–2025." } },
        href: { type: "text", label: "Link", metadata: { help: "Optional link to the issuer's announcement or listing, so visitors can verify it." } },
      },
    },
    note: { type: "text", label: "Note", metadata: { help: "Small line under the awards, such as a source or verification note. Leave blank to hide it." } },
  },
  defaultProps: {
    heading: "Recognized for how we work",
    headingLevel: "h2",
    intro: "Independent reviewers look at our finances, our programs and how we treat volunteers. Here's what they found.",
    note: "Sample recognitions for illustration. Issuers shown are fictional; link each award to its public announcement.",
    awards: [
      { sealText: "4-Star", title: "Four-Star Transparency Rating", issuer: "Civic Giving Review", year: "2025", href: "#" },
      { sealText: "Accredited", title: "Standards of Excellence Accreditation", issuer: "Regional Nonprofit Standards Council", year: "2024", href: "#" },
      { sealText: "Gold", title: "Gold Seal for Financial Reporting", issuer: "Open Ledger Initiative", year: "2025", href: "#" },
      { sealText: "Best Place", title: "Best Place to Volunteer", issuer: "Riverbend Community Awards", year: "2023–2025", href: "" },
    ],
  },
  render: ({ heading, headingLevel, intro, awards, note }) => {
    const H = headingLevel || "h2";
    const Sub = subLevel[headingLevel || "h2"];
    const list = (awards ?? []).filter((a) => a?.title || a?.sealText);
    const hasHeader = Boolean(heading || intro);

    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">
          {hasHeader ? (
            <div className="mx-auto max-w-2xl text-center">
              {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 > 0 ? (
            <ul role="list" className={`${hasHeader ? "mt-14 sm:mt-16" : ""} flex flex-wrap items-start justify-center gap-x-6 gap-y-14 sm:gap-x-12`}>
              {list.map((a, i) => (
                <li key={`${a.title}-${i}`} className="w-32 text-center sm:w-48">
                  <Seal text={a.sealText} year={a.year} filled={i % 2 === 1} />
                  <div className="mt-10">
                    {a.title ? (
                      <Sub className="text-sm leading-5 font-semibold text-balance text-neutral-950 sm:text-base sm:leading-6">
                        {a.href ? (
                          <a
                            href={a.href}
                            className="rounded-sm underline decoration-neutral-300 underline-offset-4 hover:decoration-indigo-600 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                          >
                            {a.title}
                          </a>
                        ) : (
                          a.title
                        )}
                      </Sub>
                    ) : null}
                    {a.issuer || a.year ? (
                      <p className="mt-1 text-sm leading-5 text-pretty text-neutral-600">
                        {a.issuer}
                        {a.issuer && a.year ? ", " : ""}
                        {a.year ? <span className="tabular-nums">{a.year}</span> : null}
                      </p>
                    ) : null}
                  </div>
                </li>
              ))}
            </ul>
          ) : null}

          {note ? <p className="mx-auto mt-14 max-w-2xl text-center text-xs leading-5 text-neutral-600">{note}</p> : null}
        </div>
      </section>
    );
  },
};
```
