# Add the "Where to Stay" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/where-to-stay) to this Pantheon Content Publisher (P1) Next.js project. Lodging listings grouped by type with jump links, photos, price bands, amenity tags and booking links.

## Steps

1. Create `components/puck/where-to-stay-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 { whereToStayBlock } from "./components/puck/where-to-stay-block";`
3. Register it under `components` as `WhereToStayBlock: whereToStayBlock`.
4. Add `"WhereToStayBlock"` 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/where-to-stay-block.tsx`

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

/**
 * Where to Stay — lodging listings grouped by type (hotels, inns, B&Bs, campgrounds) with
 * jump links, each with a photo, neighborhood, price band, amenities and a booking link.
 * Register: `WhereToStayBlock: whereToStayBlock` in puck.config.tsx.
 */

type Heading = "h1" | "h2" | "h3" | "h4";
type LodgingType = "hotel" | "inn" | "bnb" | "campground";
type Price = "1" | "2" | "3" | "4";

export type WhereToStayProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  listings: {
    name: string;
    type: LodgingType;
    neighborhood: string;
    price: Price;
    description: string;
    amenities: string;
    imageUrl: string;
    imageAlt: string;
    linkLabel: string;
    linkHref: string;
  }[];
  footnote: string;
};

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

const TYPES: { value: LodgingType; label: string }[] = [
  { value: "hotel", label: "Hotels" },
  { value: "inn", label: "Inns" },
  { value: "bnb", label: "B&Bs" },
  { value: "campground", label: "Campgrounds" },
];

const PRICE_WORDS: Record<Price, string> = { "1": "Budget", "2": "Moderate", "3": "Upscale", "4": "Luxury" };

const FOCUS = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600";
const EXTERNAL = "M4.25 5.5a.75.75 0 0 0-.75.75v8.5c0 .414.336.75.75.75h8.5a.75.75 0 0 0 .75-.75v-4a.75.75 0 0 1 1.5 0v4A2.25 2.25 0 0 1 12.75 17h-8.5A2.25 2.25 0 0 1 2 14.75v-8.5A2.25 2.25 0 0 1 4.25 4h5a.75.75 0 0 1 0 1.5h-5Zm7.25-.75a.75.75 0 0 1 .75-.75h3.5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0V6.56l-5.22 5.22a.75.75 0 1 1-1.06-1.06l5.22-5.22h-1.69a.75.75 0 0 1-.75-.75Z";

const splitTags = (raw: string) => (raw || "").split(",").map((t) => t.trim()).filter(Boolean);

export const whereToStayBlock: ComponentConfig<WhereToStayProps> = {
  label: "Where to Stay",
  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. Lodging types use the next level down, listing names the level after." },
    },
    intro: { type: "textarea", label: "Intro" },
    listings: {
      type: "array",
      label: "Listings",
      min: 1,
      max: 24,
      getItemSummary: (item) => `${item?.name || "Listing"}${item?.type ? ` (${TYPES.find((t) => t.value === item.type)?.label ?? item.type})` : ""}`,
      defaultItemProps: {
        name: "New place to stay",
        type: "hotel",
        neighborhood: "",
        price: "2",
        description: "",
        amenities: "Free Wi-Fi, Parking",
        imageUrl: "https://picsum.photos/seed/riverbend-stay/900/700",
        imageAlt: "",
        linkLabel: "Book now",
        linkHref: "#",
      },
      arrayFields: {
        name: { type: "text", label: "Name" },
        type: {
          type: "select",
          label: "Type",
          options: [
            { label: "Hotel", value: "hotel" },
            { label: "Inn", value: "inn" },
            { label: "B&B", value: "bnb" },
            { label: "Campground", value: "campground" },
          ],
          metadata: { help: "Listings are grouped by type, with jump links at the top." },
        },
        neighborhood: { type: "text", label: "Neighborhood" },
        price: {
          type: "select",
          label: "Price band",
          options: [
            { label: "$ (budget)", value: "1" },
            { label: "$$ (moderate)", value: "2" },
            { label: "$$$ (upscale)", value: "3" },
            { label: "$$$$ (luxury)", value: "4" },
          ],
        },
        description: { type: "textarea", label: "Description", metadata: { help: "One or two sentences. Leave blank to hide it." } },
        amenities: { type: "text", label: "Amenities", metadata: { help: "Comma separated, like “Pool, Pet friendly, Free breakfast”." } },
        imageUrl: { type: "text", label: "Image URL" },
        imageAlt: { type: "text", label: "Image alt text", metadata: { help: "Describe the photo for screen reader users. Leave blank only if it's purely decorative." } },
        linkLabel: { type: "text", label: "Link text", metadata: { help: "Like “Book now” or “Visit website”. Leave blank to hide it." } },
        linkHref: { type: "text", label: "Link" },
      },
    },
    footnote: { type: "textarea", label: "Footnote", metadata: { help: "Small print under the listings, like a note about rates. Leave blank to hide it." } },
  },
  defaultProps: {
    eyebrow: "Where to stay",
    heading: "Rooms with a river view, and a few without",
    headingLevel: "h2",
    intro: "From a restored 1890s grand hotel to tent sites on the sandbar, every place here is a short walk, ride or paddle from downtown.",
    listings: [
      {
        name: "The Ferry House Hotel",
        type: "hotel",
        neighborhood: "Downtown",
        price: "3",
        description: "A restored 1891 riverfront hotel with a rooftop bar and rooms facing the bend.",
        amenities: "Rooftop bar, Fitness room, Valet parking, Pet friendly",
        imageUrl: "https://picsum.photos/seed/riverbend-ferryhouse/900/700",
        imageAlt: "A brick hotel facade with arched windows and a striped awning",
        linkLabel: "Book now",
        linkHref: "https://ferryhouse.example.org",
      },
      {
        name: "Riverbend Convention Center Suites",
        type: "hotel",
        neighborhood: "Convention District",
        price: "2",
        description: "Connected to the convention center by skywalk, with a heated indoor pool.",
        amenities: "Indoor pool, Free breakfast, EV charging, Accessible rooms",
        imageUrl: "https://picsum.photos/seed/riverbend-suites/900/700",
        imageAlt: "A modern hotel lobby with tall windows and lounge seating",
        linkLabel: "Book now",
        linkHref: "https://ccsuites.example.org",
      },
      {
        name: "Old Mill Inn",
        type: "inn",
        neighborhood: "Old Mill",
        price: "2",
        description: "Twelve rooms in a converted grist mill, steps from the bookshops and brunch spots.",
        amenities: "Free Wi-Fi, Free parking, Garden patio",
        imageUrl: "https://picsum.photos/seed/riverbend-millinn/900/700",
        imageAlt: "A stone mill building with a water wheel and ivy-covered walls",
        linkLabel: "Visit website",
        linkHref: "https://oldmillinn.example.org",
      },
      {
        name: "Bluffside Bed & Breakfast",
        type: "bnb",
        neighborhood: "Bluff Park",
        price: "3",
        description: "Four rooms in a Queen Anne house above the river, with a famous three-course breakfast.",
        amenities: "Full breakfast, Adults only, Wraparound porch",
        imageUrl: "https://picsum.photos/seed/riverbend-bnb/900/700",
        imageAlt: "A Victorian house with a wraparound porch and rocking chairs",
        linkLabel: "Check availability",
        linkHref: "https://bluffsidebnb.example.org",
      },
      {
        name: "Sandbar Island Campground",
        type: "campground",
        neighborhood: "Heron Marsh",
        price: "1",
        description: "Tent and RV sites under cottonwoods, with a boat launch and bathhouse.",
        amenities: "RV hookups, Boat launch, Pet friendly, Bathhouse",
        imageUrl: "https://picsum.photos/seed/riverbend-camp/900/700",
        imageAlt: "A tent pitched beneath tall trees beside a sandy riverbank",
        linkLabel: "Reserve a site",
        linkHref: "https://sandbarcamp.example.org",
      },
    ],
    footnote: "Price bands reflect typical nightly rates for two guests: $ under $100, $$ $100–$180, $$$ $180–$280, $$$$ over $280. Confirm current rates with each property.",
  },
  render: ({ id, eyebrow, heading, headingLevel, intro, listings, footnote }) => {
    const H = headingLevel || "h2";
    const TypeH = childHeading[H] ?? "h3";
    const NameH = grandchildHeading[H] ?? "h4";
    const uid = id || "stay";
    const all = (listings ?? []).filter((l) => l?.name);
    const groups = TYPES.map((t) => ({ ...t, items: all.filter((l) => (l.type || "hotel") === t.value) })).filter((g) => g.items.length > 0);
    const hasHeader = Boolean(eyebrow || 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="max-w-3xl">
              {eyebrow ? <p className="text-sm font-semibold tracking-widest text-indigo-700 uppercase">{eyebrow}</p> : null}
              {heading ? <H className={`${eyebrow ? "mt-3" : ""} text-4xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-5xl`}>{heading}</H> : null}
              {intro ? <p className="mt-5 text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
            </div>
          ) : null}

          {groups.length > 1 ? (
            <nav aria-label="Lodging types" className={hasHeader ? "mt-10" : ""}>
              <ul role="list" className="flex flex-wrap gap-2">
                {groups.map((g) => (
                  <li key={g.value}>
                    <a
                      href={`#${uid}-${g.value}`}
                      className={`inline-flex min-h-11 items-center gap-2 rounded-full bg-neutral-100 px-4 text-sm font-semibold text-neutral-900 transition hover:bg-indigo-50 hover:text-indigo-800 ${FOCUS}`}
                    >
                      {g.label}
                      <span className="rounded-full bg-white px-2 py-0.5 text-xs text-neutral-600 tabular-nums">
                        {g.items.length}
                        <span className="sr-only"> listings</span>
                      </span>
                    </a>
                  </li>
                ))}
              </ul>
            </nav>
          ) : null}

          <div className="mt-12 space-y-14 sm:mt-16 sm:space-y-20">
            {groups.map((g) => (
              <section key={g.value} id={`${uid}-${g.value}`} aria-labelledby={`${uid}-${g.value}-h`} className="scroll-mt-24">
                <div className="flex items-center gap-4">
                  <TypeH id={`${uid}-${g.value}-h`} className="text-2xl font-semibold tracking-tight text-neutral-950">
                    {g.label}
                  </TypeH>
                  <span aria-hidden="true" className="h-px flex-1 bg-neutral-200" />
                </div>
                <ul role="list" className="mt-6 grid grid-cols-1 gap-6 md:grid-cols-2">
                  {g.items.map((l, i) => {
                    const price: Price = PRICE_WORDS[l.price] ? l.price : "2";
                    const tags = splitTags(l.amenities);
                    return (
                      <li key={`${l.name}-${i}`} className="group flex flex-col overflow-hidden rounded-3xl bg-white ring-1 ring-neutral-950/10 shadow-xs transition hover:-translate-y-0.5 hover:shadow-lg motion-reduce:transition-none motion-reduce:hover:translate-y-0 sm:flex-row md:flex-col xl:flex-row">
                        {l.imageUrl ? (
                          <div className="relative aspect-16/10 shrink-0 overflow-hidden bg-neutral-200 sm:aspect-auto sm:w-2/5 md:aspect-16/10 md:w-full xl:aspect-auto xl:w-2/5">
                            <img src={l.imageUrl} alt={l.imageAlt || ""} className="absolute inset-0 size-full object-cover" />
                          </div>
                        ) : null}
                        <div className="flex min-w-0 flex-1 flex-col p-6">
                          <div className="flex items-start justify-between gap-3">
                            <NameH className="text-lg font-semibold tracking-tight text-balance text-neutral-950">{l.name}</NameH>
                            <p className="shrink-0 text-sm font-semibold tracking-wider text-neutral-950">
                              <span aria-hidden="true">
                                {"$".repeat(Number(price))}
                                <span className="text-neutral-300">{"$".repeat(4 - Number(price))}</span>
                              </span>
                              <span className="sr-only">Price: {PRICE_WORDS[price]}</span>
                            </p>
                          </div>
                          {l.neighborhood ? <p className="mt-1 text-sm text-neutral-600">{l.neighborhood}</p> : null}
                          {l.description ? <p className="mt-3 text-sm leading-6 text-pretty text-neutral-700">{l.description}</p> : null}
                          {tags.length > 0 ? (
                            <ul role="list" aria-label="Amenities" className="mt-4 flex flex-wrap gap-1.5">
                              {tags.map((tag, k) => (
                                <li key={`${tag}-${k}`} className="rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-neutral-700">
                                  {tag}
                                </li>
                              ))}
                            </ul>
                          ) : null}
                          {l.linkLabel ? (
                            <p className="mt-auto pt-5">
                              <a
                                href={l.linkHref || "#"}
                                className={`inline-flex min-h-11 items-center gap-1.5 rounded-lg bg-neutral-950 px-4 text-sm font-semibold text-white transition hover:bg-indigo-700 ${FOCUS}`}
                              >
                                {l.linkLabel}
                                <span className="sr-only">: {l.name}</span>
                                <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-4">
                                  <path fillRule="evenodd" d={EXTERNAL} clipRule="evenodd" />
                                </svg>
                              </a>
                            </p>
                          ) : null}
                        </div>
                      </li>
                    );
                  })}
                </ul>
              </section>
            ))}
          </div>

          {footnote ? <p className="mt-12 max-w-3xl text-sm leading-6 text-neutral-600">{footnote}</p> : null}
        </div>
      </section>
    );
  },
};
```
