# Add the "Visitor Center" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/visitor-center) to this Pantheon Content Publisher (P1) Next.js project. Welcome center hours, address, services and contacts, plus a form to request a mailed visitor guide.

## Steps

1. Create `components/puck/visitor-center-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 { visitorCenterBlock } from "./components/puck/visitor-center-block";`
3. Register it under `components` as `VisitorCenterBlock: visitorCenterBlock`.
4. Add `"VisitorCenterBlock"` 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/visitor-center-block.tsx`

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

/**
 * Visitor Center — everything about the welcome center in one section: hours, address,
 * services, phone and email, plus a "request a free visitor guide" form that posts to your form endpoint.
 * Register: `VisitorCenterBlock: visitorCenterBlock` in puck.config.tsx.
 */

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

export type VisitorCenterProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  imageUrl: string;
  imageAlt: string;
  hours: { days: string; time: string }[];
  hoursNote: string;
  address: string;
  directionsLabel: string;
  directionsHref: string;
  phone: string;
  email: string;
  services: { label: string; detail: string }[];
  formHeading: string;
  formIntro: string;
  formAction: string;
  submitLabel: string;
  privacyNote: string;
};

const childHeading: Record<Heading, "h2" | "h3" | "h4" | "h5"> = { h1: "h2", h2: "h3", h3: "h4", h4: "h5" };
const FOCUS = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600";
const INPUT =
  "mt-2 block min-h-11 w-full rounded-lg border-0 bg-white px-3.5 py-2.5 text-base text-neutral-950 ring-1 ring-neutral-300 ring-inset placeholder:text-neutral-500 focus:ring-2 focus:ring-indigo-600 focus:outline-none sm:text-sm";
const LABEL = "block text-sm font-semibold text-neutral-900";
const CHECK = "M12.416 3.376a.75.75 0 0 1 .208 1.04l-5 7.5a.75.75 0 0 1-1.154.114l-3-3a.75.75 0 0 1 1.06-1.06l2.353 2.353 4.493-6.74a.75.75 0 0 1 1.04-.207Z";

export const visitorCenterBlock: ComponentConfig<VisitorCenterProps> = {
  label: "Visitor Center",
  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. Panel titles use the next level down." },
    },
    intro: { type: "textarea", label: "Intro" },
    imageUrl: { type: "text", label: "Image URL", metadata: { help: "A photo of the center or its front desk. Leave blank to hide it." } },
    imageAlt: { type: "text", label: "Image alt text", metadata: { help: "Describe the photo for screen reader users. Leave blank only if it's purely decorative." } },
    hours: {
      type: "array",
      label: "Hours",
      min: 0,
      max: 7,
      getItemSummary: (item) => `${item?.days || "Days"}: ${item?.time || ""}`,
      defaultItemProps: { days: "Sunday", time: "Closed" },
      arrayFields: {
        days: { type: "text", label: "Days", metadata: { help: "Like “Mon–Fri”." } },
        time: { type: "text", label: "Hours", metadata: { help: "Like “9 AM–5 PM” or “Closed”." } },
      },
    },
    hoursNote: { type: "text", label: "Hours note", metadata: { help: "Like holiday closures. Leave blank to hide it." } },
    address: { type: "textarea", label: "Address", metadata: { help: "One line per address line." } },
    directionsLabel: { type: "text", label: "Directions link text", metadata: { help: "Leave blank to hide it." } },
    directionsHref: { type: "text", label: "Directions link", metadata: { help: "Usually a map link." } },
    phone: { type: "text", label: "Phone", metadata: { help: "Shown as typed and dialed as a tel: link." } },
    email: { type: "text", label: "Email" },
    services: {
      type: "array",
      label: "Services",
      min: 0,
      max: 10,
      getItemSummary: (item) => item?.label || "Service",
      defaultItemProps: { label: "New service", detail: "" },
      arrayFields: {
        label: { type: "text", label: "Service" },
        detail: { type: "text", label: "Detail", metadata: { help: "Optional short note. Leave blank to hide it." } },
      },
    },
    formHeading: { type: "text", label: "Form heading" },
    formIntro: { type: "textarea", label: "Form intro" },
    formAction: { type: "text", label: "Form action URL", metadata: { help: "Where the guide request is sent (POST), such as your form service endpoint. The form fields are name, address, city, state, zip and email." } },
    submitLabel: { type: "text", label: "Button text" },
    privacyNote: { type: "textarea", label: "Privacy note", metadata: { help: "Small print under the button. Leave blank to hide it." } },
  },
  defaultProps: {
    eyebrow: "Visitor center",
    heading: "Say hello at the Riverbend Welcome Center",
    headingLevel: "h2",
    intro: "Our locals have eaten, paddled and hiked their way through every corner of Riverbend. Stop by for maps, restrooms and an honest recommendation.",
    imageUrl: "https://picsum.photos/seed/riverbend-welcome/1400/900",
    imageAlt: "A sunny welcome center lobby with brochure racks and a long wooden counter",
    hours: [
      { days: "Mon–Fri", time: "9 AM–5 PM" },
      { days: "Saturday", time: "9 AM–6 PM" },
      { days: "Sunday", time: "11 AM–4 PM" },
    ],
    hoursNote: "Closed Thanksgiving, December 25 and January 1.",
    address: "Riverbend Welcome Center\n200 Front Street\nRiverbend, ST 00000",
    directionsLabel: "Get directions",
    directionsHref: "https://maps.example.org/riverbend-welcome-center",
    phone: "(555) 555-0142",
    email: "hello@visitriverbend.example.org",
    services: [
      { label: "Free maps & guides", detail: "Trail, dining and walking-tour maps" },
      { label: "Restrooms", detail: "Accessible, with a family room" },
      { label: "Free Wi-Fi", detail: "" },
      { label: "Local experts", detail: "Ask us anything, in English or Spanish" },
      { label: "Gift shop", detail: "Riverbend-made goods and books" },
      { label: "Bike share dock", detail: "12 bikes out front" },
    ],
    formHeading: "Get the free visitor guide",
    formIntro: "Our 96-page guide to Riverbend, mailed free anywhere in the U.S. Allow 7–10 days.",
    formAction: "/api/visitor-guide",
    submitLabel: "Mail me a guide",
    privacyNote: "We'll only use your address to send the guide. Your email gets one monthly events newsletter you can leave anytime.",
  },
  render: ({
    id,
    eyebrow,
    heading,
    headingLevel,
    intro,
    imageUrl,
    imageAlt,
    hours,
    hoursNote,
    address,
    directionsLabel,
    directionsHref,
    phone,
    email,
    services,
    formHeading,
    formIntro,
    formAction,
    submitLabel,
    privacyNote,
  }) => {
    const H = headingLevel || "h2";
    const Sub = childHeading[H] ?? "h3";
    const uid = id || "visitor-center";
    const hourRows = (hours ?? []).filter((h) => h?.days || h?.time);
    const serviceList = (services ?? []).filter((s) => s?.label);
    const addressLines = (address || "").split("\n").map((l) => l.trim()).filter(Boolean);
    const tel = (phone || "").replace(/[^\d+]/g, "");
    const hasHeader = Boolean(eyebrow || heading || intro);
    const f = (name: string) => `${uid}-${name}`;
    return (
      <section className="bg-neutral-50 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}

          <div className={`${hasHeader ? "mt-12 sm:mt-14" : ""} grid grid-cols-1 gap-6 lg:grid-cols-12 lg:gap-8`}>
            <div className="grid grid-cols-1 gap-6 lg:col-span-7">
              {imageUrl ? <img src={imageUrl} alt={imageAlt || ""} className="aspect-16/9 w-full rounded-3xl bg-neutral-200 object-cover" /> : null}

              <div className="grid grid-cols-1 gap-6 rounded-3xl bg-white p-6 ring-1 ring-neutral-950/5 shadow-xs sm:grid-cols-2 sm:p-8">
                {hourRows.length > 0 ? (
                  <div>
                    <Sub className="text-sm font-semibold tracking-widest text-neutral-500 uppercase">Hours</Sub>
                    <dl className="mt-3 divide-y divide-neutral-100">
                      {hourRows.map((h, i) => (
                        <div key={`${h.days}-${i}`} className="flex justify-between gap-4 py-2 text-sm">
                          <dt className="text-neutral-700">{h.days}</dt>
                          <dd className="font-semibold text-neutral-950 tabular-nums">{h.time}</dd>
                        </div>
                      ))}
                    </dl>
                    {hoursNote ? <p className="mt-3 text-sm leading-6 text-neutral-600">{hoursNote}</p> : null}
                  </div>
                ) : null}
                {addressLines.length > 0 || phone || email ? (
                  <div>
                    <Sub className="text-sm font-semibold tracking-widest text-neutral-500 uppercase">Find us</Sub>
                    {addressLines.length > 0 ? (
                      <address className="mt-3 text-base leading-7 text-neutral-950 not-italic">
                        {addressLines.map((line, i) => (
                          <span key={`${line}-${i}`} className="block">
                            {line}
                          </span>
                        ))}
                      </address>
                    ) : null}
                    {directionsLabel ? (
                      <a href={directionsHref || "#"} className={`mt-1 inline-flex min-h-11 items-center rounded-sm text-sm font-semibold text-indigo-700 underline underline-offset-4 hover:text-indigo-900 ${FOCUS}`}>
                        {directionsLabel}
                      </a>
                    ) : null}
                    <ul role="list" className="mt-2 space-y-1 text-sm">
                      {phone ? (
                        <li>
                          <a href={`tel:${tel}`} className={`inline-flex min-h-11 items-center gap-2 rounded-sm font-semibold text-neutral-950 hover:text-indigo-700 ${FOCUS}`}>
                            <svg aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" className="size-4 text-neutral-400">
                              <path fillRule="evenodd" d="m3.855 7.286 1.067-.534a1 1 0 0 0 .542-1.046l-.44-2.858A1 1 0 0 0 4.036 2H3a1 1 0 0 0-1 1v2c0 .709.082 1.4.238 2.062a9.012 9.012 0 0 0 6.7 6.7A9.024 9.024 0 0 0 11 14h2a1 1 0 0 0 1-1v-1.036a1 1 0 0 0-.848-.988l-2.858-.44a1 1 0 0 0-1.046.542l-.534 1.067a7.52 7.52 0 0 1-4.86-4.859Z" clipRule="evenodd" />
                            </svg>
                            <span className="sr-only">Phone: </span>
                            {phone}
                          </a>
                        </li>
                      ) : null}
                      {email ? (
                        <li>
                          <a href={`mailto:${email}`} className={`inline-flex min-h-11 max-w-full items-center gap-2 rounded-sm font-semibold break-all text-neutral-950 hover:text-indigo-700 ${FOCUS}`}>
                            <svg aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" className="size-4 shrink-0 text-neutral-400">
                              <path d="M2.5 3A1.5 1.5 0 0 0 1 4.5v.793c.026.009.051.02.076.032L7.674 8.51c.206.1.446.1.652 0l6.598-3.185A.755.755 0 0 1 15 5.293V4.5A1.5 1.5 0 0 0 13.5 3h-11Z" />
                              <path d="M15 6.954 8.978 9.86a2.25 2.25 0 0 1-1.956 0L1 6.954V11.5A1.5 1.5 0 0 0 2.5 13h11a1.5 1.5 0 0 0 1.5-1.5V6.954Z" />
                            </svg>
                            <span className="sr-only">Email: </span>
                            {email}
                          </a>
                        </li>
                      ) : null}
                    </ul>
                  </div>
                ) : null}
                {serviceList.length > 0 ? (
                  <div className="border-t border-neutral-100 pt-6 sm:col-span-2">
                    <Sub className="text-sm font-semibold tracking-widest text-neutral-500 uppercase">Services</Sub>
                    <ul role="list" className="mt-4 grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2">
                      {serviceList.map((s, i) => (
                        <li key={`${s.label}-${i}`} className="flex gap-3">
                          <span aria-hidden="true" className="mt-0.5 grid size-5 shrink-0 place-items-center rounded-full bg-indigo-600 text-white">
                            <svg viewBox="0 0 16 16" fill="currentColor" className="size-3.5">
                              <path fillRule="evenodd" d={CHECK} clipRule="evenodd" />
                            </svg>
                          </span>
                          <p className="min-w-0 text-sm leading-6">
                            <span className="font-semibold text-neutral-950">{s.label}</span>
                            {s.detail ? <span className="block text-neutral-600">{s.detail}</span> : null}
                          </p>
                        </li>
                      ))}
                    </ul>
                  </div>
                ) : null}
              </div>
            </div>

            <div className="lg:col-span-5">
              <div className="relative isolate overflow-hidden rounded-3xl bg-neutral-950 p-6 sm:p-8 lg:sticky lg:top-8">
                <svg aria-hidden="true" viewBox="0 0 200 200" fill="none" className="absolute -top-16 -right-16 -z-10 size-64 text-indigo-500/30">
                  <circle cx="100" cy="100" r="60" stroke="currentColor" strokeWidth="1" />
                  <circle cx="100" cy="100" r="80" stroke="currentColor" strokeWidth="1" />
                  <circle cx="100" cy="100" r="99" stroke="currentColor" strokeWidth="1" />
                </svg>
                {formHeading ? <Sub className="text-2xl font-semibold tracking-tight text-balance text-white">{formHeading}</Sub> : null}
                {formIntro ? <p className="mt-3 text-base leading-7 text-pretty text-neutral-300">{formIntro}</p> : null}
                <form action={formAction || undefined} method="post" className="mt-6 grid grid-cols-1 gap-4 rounded-2xl bg-neutral-50 p-5 sm:grid-cols-6 sm:p-6">
                  <div className="sm:col-span-6">
                    <label htmlFor={f("name")} className={LABEL}>Full name</label>
                    <input id={f("name")} name="name" type="text" autoComplete="name" required className={INPUT} />
                  </div>
                  <div className="sm:col-span-6">
                    <label htmlFor={f("street")} className={LABEL}>Street address</label>
                    <input id={f("street")} name="street" type="text" autoComplete="street-address" required className={INPUT} />
                  </div>
                  <div className="sm:col-span-6">
                    <label htmlFor={f("city")} className={LABEL}>City</label>
                    <input id={f("city")} name="city" type="text" autoComplete="address-level2" required className={INPUT} />
                  </div>
                  <div className="sm:col-span-3">
                    <label htmlFor={f("state")} className={LABEL}>State</label>
                    <input id={f("state")} name="state" type="text" autoComplete="address-level1" required className={INPUT} />
                  </div>
                  <div className="sm:col-span-3">
                    <label htmlFor={f("zip")} className={LABEL}>ZIP code</label>
                    <input id={f("zip")} name="zip" type="text" inputMode="numeric" autoComplete="postal-code" required className={INPUT} />
                  </div>
                  <div className="sm:col-span-6">
                    <label htmlFor={f("email")} className={LABEL}>Email</label>
                    <input id={f("email")} name="email" type="email" autoComplete="email" required className={INPUT} />
                  </div>
                  <div className="sm:col-span-6">
                    <button
                      type="submit"
                      className={`inline-flex min-h-12 w-full items-center justify-center gap-2 rounded-lg bg-indigo-600 px-5 py-3 text-base font-semibold text-white shadow-sm transition hover:bg-indigo-700 ${FOCUS}`}
                    >
                      <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5">
                        <path d="M10.75 16.82A7.462 7.462 0 0 1 15 15.5c.71 0 1.396.098 2.046.282A.75.75 0 0 0 18 15.06v-11a.75.75 0 0 0-.546-.721A9.006 9.006 0 0 0 15 3a8.963 8.963 0 0 0-4.25 1.065V16.82ZM9.25 4.065A8.963 8.963 0 0 0 5 3c-.85 0-1.673.118-2.454.339A.75.75 0 0 0 2 4.06v11a.75.75 0 0 0 .954.721A7.506 7.506 0 0 1 5 15.5c1.579 0 3.042.487 4.25 1.32V4.065Z" />
                      </svg>
                      {submitLabel || "Request a guide"}
                    </button>
                    {privacyNote ? <p className="mt-3 text-xs leading-5 text-neutral-600">{privacyNote}</p> : null}
                  </div>
                </form>
              </div>
            </div>
          </div>
        </div>
      </section>
    );
  },
};
```
