# Add the "Things to Do" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/things-to-do) to this Pantheon Content Publisher (P1) Next.js project. Magazine-spread photo tiles for activity categories, each with a place count and a link into the listings.

## Steps

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

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

/**
 * Things to Do — magazine-style category tiles (Outdoors, Food & drink, Arts…) for a
 * destination's front door, each a full photo with a place count and a link into the listings.
 * Register: `ThingsToDoBlock: thingsToDoBlock` in puck.config.tsx.
 */

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

export type ThingsToDoProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  allLabel: string;
  allHref: string;
  categories: {
    name: string;
    count: string;
    blurb: string;
    imageUrl: string;
    imageAlt: string;
    href: string;
  }[];
};

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

// A twelve-column spread: one lead story spanning two rows, a pair stacked beside it, then a row of three.
const SPREAD: { span: string; height: string }[] = [
  { span: "sm:col-span-2 lg:col-span-7 lg:row-span-2", height: "min-h-80 sm:min-h-96" },
  { span: "lg:col-span-5", height: "min-h-64" },
  { span: "lg:col-span-5", height: "min-h-64" },
  { span: "lg:col-span-4", height: "min-h-64 lg:min-h-80" },
  { span: "lg:col-span-4", height: "min-h-64 lg:min-h-80" },
  { span: "lg:col-span-4", height: "min-h-64 lg:min-h-80" },
];

const ARROW = "M2 8a.75.75 0 0 1 .75-.75h8.69L8.22 4.03a.75.75 0 0 1 1.06-1.06l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 0 1-1.06-1.06l3.22-3.22H2.75A.75.75 0 0 1 2 8Z";

export const thingsToDoBlock: ComponentConfig<ThingsToDoProps> = {
  label: "Things to Do",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "Small line above the heading. Leave blank to hide it." } },
    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. Category names use the next level down." },
    },
    intro: { type: "textarea", label: "Intro" },
    allLabel: { type: "text", label: "See-all link text", metadata: { help: "Shown beside the heading. Leave blank to hide it." } },
    allHref: { type: "text", label: "See-all link" },
    categories: {
      type: "array",
      label: "Categories",
      min: 1,
      max: 9,
      getItemSummary: (item) => `${item?.name || "Category"}${item?.count ? ` (${item.count})` : ""}`,
      defaultItemProps: {
        name: "New category",
        count: "12 places",
        blurb: "",
        imageUrl: "https://picsum.photos/seed/riverbend-category/1200/900",
        imageAlt: "",
        href: "#",
      },
      arrayFields: {
        name: { type: "text", label: "Name" },
        count: { type: "text", label: "Count", metadata: { help: "Short text shown on the photo, like “48 places”. Leave blank to hide it." } },
        blurb: { type: "textarea", label: "Blurb", metadata: { help: "One line. The first tile shows it on every screen; the others show it on wider screens only." } },
        imageUrl: { type: "text", label: "Image URL", metadata: { help: "The first tile is the large one. The bottom of every photo sits under the text, so pick photos with calm bottoms." } },
        imageAlt: { type: "text", label: "Image alt text", metadata: { help: "Describe the photo for screen reader users. Leave blank only if it's purely decorative." } },
        href: { type: "text", label: "Link", metadata: { help: "Where the whole tile goes, usually the filtered listings page." } },
      },
    },
  },
  defaultProps: {
    eyebrow: "Things to do",
    heading: "Pick a mood, we'll point the way",
    headingLevel: "h2",
    intro: "Riverbend packs a river town's worth of trails, kitchens, studios and late-night porches into a walkable downtown. Start with what you love.",
    allLabel: "Browse all 300+ listings",
    allHref: "/things-to-do",
    categories: [
      {
        name: "Outdoors",
        count: "48 places",
        blurb: "Paddle the bend, bike the levee trail or catch sunset from Bluff Overlook.",
        imageUrl: "https://picsum.photos/seed/riverbend-outdoors/1400/1100",
        imageAlt: "Kayakers paddling a calm river past wooded bluffs",
        href: "/things-to-do/outdoors",
      },
      {
        name: "Food & drink",
        count: "112 places",
        blurb: "Smokehouses, bakeries and a riverfront brewery row.",
        imageUrl: "https://picsum.photos/seed/riverbend-food/1000/700",
        imageAlt: "Shared plates and drinks on a long wooden table at an outdoor patio",
        href: "/things-to-do/food-drink",
      },
      {
        name: "Arts & culture",
        count: "36 places",
        blurb: "Galleries in old tobacco warehouses and a 1920s movie palace.",
        imageUrl: "https://picsum.photos/seed/riverbend-arts/1000/700",
        imageAlt: "Visitors looking at large paintings in a brick-walled gallery",
        href: "/things-to-do/arts",
      },
      {
        name: "Family fun",
        count: "41 places",
        blurb: "Splash pads, a hands-on science museum and the carousel.",
        imageUrl: "https://picsum.photos/seed/riverbend-family/900/800",
        imageAlt: "A child laughing on a painted wooden carousel horse",
        href: "/things-to-do/family",
      },
      {
        name: "Nightlife",
        count: "27 places",
        blurb: "Listening rooms, rooftop bars and Thursday jazz on Front Street.",
        imageUrl: "https://picsum.photos/seed/riverbend-night/900/800",
        imageAlt: "A band playing under string lights in a crowded courtyard at night",
        href: "/things-to-do/nightlife",
      },
      {
        name: "Shopping",
        count: "64 places",
        blurb: "Makers' shops, antique malls and the Saturday farmers market.",
        imageUrl: "https://picsum.photos/seed/riverbend-shops/900/800",
        imageAlt: "A brick main street lined with shop awnings and flower boxes",
        href: "/things-to-do/shopping",
      },
    ],
  },
  render: ({ eyebrow, heading, headingLevel, intro, allLabel, allHref, categories }) => {
    const H = headingLevel || "h2";
    const Item = childHeading[H] ?? "h3";
    const list = (categories ?? []).filter((c) => c?.name);
    const hasHeader = Boolean(eyebrow || heading || intro || allLabel);
    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="grid grid-cols-1 gap-6 lg:grid-cols-12 lg:items-end lg:gap-8">
              <div className="lg:col-span-7">
                {eyebrow ? (
                  <p className="flex items-center gap-3 text-sm font-semibold tracking-widest text-indigo-700 uppercase">
                    <span aria-hidden="true" className="h-px w-8 bg-indigo-600" />
                    {eyebrow}
                  </p>
                ) : null}
                {heading ? (
                  <H className={`${eyebrow ? "mt-4" : ""} text-4xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-5xl`}>{heading}</H>
                ) : null}
              </div>
              <div className="lg:col-span-5">
                {intro ? <p className="text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
                {allLabel ? (
                  <a
                    href={allHref || "#"}
                    className="group mt-3 inline-flex min-h-11 items-center gap-1.5 rounded-sm 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"
                  >
                    {allLabel}
                    <svg aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" className="size-4 transition group-hover:translate-x-0.5">
                      <path fillRule="evenodd" d={ARROW} clipRule="evenodd" />
                    </svg>
                  </a>
                ) : null}
              </div>
            </div>
          ) : null}

          {list.length > 0 ? (
            <ul role="list" className={`${hasHeader ? "mt-12 sm:mt-14" : ""} grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-12 lg:gap-5`}>
              {list.map((cat, i) => {
                const lead = i === 0;
                const spot = SPREAD[i % SPREAD.length];
                return (
                  <li key={`${cat.name}-${i}`} className={`flex ${spot.span}`}>
                    <a
                      href={cat.href || "#"}
                      className={`group relative isolate flex w-full ${spot.height} flex-col justify-end overflow-hidden rounded-3xl bg-neutral-800 p-6 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-indigo-600 sm:p-7`}
                    >
                      {cat.imageUrl ? (
                        <img
                          src={cat.imageUrl}
                          alt={cat.imageAlt || ""}
                          className="absolute inset-0 -z-20 size-full object-cover transition duration-700 ease-out group-hover:scale-105 motion-reduce:transition-none motion-reduce:group-hover:scale-100"
                        />
                      ) : null}
                      <div aria-hidden="true" className="absolute inset-0 -z-10 bg-linear-to-t from-neutral-950/90 via-neutral-950/45 to-neutral-950/0" />
                      {cat.count ? (
                        <span className="absolute top-5 left-5 rounded-full bg-white/95 px-3 py-1 text-xs font-semibold text-neutral-900 tabular-nums shadow-sm sm:top-6 sm:left-6">
                          {cat.count}
                        </span>
                      ) : null}
                      <div className="flex items-end justify-between gap-4">
                        <div className="min-w-0">
                          <Item className={`font-semibold tracking-tight text-balance text-white ${lead ? "text-3xl sm:text-4xl lg:text-5xl" : "text-2xl"}`}>{cat.name}</Item>
                          {cat.blurb ? (
                            <p className={`mt-2 max-w-md text-sm leading-6 text-pretty text-neutral-200 sm:text-base ${lead ? "" : "hidden sm:block"}`}>{cat.blurb}</p>
                          ) : null}
                        </div>
                        <span
                          aria-hidden="true"
                          className="grid size-11 shrink-0 place-items-center rounded-full bg-white text-neutral-950 transition group-hover:-translate-y-0.5 group-hover:bg-indigo-50"
                        >
                          <svg viewBox="0 0 16 16" fill="currentColor" className="size-4">
                            <path fillRule="evenodd" d={ARROW} clipRule="evenodd" />
                          </svg>
                        </span>
                      </div>
                    </a>
                  </li>
                );
              })}
            </ul>
          ) : null}
        </div>
      </section>
    );
  },
};
```
