# Add the "Featured Event" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/featured-event) to this Pantheon Content Publisher (P1) Next.js project. A ticket-stub card for one signature event with date, venue, ticket or waitlist button and sponsor row.

## Steps

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

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

/**
 * Featured Event — one signature event (a gala, a 5K, an annual dinner) as a ticket-stub card:
 * photo with a date stamp, when and where, a ticket button that swaps to a waitlist link when
 * sold out, and a row of sponsor names. Register: `FeaturedEventBlock: featuredEventBlock` in puck.config.tsx.
 */

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

export type FeaturedEventProps = {
  eyebrow: string;
  name: string;
  headingLevel: Heading;
  tagline: string;
  imageUrl: string;
  imageAlt: string;
  dateText: string;
  isoDate: string;
  time: string;
  venue: string;
  address: string;
  ticketLabel: string;
  ticketHref: string;
  ticketNote: string;
  soldOut: boolean;
  waitlistLabel: string;
  waitlistHref: string;
  sponsorLabel: string;
  sponsorHref: string;
  sponsorsHeading: string;
  sponsors: string;
};

const MONTHS = [
  "Jan",
  "Feb",
  "Mar",
  "Apr",
  "May",
  "Jun",
  "Jul",
  "Aug",
  "Sep",
  "Oct",
  "Nov",
  "Dec",
];

// Read month and day straight from the YYYY-MM-DD string so the stamp never shifts with time zones.
const stamp = (iso: string) => {
  const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(iso || "");
  if (!m) return null;
  const month = MONTHS[Number(m[2]) - 1];
  const day = Number(m[3]);
  return month && day >= 1 && day <= 31 ? { month, day } : null;
};

export const featuredEventBlock: ComponentConfig<FeaturedEventProps> = {
  label: "Featured Event",
  fields: {
    eyebrow: {
      type: "text",
      label: "Eyebrow",
      metadata: {
        help: "Small line above the name, like Our annual gala. Leave blank to hide it.",
      },
    },
    name: { type: "text", label: "Event name" },
    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.",
      },
    },
    tagline: { type: "textarea", label: "Tagline" },
    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.",
      },
    },
    dateText: {
      type: "text",
      label: "Date",
      metadata: {
        help: "As people should read it, like Saturday, November 14, 2026.",
      },
    },
    isoDate: {
      type: "text",
      label: "Date (YYYY-MM-DD)",
      metadata: {
        help: "Like 2026-11-14. Lets search engines and calendars read the date, and draws the date stamp on the photo.",
      },
    },
    time: {
      type: "text",
      label: "Time",
      metadata: { help: "Like 6–10 p.m. Leave blank to hide it." },
    },
    venue: { type: "text", label: "Venue" },
    address: {
      type: "text",
      label: "Address",
      metadata: { help: "Leave blank to hide it." },
    },
    ticketLabel: { type: "text", label: "Ticket button text" },
    ticketHref: { type: "text", label: "Ticket link" },
    ticketNote: {
      type: "text",
      label: "Ticket note",
      metadata: {
        help: "Small print under the button, like Tickets from $150. Leave blank to hide it.",
      },
    },
    soldOut: {
      type: "radio",
      label: "Sold out",
      options: [
        { label: "No", value: false },
        { label: "Yes", value: true },
      ],
      metadata: {
        help: "Shows a Sold out label and swaps the ticket button for the waitlist link.",
      },
    },
    waitlistLabel: { type: "text", label: "Waitlist link text" },
    waitlistHref: { type: "text", label: "Waitlist link" },
    sponsorLabel: {
      type: "text",
      label: "Sponsor link text",
      metadata: { help: "Leave blank to hide it." },
    },
    sponsorHref: { type: "text", label: "Sponsor link" },
    sponsorsHeading: {
      type: "text",
      label: "Sponsors label",
      metadata: { help: "Small line above the sponsor names." },
    },
    sponsors: {
      type: "textarea",
      label: "Sponsor names",
      metadata: { help: "One per line. Leave blank to hide the row." },
    },
  },
  defaultProps: {
    eyebrow: "Our annual benefit",
    name: "Lanterns on the Lake",
    headingLevel: "h2",
    tagline:
      "An evening on the shore of Cedar Hollow with local food, live bluegrass and a lantern walk along the trail your support protected. Every ticket helps keep Cedar Hollow wild for good.",
    imageUrl: "https://picsum.photos/seed/lanternlake/1400/1100",
    imageAlt: "Paper lanterns glowing along a lakeside path at dusk",
    dateText: "Saturday, November 14, 2026",
    isoDate: "2026-11-14",
    time: "5:30–10 p.m.",
    venue: "Cedar Hollow Boathouse",
    address: "2200 Lakeshore Road, Alder Falls",
    ticketLabel: "Get tickets",
    ticketHref: "/gala/tickets",
    ticketNote: "Tickets from $125. Tables of eight available.",
    soldOut: false,
    waitlistLabel: "Join the waitlist",
    waitlistHref: "/gala/waitlist",
    sponsorLabel: "Become a sponsor",
    sponsorHref: "/gala/sponsors",
    sponsorsHeading: "With thanks to our sponsors",
    sponsors:
      "Millbrook Credit Union\nAlder & Finch\nNorthgate Hardware\nBlue Heron Coffee\nKestrel Design Co.",
  },
  render: ({
    eyebrow,
    name,
    headingLevel,
    tagline,
    imageUrl,
    imageAlt,
    dateText,
    isoDate,
    time,
    venue,
    address,
    ticketLabel,
    ticketHref,
    ticketNote,
    soldOut,
    waitlistLabel,
    waitlistHref,
    sponsorLabel,
    sponsorHref,
    sponsorsHeading,
    sponsors,
  }) => {
    const H = headingLevel || "h2";
    const date = stamp(isoDate);
    const validIso = Boolean(date);
    const sponsorList = (sponsors || "")
      .split("\n")
      .map((s) => s.trim())
      .filter(Boolean);
    const primaryLabel = soldOut ? waitlistLabel : ticketLabel;
    const primaryHref = soldOut ? waitlistHref : ticketHref;
    const hasWhen = Boolean(dateText || time);
    const hasWhere = Boolean(venue || address);

    return (
      <section className="bg-neutral-100 px-4 py-16 sm:px-6 sm:py-20 lg:px-8 lg:py-24">
        <div className="mx-auto max-w-7xl">
          <article className="overflow-hidden rounded-3xl bg-white shadow-xl ring-1 ring-neutral-900/5 lg:grid lg:grid-cols-12">
            {imageUrl ? (
              <div className="relative lg:col-span-7">
                <img
                  src={imageUrl}
                  alt={imageAlt || ""}
                  className="aspect-[4/3] w-full bg-neutral-200 object-cover lg:aspect-auto lg:h-full"
                />
                {date ? (
                  <div
                    aria-hidden="true"
                    className="absolute top-4 left-4 flex w-20 flex-col items-center overflow-hidden rounded-xl bg-white text-center shadow-lg sm:top-6 sm:left-6 sm:w-24"
                  >
                    <span className="w-full bg-indigo-600 py-1 text-xs font-semibold tracking-widest text-white uppercase sm:text-sm">
                      {date.month}
                    </span>
                    <span className="py-1.5 text-4xl font-semibold tracking-tight text-neutral-950 tabular-nums sm:text-5xl">
                      {date.day}
                    </span>
                  </div>
                ) : null}
              </div>
            ) : null}

            <div
              className={`relative flex flex-col p-6 sm:p-10 ${imageUrl ? "border-t-2 border-dashed border-neutral-200 lg:col-span-5 lg:border-t-0 lg:border-l-2" : "lg:col-span-12"}`}
            >
              {imageUrl ? (
                <>
                  <span
                    aria-hidden="true"
                    className="absolute -top-3.5 -left-3.5 size-7 rounded-full bg-neutral-100"
                  />
                  <span
                    aria-hidden="true"
                    className="absolute -top-3.5 -right-3.5 size-7 rounded-full bg-neutral-100 lg:top-auto lg:right-auto lg:-bottom-3.5 lg:-left-3.5"
                  />
                </>
              ) : null}

              <div className="flex flex-wrap items-center gap-3">
                {eyebrow ? (
                  <p className="text-sm font-semibold tracking-widest text-indigo-700 uppercase">
                    {eyebrow}
                  </p>
                ) : null}
                {soldOut ? (
                  <span className="inline-flex items-center rounded-full bg-neutral-950 px-2.5 py-1 text-xs font-semibold tracking-wide text-white uppercase">
                    Sold out
                  </span>
                ) : null}
              </div>
              {name ? (
                <H className="mt-3 font-serif text-4xl leading-tight font-semibold tracking-tight text-balance text-neutral-950 sm:text-5xl">
                  {name}
                </H>
              ) : null}
              {tagline ? (
                <p className="mt-4 text-base leading-7 text-pretty text-neutral-600 sm:text-lg sm:leading-8">
                  {tagline}
                </p>
              ) : null}

              {hasWhen || hasWhere ? (
                <dl className="mt-8 space-y-4 border-y border-neutral-200 py-6 text-base leading-6">
                  {hasWhen ? (
                    <div className="flex gap-3">
                      <dt className="shrink-0">
                        <span className="sr-only">When</span>
                        <svg
                          aria-hidden="true"
                          viewBox="0 0 20 20"
                          fill="currentColor"
                          className="size-5 text-indigo-600"
                        >
                          <path
                            fillRule="evenodd"
                            d="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"
                            clipRule="evenodd"
                          />
                        </svg>
                      </dt>
                      <dd className="min-w-0">
                        {dateText ? (
                          validIso ? (
                            <time
                              dateTime={isoDate.slice(0, 10)}
                              className="block font-semibold text-neutral-950"
                            >
                              {dateText}
                            </time>
                          ) : (
                            <span className="block font-semibold text-neutral-950">
                              {dateText}
                            </span>
                          )
                        ) : null}
                        {time ? (
                          <span className="block text-neutral-600">{time}</span>
                        ) : null}
                      </dd>
                    </div>
                  ) : null}
                  {hasWhere ? (
                    <div className="flex gap-3">
                      <dt className="shrink-0">
                        <span className="sr-only">Where</span>
                        <svg
                          aria-hidden="true"
                          viewBox="0 0 20 20"
                          fill="currentColor"
                          className="size-5 text-indigo-600"
                        >
                          <path
                            fillRule="evenodd"
                            d="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"
                            clipRule="evenodd"
                          />
                        </svg>
                      </dt>
                      <dd className="min-w-0">
                        {venue ? (
                          <span className="block font-semibold text-neutral-950">
                            {venue}
                          </span>
                        ) : null}
                        {address ? (
                          <span className="block text-neutral-600">
                            {address}
                          </span>
                        ) : null}
                      </dd>
                    </div>
                  ) : null}
                </dl>
              ) : null}

              {primaryLabel || sponsorLabel ? (
                <div className="mt-8 flex flex-col gap-3 sm:flex-row sm:flex-wrap sm:items-center sm:gap-6">
                  {primaryLabel ? (
                    <a
                      href={primaryHref || "#"}
                      className={`inline-flex min-h-12 items-center justify-center gap-2 rounded-lg px-6 py-3 text-base font-semibold shadow-sm transition focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 ${soldOut ? "bg-white text-neutral-950 ring-1 ring-neutral-300 ring-inset hover:bg-neutral-50" : "bg-indigo-600 text-white hover:bg-indigo-700"}`}
                    >
                      {soldOut ? (
                        <svg
                          aria-hidden="true"
                          viewBox="0 0 20 20"
                          fill="currentColor"
                          className="size-5 text-indigo-600"
                        >
                          <path
                            fillRule="evenodd"
                            d="M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm.75-13a.75.75 0 0 0-1.5 0v5c0 .414.336.75.75.75h4a.75.75 0 0 0 0-1.5h-3.25V5Z"
                            clipRule="evenodd"
                          />
                        </svg>
                      ) : (
                        <svg
                          aria-hidden="true"
                          viewBox="0 0 20 20"
                          fill="currentColor"
                          className="size-5"
                        >
                          <path
                            fillRule="evenodd"
                            d="M1 4.75C1 3.784 1.784 3 2.75 3h14.5c.966 0 1.75.784 1.75 1.75v2.43a.75.75 0 0 1-.629.74 2.112 2.112 0 0 0 0 4.16.75.75 0 0 1 .629.74v2.43A1.75 1.75 0 0 1 17.25 17H2.75A1.75 1.75 0 0 1 1 15.25v-2.43a.75.75 0 0 1 .629-.74 2.112 2.112 0 0 0 0-4.16A.75.75 0 0 1 1 7.18V4.75ZM13 6.25a.75.75 0 0 1 1.5 0v1a.75.75 0 0 1-1.5 0v-1Zm.75 3a.75.75 0 0 0-.75.75v1a.75.75 0 0 0 1.5 0v-1a.75.75 0 0 0-.75-.75Zm-.75 4.5a.75.75 0 0 1 1.5 0v1a.75.75 0 0 1-1.5 0v-1Z"
                            clipRule="evenodd"
                          />
                        </svg>
                      )}
                      {primaryLabel}
                    </a>
                  ) : null}
                  {sponsorLabel ? (
                    <a
                      href={sponsorHref || "#"}
                      className="group inline-flex min-h-11 items-center justify-center gap-1.5 rounded-lg px-1 text-base font-semibold text-neutral-950 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 sm:justify-start"
                    >
                      {sponsorLabel}
                      <svg
                        aria-hidden="true"
                        viewBox="0 0 20 20"
                        fill="currentColor"
                        className="size-5 transition group-hover:translate-x-0.5"
                      >
                        <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>
                    </a>
                  ) : null}
                </div>
              ) : null}
              {!soldOut && ticketNote ? (
                <p className="mt-3 text-sm leading-6 text-neutral-600">
                  {ticketNote}
                </p>
              ) : null}
            </div>
          </article>

          {sponsorList.length ? (
            <div className="mt-12 text-center">
              {sponsorsHeading ? (
                <p className="text-xs font-semibold tracking-widest text-neutral-600 uppercase">
                  {sponsorsHeading}
                </p>
              ) : null}
              <ul
                role="list"
                className={`flex flex-wrap items-center justify-center gap-x-8 gap-y-3 sm:gap-x-12 ${sponsorsHeading ? "mt-5" : ""}`}
              >
                {sponsorList.map((s, i) => (
                  <li
                    key={`${s}-${i}`}
                    className={`text-lg text-neutral-600 ${["font-serif font-semibold italic", "font-sans font-bold tracking-tight", "font-sans text-base font-semibold tracking-widest uppercase", "font-serif font-medium"][i % 4]}`}
                  >
                    {s}
                  </li>
                ))}
              </ul>
            </div>
          ) : null}
        </div>
      </section>
    );
  },
};
```
