# Add the "Public Meetings" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/public-meetings) to this Pantheon Content Publisher (P1) Next.js project. Council and board meetings with agenda, packet, livestream and minutes links, plus ADA accommodation notes.

## Steps

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

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

/**
 * Public Meetings — upcoming council, board and commission meetings with only the documents
 * that exist (agenda, packet, livestream, minutes), plus public comment and ADA notes.
 * Register: `PublicMeetingsBlock: publicMeetingsBlock` in puck.config.tsx.
 */

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

type Meeting = {
  body: string;
  meetingType: string;
  date: string;
  dateIso: string;
  time: string;
  location: string;
  agendaHref: string;
  packetHref: string;
  livestreamHref: string;
  minutesHref: string;
};

export type PublicMeetingsProps = {
  heading: string;
  headingLevel: Heading;
  intro: string;
  meetings: Meeting[];
  commentNote: string;
  accessibilityNote: string;
  archiveLabel: string;
  archiveHref: string;
};

const childHeading = { h1: "h2", h2: "h3", h3: "h4", h4: "h5" } as const;
const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];

function dateParts(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 ? { month, day: String(day) } : null;
}

const linkClass =
  "inline-flex min-h-11 items-center gap-2 rounded-lg px-3 text-sm font-semibold text-neutral-900 ring-1 ring-neutral-300 ring-inset transition hover:bg-neutral-50 hover:ring-neutral-400 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-700";

const docIcon =
  "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";

export const publicMeetingsBlock: ComponentConfig<PublicMeetingsProps> = {
  label: "Public Meetings",
  fields: {
    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." },
    },
    intro: { type: "textarea", label: "Intro", metadata: { help: "Leave blank to hide it." } },
    meetings: {
      type: "array",
      label: "Meetings",
      min: 1,
      max: 20,
      getItemSummary: (item) => (item?.body ? `${item.date ? `${item.date} · ` : ""}${item.body}` : "Meeting"),
      defaultItemProps: {
        body: "City Council",
        meetingType: "Regular meeting",
        date: "",
        dateIso: "",
        time: "",
        location: "",
        agendaHref: "",
        packetHref: "",
        livestreamHref: "",
        minutesHref: "",
      },
      arrayFields: {
        body: { type: "text", label: "Board or body", metadata: { help: "Like \"City Council\" or \"Planning Commission\"." } },
        meetingType: { type: "text", label: "Meeting type", metadata: { help: "Like \"Regular meeting\" or \"Budget work session\". Leave blank to hide it." } },
        date: { type: "text", label: "Date (as shown)", metadata: { help: "Written out, like \"Tuesday, October 13, 2026\"." } },
        dateIso: {
          type: "text",
          label: "Date (machine-readable)",
          metadata: { help: "YYYY-MM-DD, like 2026-10-13. Draws the calendar badge and helps calendars and search engines." },
        },
        time: { type: "text", label: "Time", metadata: { help: "Like 6:30 p.m." } },
        location: { type: "textarea", label: "Location", metadata: { help: "Room and address. Mention it if the room is wheelchair accessible." } },
        agendaHref: { type: "text", label: "Agenda link (PDF)", metadata: { help: "Leave blank until the agenda is posted." } },
        packetHref: { type: "text", label: "Agenda packet link (PDF)", metadata: { help: "The full packet with staff reports. Leave blank to hide it." } },
        livestreamHref: { type: "text", label: "Livestream link", metadata: { help: "Leave blank to hide it." } },
        minutesHref: { type: "text", label: "Minutes link (PDF)", metadata: { help: "Add after minutes are approved." } },
      },
    },
    commentNote: {
      type: "textarea",
      label: "Public comment",
      metadata: { help: "How residents can speak or submit written comments. Leave blank to hide it." },
    },
    accessibilityNote: {
      type: "textarea",
      label: "Accommodations",
      metadata: { help: "How to request an interpreter, captioning or other accommodation, and by when. Leave blank to hide it." },
    },
    archiveLabel: { type: "text", label: "Archive link text", metadata: { help: "Leave blank to hide the link." } },
    archiveHref: { type: "text", label: "Archive link" },
  },
  defaultProps: {
    heading: "Upcoming public meetings",
    headingLevel: "h2",
    intro: "All meetings are open to the public. Agendas are posted at least 72 hours ahead, and most meetings stream live on Millbrook TV.",
    meetings: [
      {
        body: "City Council",
        meetingType: "Regular meeting",
        date: "Tuesday, October 13, 2026",
        dateIso: "2026-10-13",
        time: "6:30 p.m.",
        location: "Council Chambers, City Hall, 200 Main Street",
        agendaHref: "/documents/council-agenda-2026-10-13.pdf",
        packetHref: "/documents/council-packet-2026-10-13.pdf",
        livestreamHref: "/millbrook-tv",
        minutesHref: "",
      },
      {
        body: "Planning Commission",
        meetingType: "Regular meeting",
        date: "Thursday, October 15, 2026",
        dateIso: "2026-10-15",
        time: "5:30 p.m.",
        location: "Room 104, City Hall, 200 Main Street",
        agendaHref: "/documents/planning-agenda-2026-10-15.pdf",
        packetHref: "",
        livestreamHref: "/millbrook-tv",
        minutesHref: "",
      },
      {
        body: "City Council",
        meetingType: "Budget work session",
        date: "Monday, October 19, 2026",
        dateIso: "2026-10-19",
        time: "4:00 p.m.",
        location: "Community Room, Millbrook Public Library, 15 Oak Avenue",
        agendaHref: "",
        packetHref: "",
        livestreamHref: "",
        minutesHref: "",
      },
      {
        body: "Parks & Recreation Board",
        meetingType: "Regular meeting",
        date: "Wednesday, October 21, 2026",
        dateIso: "2026-10-21",
        time: "6:00 p.m.",
        location: "Northside Recreation Center, 410 Hill Road",
        agendaHref: "/documents/parks-agenda-2026-10-21.pdf",
        packetHref: "",
        livestreamHref: "",
        minutesHref: "",
      },
    ],
    commentNote:
      "Speak in person during the public comment period, or email comments to the City Clerk at clerk@millbrook.gov by noon on the day of the meeting. Written comments are shared with members and added to the record.",
    accessibilityNote:
      "All meeting rooms are wheelchair accessible. To request a sign language interpreter, captioning, translated materials or another accommodation, call the City Clerk at (555) 010-2400 at least 48 hours before the meeting.",
    archiveLabel: "Past meetings, agendas and minutes",
    archiveHref: "/meetings/archive",
  },
  render: ({ heading, headingLevel, intro, meetings, commentNote, accessibilityNote, archiveLabel, archiveHref }) => {
    const H = headingLevel || "h2";
    const Sub = childHeading[headingLevel] || "h3";
    const list = (meetings ?? []).filter((m) => m?.body);
    const hasAside = Boolean(commentNote || accessibilityNote);
    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">
          {heading || intro || archiveLabel ? (
            <div className="flex flex-col gap-6 md:flex-row md:items-end md:justify-between">
              {heading || intro ? (
                <div className="max-w-2xl">
                  {heading ? <H className="text-3xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-4xl">{heading}</H> : null}
                  {intro ? <p className="mt-4 text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
                </div>
              ) : null}
              {archiveLabel ? (
                <a
                  href={archiveHref || "#"}
                  className="group inline-flex min-h-11 shrink-0 items-center gap-1.5 self-start rounded-lg text-base font-semibold text-indigo-700 hover:text-indigo-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-700 md:self-auto"
                >
                  {archiveLabel}
                  <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 shrink-0 transition motion-safe: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}
          <div className={`grid gap-10 lg:gap-12 ${hasAside ? "lg:grid-cols-3" : ""} ${heading || intro || archiveLabel ? "mt-10 sm:mt-12" : ""}`}>
            {list.length ? (
              <ol role="list" className={`divide-y divide-neutral-200 border-y border-neutral-200 ${hasAside ? "lg:col-span-2" : ""}`}>
                {list.map((meeting, i) => {
                  const parts = dateParts(meeting.dateIso);
                  const context = [meeting.body, meeting.date].filter(Boolean).join(", ");
                  const links = [
                    { href: meeting.agendaHref, label: "Agenda (PDF)", icon: docIcon },
                    { href: meeting.packetHref, label: "Agenda packet (PDF)", icon: docIcon },
                    {
                      href: meeting.livestreamHref,
                      label: "Watch live",
                      icon: "M3.25 4A2.25 2.25 0 0 0 1 6.25v7.5A2.25 2.25 0 0 0 3.25 16h7.5A2.25 2.25 0 0 0 13 13.75v-7.5A2.25 2.25 0 0 0 10.75 4h-7.5ZM19 4.75a.75.75 0 0 0-1.28-.53l-3 3a.75.75 0 0 0-.22.53v4.5c0 .199.079.39.22.53l3 3a.75.75 0 0 0 1.28-.53V4.75Z",
                    },
                    { href: meeting.minutesHref, label: "Minutes (PDF)", icon: docIcon },
                  ].filter((l) => l.href);
                  return (
                    <li key={`${meeting.body}-${meeting.dateIso || meeting.date}-${i}`} className="flex gap-4 py-6 sm:gap-6 sm:py-8">
                      {parts ? (
                        <div aria-hidden="true" className="flex w-14 shrink-0 flex-col items-center self-start overflow-hidden rounded-xl ring-1 ring-neutral-200 sm:w-16">
                          <span className="w-full bg-indigo-700 py-0.5 text-center text-xs font-semibold tracking-wide text-white uppercase">{parts.month}</span>
                          <span className="py-1.5 text-2xl font-semibold tracking-tight text-neutral-950 tabular-nums sm:text-3xl">{parts.day}</span>
                        </div>
                      ) : null}
                      <div className="min-w-0 flex-1">
                        {meeting.meetingType ? <p className="text-sm leading-6 font-medium text-indigo-700">{meeting.meetingType}</p> : null}
                        <Sub className="text-lg leading-7 font-semibold tracking-tight text-neutral-950 sm:text-xl">{meeting.body}</Sub>
                        {meeting.date || meeting.time || meeting.location ? (
                          <dl className="mt-2 space-y-1 text-sm leading-6 text-neutral-700">
                            {meeting.date || meeting.time ? (
                              <div className="flex gap-2">
                                <dt className="shrink-0">
                                  <span className="sr-only">When</span>
                                  <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="mt-0.5 size-5 text-neutral-500">
                                    <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>
                                </dt>
                                <dd>
                                  {meeting.date ? meeting.dateIso && parts ? <time dateTime={meeting.dateIso.slice(0, 10)}>{meeting.date}</time> : meeting.date : null}
                                  {meeting.date && meeting.time ? " at " : null}
                                  {meeting.time}
                                </dd>
                              </div>
                            ) : null}
                            {meeting.location ? (
                              <div className="flex gap-2">
                                <dt className="shrink-0">
                                  <span className="sr-only">Where</span>
                                  <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="mt-0.5 size-5 text-neutral-500">
                                    <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 text-pretty">{meeting.location}</dd>
                              </div>
                            ) : null}
                          </dl>
                        ) : null}
                        {links.length ? (
                          <ul role="list" className="mt-4 flex flex-wrap gap-2">
                            {links.map((l) => (
                              <li key={l.label}>
                                <a href={l.href} className={linkClass}>
                                  <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-4 shrink-0 text-indigo-700">
                                    <path fillRule="evenodd" d={l.icon} clipRule="evenodd" />
                                  </svg>
                                  {l.label}
                                  {context ? <span className="sr-only">, {context}</span> : null}
                                </a>
                              </li>
                            ))}
                          </ul>
                        ) : (
                          <p className="mt-4 text-sm leading-6 text-neutral-600">Agenda not yet posted.</p>
                        )}
                      </div>
                    </li>
                  );
                })}
              </ol>
            ) : null}
            {hasAside ? (
              <aside aria-label="Taking part in public meetings" className="self-start rounded-2xl bg-neutral-50 p-6 ring-1 ring-neutral-200 sm:p-8 lg:sticky lg:top-8">
                {commentNote ? (
                  <div>
                    <p className="flex items-center gap-2 text-base leading-7 font-semibold text-neutral-950">
                      <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 shrink-0 text-indigo-700">
                        <path fillRule="evenodd" d="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" clipRule="evenodd" />
                      </svg>
                      Public comment
                    </p>
                    <p className="mt-2 text-sm leading-6 text-pretty text-neutral-700">{commentNote}</p>
                  </div>
                ) : null}
                {accessibilityNote ? (
                  <div className={commentNote ? "mt-6 border-t border-neutral-200 pt-6" : undefined}>
                    <p className="flex items-center gap-2 text-base leading-7 font-semibold text-neutral-950">
                      <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 shrink-0 text-indigo-700">
                        <path d="M10 1.75a1.75 1.75 0 1 0 0 3.5 1.75 1.75 0 0 0 0-3.5ZM4.03 6.04a.75.75 0 0 1 .93-.51c3.32.95 6.76.95 10.08 0a.75.75 0 1 1 .42 1.44c-1.24.35-2.5.6-3.77.74v2.93l1.98 6.27a.75.75 0 1 1-1.43.45L10.5 12.2h-1L7.76 17.36a.75.75 0 1 1-1.43-.45l1.98-6.27V7.71a23.4 23.4 0 0 1-3.77-.74.75.75 0 0 1-.51-.93Z" />
                      </svg>
                      Need an accommodation?
                    </p>
                    <p className="mt-2 text-sm leading-6 text-pretty text-neutral-700">{accessibilityNote}</p>
                  </div>
                ) : null}
              </aside>
            ) : null}
          </div>
        </div>
      </section>
    );
  },
};
```
