# Add the "Quick Links Hero" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/hero-quick-links) to this Pantheon Content Publisher (P1) Next.js project. Photo hero with three or four task cards straddling its bottom edge, so top destinations are one tap away.

## Steps

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

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

/**
 * Hero (Quick Links) — a photo hero whose three or four task cards straddle its bottom
 * edge, so the most-used destinations sit one tap from the top of the page.
 * Register: `HeroQuickLinksBlock: heroQuickLinksBlock` in puck.config.tsx.
 */

type Heading = "h1" | "h2" | "h3" | "h4";
type Icon = "calendar" | "map" | "document" | "heart" | "users" | "academic" | "home" | "chat";

export type HeroQuickLinksProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  body: string;
  imageUrl: string;
  imageAlt: string;
  links: { icon: Icon; title: string; description: string; href: string }[];
};

// Heroicons (20px solid) paths, inlined so the block needs no icon package.
const ICONS: Record<Icon, string> = {
  calendar:
    "M5.75 2a.75.75 0 0 1 .75.75V4h7V2.75a.75.75 0 0 1 1.5 0V4h.25A2.75 2.75 0 0 1 18 6.75v8.5A2.75 2.75 0 0 1 15.25 18H4.75A2.75 2.75 0 0 1 2 15.25v-8.5A2.75 2.75 0 0 1 4.75 4H5V2.75A.75.75 0 0 1 5.75 2Zm-1 5.5c-.69 0-1.25.56-1.25 1.25v6.5c0 .69.56 1.25 1.25 1.25h10.5c.69 0 1.25-.56 1.25-1.25v-6.5c0-.69-.56-1.25-1.25-1.25H4.75Z",
  map: "m9.69 18.933.003.001C9.89 19.02 10 19 10 19s.11.02.308-.066l.002-.001.006-.003.018-.008a5.741 5.741 0 0 0 .281-.14c.186-.096.446-.24.757-.433.62-.384 1.445-.966 2.274-1.765C15.302 14.988 17 12.493 17 9A7 7 0 1 0 3 9c0 3.492 1.698 5.988 3.355 7.584a13.731 13.731 0 0 0 2.273 1.765 11.842 11.842 0 0 0 .976.544l.062.029.018.008.006.003ZM10 11.25a2.25 2.25 0 1 0 0-4.5 2.25 2.25 0 0 0 0 4.5Z",
  document:
    "M4.5 2A1.5 1.5 0 0 0 3 3.5v13A1.5 1.5 0 0 0 4.5 18h11a1.5 1.5 0 0 0 1.5-1.5V7.621a1.5 1.5 0 0 0-.44-1.06l-4.12-4.122A1.5 1.5 0 0 0 11.378 2H4.5Zm2.25 8.5a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Zm0 3a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Z",
  heart:
    "m9.653 16.915-.005-.003-.019-.01a20.759 20.759 0 0 1-1.162-.682 22.045 22.045 0 0 1-2.582-1.9C4.045 12.733 2 10.352 2 7.5a4.5 4.5 0 0 1 8-2.828A4.5 4.5 0 0 1 18 7.5c0 2.852-2.044 5.233-3.885 6.82a22.049 22.049 0 0 1-3.744 2.582l-.019.01-.005.003h-.002a.739.739 0 0 1-.69.001l-.002-.001Z",
  users:
    "M7 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM14.5 9a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM1.615 16.428a1.224 1.224 0 0 1-.569-1.175 6.002 6.002 0 0 1 11.908 0c.058.467-.172.92-.57 1.174A9.953 9.953 0 0 1 7 18a9.953 9.953 0 0 1-5.385-1.572ZM14.5 16h-.106c.07-.297.088-.611.048-.933a7.47 7.47 0 0 0-1.588-3.755 4.502 4.502 0 0 1 5.874 2.636.818.818 0 0 1-.36.98A7.465 7.465 0 0 1 14.5 16Z",
  academic:
    "M9.664 1.319a.75.75 0 0 1 .672 0 41.059 41.059 0 0 1 8.198 5.424.75.75 0 0 1-.254 1.285 31.372 31.372 0 0 0-7.86 3.83.75.75 0 0 1-.84 0 31.508 31.508 0 0 0-2.08-1.287V9.394c0-.244.116-.463.302-.592a35.504 35.504 0 0 1 3.305-2.033.75.75 0 0 0-.714-1.319 37 37 0 0 0-3.446 2.12A2.216 2.216 0 0 0 6 9.393v.38a31.293 31.293 0 0 0-4.28-1.746.75.75 0 0 1-.254-1.285 41.059 41.059 0 0 1 8.198-5.424ZM6 11.459a29.848 29.848 0 0 0-2.455-1.158 41.029 41.029 0 0 0-.39 3.114.75.75 0 0 0 .419.74c.528.256 1.046.53 1.554.82-.21.324-.455.63-.739.914a.75.75 0 1 0 1.06 1.06c.37-.369.69-.77.96-1.193a26.61 26.61 0 0 1 3.095 2.348.75.75 0 0 0 .992 0 26.547 26.547 0 0 1 5.93-3.95.75.75 0 0 0 .42-.739 41.053 41.053 0 0 0-.39-3.114 29.925 29.925 0 0 0-5.199 2.801 2.25 2.25 0 0 1-2.514 0c-.41-.275-.826-.541-1.25-.797a6.985 6.985 0 0 1-1.084 3.45 26.503 26.503 0 0 0-1.281-.78A5.487 5.487 0 0 0 6 12v-.54Z",
  home: "M9.293 2.293a1 1 0 0 1 1.414 0l7 7A1 1 0 0 1 17 11h-1v6a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-6H3a1 1 0 0 1-.707-1.707l7-7Z",
  chat: "M10 2c-2.236 0-4.43.18-6.57.524C1.993 2.755 1 4.014 1 5.426v5.148c0 1.413.993 2.67 2.43 2.902.848.137 1.705.248 2.57.331v3.443a.75.75 0 0 0 1.28.53l3.58-3.579a.78.78 0 0 1 .527-.224 41.202 41.202 0 0 0 5.183-.5c1.437-.232 2.43-1.49 2.43-2.903V5.426c0-1.413-.993-2.67-2.43-2.902A41.289 41.289 0 0 0 10 2Z",
};

const ICON_OPTIONS = [
  { label: "Calendar", value: "calendar" },
  { label: "Map pin", value: "map" },
  { label: "Document", value: "document" },
  { label: "Heart", value: "heart" },
  { label: "People", value: "users" },
  { label: "Graduation cap", value: "academic" },
  { label: "House", value: "home" },
  { label: "Chat", value: "chat" },
];

const CARD_HEADING: Record<Heading, "h2" | "h3" | "h4" | "h5"> = { h1: "h2", h2: "h3", h3: "h4", h4: "h5" };

const COLS: Record<number, string> = {
  1: "sm:grid-cols-1",
  2: "sm:grid-cols-2",
  3: "sm:grid-cols-3",
  4: "sm:grid-cols-2 lg:grid-cols-4",
};

export const heroQuickLinksBlock: ComponentConfig<HeroQuickLinksProps> = {
  label: "Hero (Quick Links)",
  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 (page title)", value: "h1" },
        { label: "H2", value: "h2" },
        { label: "H3", value: "h3" },
        { label: "H4", value: "h4" },
      ],
      metadata: { help: "Use H1 when this hero is the top of the page. The card titles use the next level down. The look doesn't change." },
    },
    body: { type: "textarea", label: "Body" },
    imageUrl: { type: "text", label: "Image URL", metadata: { help: "A wide photo behind the heading. Leave blank for a solid dark band." } },
    imageAlt: { type: "text", label: "Image alt text", metadata: { help: "Describe the photo for screen reader users. Leave blank only if it's purely decorative." } },
    links: {
      type: "array",
      label: "Quick links",
      min: 1,
      max: 4,
      getItemSummary: (item) => item?.title || "Link",
      defaultItemProps: { icon: "document", title: "New link", description: "One line about where this goes.", href: "#" },
      arrayFields: {
        icon: { type: "select", label: "Icon", options: ICON_OPTIONS },
        title: { type: "text", label: "Title" },
        description: { type: "text", label: "Description", metadata: { help: "One short line. Leave blank to hide it." } },
        href: { type: "text", label: "Link" },
      },
      metadata: { help: "Three or four of your most-used destinations. The whole card is the link." },
    },
  },
  defaultProps: {
    eyebrow: "Lakeview Park District",
    heading: "Play, learn and gather all year long",
    headingLevel: "h1",
    body: "Sixty-two parks, four community centers, two pools and a nature preserve, all run by and for the people of Lakeview.",
    imageUrl: "https://picsum.photos/seed/lakeshore/2400/1200",
    imageAlt: "Kayakers paddling past a wooded shoreline on a calm lake",
    links: [
      { icon: "calendar", title: "Register for programs", description: "Classes, camps and leagues for all ages", href: "/programs" },
      { icon: "map", title: "Find a park", description: "Trails, playgrounds and picnic shelters", href: "/parks" },
      { icon: "home", title: "Rent a facility", description: "Pavilions, gyms and meeting rooms", href: "/rentals" },
      { icon: "heart", title: "Fee assistance", description: "Reduced rates for qualifying households", href: "/assistance" },
    ],
  },
  render: ({ eyebrow, heading, headingLevel, body, imageUrl, imageAlt, links }) => {
    const H = headingLevel || "h1";
    const T = CARD_HEADING[H] ?? "h2";
    const cards = (links ?? []).filter((l) => l?.title).slice(0, 4);
    const cols = COLS[cards.length] ?? COLS[4];
    return (
      <section className="bg-white">
        <div className={`relative isolate overflow-hidden bg-neutral-900 px-4 pt-24 sm:px-6 sm:pt-28 lg:px-8 lg:pt-36 ${cards.length ? "pb-36 sm:pb-40" : "pb-16 sm:pb-20 lg:pb-24"}`}>
          {imageUrl ? <img src={imageUrl} alt={imageAlt || ""} className="absolute inset-0 -z-20 size-full object-cover" /> : null}
          <div aria-hidden="true" className="absolute inset-0 -z-10 bg-linear-to-b from-neutral-950/70 via-neutral-950/60 to-neutral-950/85" />
          <div className="mx-auto max-w-7xl">
            <div className="max-w-2xl">
              {eyebrow ? <p className="text-sm font-semibold tracking-widest text-indigo-200 uppercase">{eyebrow}</p> : null}
              {heading ? (
                <H className={`${eyebrow ? "mt-4" : ""} text-4xl font-semibold tracking-tight text-balance text-white sm:text-6xl`}>{heading}</H>
              ) : null}
              {body ? <p className="mt-6 text-lg leading-8 text-pretty text-neutral-200">{body}</p> : null}
            </div>
          </div>
        </div>

        {cards.length ? (
          <div className="px-4 pb-16 sm:px-6 sm:pb-20 lg:px-8 lg:pb-24">
            <ul className={`relative mx-auto -mt-24 grid max-w-7xl grid-cols-1 gap-4 sm:-mt-28 lg:gap-6 ${cols}`}>
              {cards.map((c, i) => {
                return (
                  <li key={`${c.title}-${i}`}>
                    <a
                      href={c.href || "#"}
                      className="group flex h-full min-h-11 flex-col rounded-2xl bg-white p-6 shadow-xl ring-1 ring-neutral-950/5 transition hover:-translate-y-1 hover:shadow-2xl focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                    >
                      <span aria-hidden="true" className="grid size-11 place-items-center rounded-xl bg-indigo-600 text-white">
                        <svg viewBox="0 0 20 20" fill="currentColor" className="size-5">
                          <path fillRule="evenodd" d={ICONS[c.icon] ?? ICONS.document} clipRule="evenodd" />
                        </svg>
                      </span>
                      <T className="mt-5 flex items-center justify-between gap-3 text-lg font-semibold text-neutral-950">
                        {c.title}
                        <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 shrink-0 text-indigo-600 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>
                      </T>
                      {c.description ? <p className="mt-1.5 text-sm leading-6 text-neutral-600">{c.description}</p> : null}
                    </a>
                  </li>
                );
              })}
            </ul>
          </div>
        ) : null}
      </section>
    );
  },
};
```
