# Add the "City Jobs" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/city-jobs) to this Pantheon Content Publisher (P1) Next.js project. Open city job postings with department, pay range, schedule, closing date and an equal opportunity statement.

## Steps

1. Create `components/puck/city-jobs-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 { cityJobsBlock } from "./components/puck/city-jobs-block";`
3. Register it under `components` as `CityJobsBlock: cityJobsBlock`.
4. Add `"CityJobsBlock"` 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/city-jobs-block.tsx`

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

/**
 * City Jobs — open positions with department, pay grade and salary range, schedule, closing
 * date and an apply link, followed by the equal opportunity and accommodations statement.
 * Register: `CityJobsBlock: cityJobsBlock` in puck.config.tsx.
 */

type Heading = "h1" | "h2" | "h3" | "h4";
type Schedule = "full" | "part" | "seasonal" | "temporary";

export type CityJobsProps = {
  heading: string;
  headingLevel: Heading;
  intro: string;
  jobs: {
    title: string;
    department: string;
    summary: string;
    payGrade: string;
    salary: string;
    schedule: Schedule;
    closingDate: string;
    href: string;
  }[];
  allJobsLabel: string;
  allJobsHref: string;
  eeoHeading: string;
  eeoText: string;
  accommodationText: string;
  hrPhone: string;
  hrEmail: string;
};

const childHeading = { h1: "h2", h2: "h3", h3: "h4", h4: "h5" } as const;

const focusRing = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-700";

const schedules: Record<Schedule, string> = {
  full: "Full-time",
  part: "Part-time",
  seasonal: "Seasonal",
  temporary: "Temporary",
};

export const cityJobsBlock: ComponentConfig<CityJobsProps> = {
  label: "City Jobs",
  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." } },
    jobs: {
      type: "array",
      label: "Job postings",
      min: 1,
      max: 30,
      getItemSummary: (item) => (item?.title ? `${item.title}${item.closingDate ? ` · closes ${item.closingDate}` : ""}` : "Job"),
      defaultItemProps: { title: "New position", department: "", summary: "", payGrade: "", salary: "", schedule: "full", closingDate: "", href: "" },
      arrayFields: {
        title: { type: "text", label: "Job title" },
        department: { type: "text", label: "Department" },
        summary: { type: "textarea", label: "Summary", metadata: { help: "One sentence on what the job is. Leave blank to hide it." } },
        payGrade: { type: "text", label: "Pay grade", metadata: { help: "Like Grade 14. Leave blank to hide it." } },
        salary: { type: "text", label: "Pay range", metadata: { help: "Like $52,400–$68,100 per year, or $18.50 per hour." } },
        schedule: {
          type: "select",
          label: "Schedule",
          options: [
            { label: "Full-time", value: "full" },
            { label: "Part-time", value: "part" },
            { label: "Seasonal", value: "seasonal" },
            { label: "Temporary", value: "temporary" },
          ],
        },
        closingDate: { type: "text", label: "Closing date", metadata: { help: "Like Oct 23, 2026, or Open until filled." } },
        href: { type: "text", label: "Apply link", metadata: { help: "The posting on your job board. Leave blank to hide the button." } },
      },
    },
    allJobsLabel: { type: "text", label: "All jobs link text", metadata: { help: "Leave blank to hide the link." } },
    allJobsHref: { type: "text", label: "All jobs link" },
    eeoHeading: { type: "text", label: "Equal opportunity heading", metadata: { help: "Leave blank to hide the statement." } },
    eeoText: { type: "textarea", label: "Equal opportunity statement", metadata: { help: "Use the exact wording approved by your HR or legal team." } },
    accommodationText: { type: "textarea", label: "Accommodations text", metadata: { help: "How to ask for an accommodation when applying or interviewing." } },
    hrPhone: { type: "text", label: "HR phone", metadata: { help: "Shown as a tap-to-call link." } },
    hrEmail: { type: "text", label: "HR email" },
  },
  defaultProps: {
    heading: "Work for Millbrook",
    headingLevel: "h2",
    intro: "City jobs come with health coverage from day one, a state pension and paid time off. Most postings stay open for two weeks.",
    jobs: [
      {
        title: "Water Treatment Plant Operator",
        department: "Public Utilities",
        summary: "Run and monitor the treatment process that serves 48,000 residents. State Class II certification or the ability to earn it within a year.",
        payGrade: "Grade 14",
        salary: "$52,400–$68,100 per year",
        schedule: "full",
        closingDate: "Oct 23, 2026",
        href: "/jobs/water-plant-operator",
      },
      {
        title: "Library Associate",
        department: "Millbrook Public Library",
        summary: "Help patrons find books and resources, run children's story time, and staff the circulation desk.",
        payGrade: "Grade 7",
        salary: "$19.25–$23.80 per hour",
        schedule: "part",
        closingDate: "Oct 30, 2026",
        href: "/jobs/library-associate",
      },
      {
        title: "Civil Engineer II",
        department: "Public Works",
        summary: "Design and manage street, sidewalk and stormwater projects from survey to final inspection.",
        payGrade: "Grade 19",
        salary: "$74,900–$97,300 per year",
        schedule: "full",
        closingDate: "Open until filled",
        href: "/jobs/civil-engineer-ii",
      },
      {
        title: "Snow Plow Driver",
        department: "Streets Division",
        summary: "Clear city streets during winter storms. Commercial driver's license (Class B) required.",
        payGrade: "Grade 9",
        salary: "$24.10 per hour, plus overtime",
        schedule: "seasonal",
        closingDate: "Nov 6, 2026",
        href: "/jobs/snow-plow-driver",
      },
    ],
    allJobsLabel: "See all open positions",
    allJobsHref: "/jobs",
    eeoHeading: "Equal opportunity employer",
    eeoText: "The City of Millbrook is an equal opportunity employer. We do not discriminate on the basis of race, color, religion, sex, sexual orientation, gender identity, national origin, age, disability, genetic information or veteran status.",
    accommodationText: "If you need an accommodation to apply or interview, contact Human Resources and we'll work with you.",
    hrPhone: "(555) 555-0150",
    hrEmail: "jobs@millbrook.example.gov",
  },
  render: ({ heading, headingLevel, intro, jobs, allJobsLabel, allJobsHref, eeoHeading, eeoText, accommodationText, hrPhone, hrEmail }) => {
    const H = headingLevel || "h2";
    const Sub = childHeading[headingLevel] || "h3";
    const list = (jobs ?? []).filter((j) => j?.title);
    const tel = hrPhone ? hrPhone.replace(/[^\d+]/g, "") : "";
    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-6xl">
          {heading || intro || allJobsLabel ? (
            <div className="flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between sm:gap-10">
              <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>
              {list.length ? (
                <p className="shrink-0 text-sm font-semibold text-neutral-600">
                  <span className="text-2xl font-semibold text-neutral-950 tabular-nums">{list.length}</span> open {list.length === 1 ? "position" : "positions"}
                </p>
              ) : null}
            </div>
          ) : null}

          {list.length ? (
            <ul role="list" className={`divide-y divide-neutral-200 border-y border-neutral-200 ${heading || intro ? "mt-10 sm:mt-12" : ""}`}>
              {list.map((job, i) => (
                <li key={`${job.title}-${i}`} className="grid grid-cols-1 gap-5 py-7 lg:grid-cols-12 lg:items-start lg:gap-8">
                  <div className="min-w-0 lg:col-span-6">
                    {job.department ? <p className="text-sm font-semibold text-indigo-700">{job.department}</p> : null}
                    <Sub className="mt-1 text-xl font-semibold tracking-tight text-pretty text-neutral-950">{job.title}</Sub>
                    {job.summary ? <p className="mt-2 text-sm leading-6 text-pretty text-neutral-600">{job.summary}</p> : null}
                  </div>
                  <dl className="grid grid-cols-1 gap-x-6 gap-y-3 text-sm leading-6 sm:grid-cols-2 lg:col-span-4">
                    {job.salary || job.payGrade ? (
                      <div className="sm:col-span-2">
                        <dt className="text-xs font-semibold tracking-wide text-neutral-600 uppercase">Pay</dt>
                        <dd className="text-neutral-950">
                          {job.salary ? <span className="font-semibold tabular-nums">{job.salary}</span> : null}
                          {job.payGrade ? <span className="text-neutral-600">{job.salary ? " · " : ""}{job.payGrade}</span> : null}
                        </dd>
                      </div>
                    ) : null}
                    <div>
                      <dt className="text-xs font-semibold tracking-wide text-neutral-600 uppercase">Schedule</dt>
                      <dd className="text-neutral-950">{schedules[job.schedule] ?? schedules.full}</dd>
                    </div>
                    {job.closingDate ? (
                      <div>
                        <dt className="text-xs font-semibold tracking-wide text-neutral-600 uppercase">Closes</dt>
                        <dd className="text-neutral-950 tabular-nums">{job.closingDate}</dd>
                      </div>
                    ) : null}
                  </dl>
                  {job.href ? (
                    <div className="lg:col-span-2 lg:flex lg:justify-end">
                      <a
                        href={job.href}
                        className={`inline-flex min-h-11 w-full items-center justify-center gap-1.5 rounded-lg bg-indigo-700 px-4 text-sm font-semibold text-white shadow-sm transition hover:bg-indigo-600 sm:w-auto ${focusRing}`}
                      >
                        Apply<span className="sr-only"> for {job.title}</span>
                        <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-4">
                          <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>
                    </div>
                  ) : null}
                </li>
              ))}
            </ul>
          ) : null}

          {allJobsLabel ? (
            <p className="mt-6">
              <a href={allJobsHref || "#"} className={`inline-flex min-h-11 items-center gap-1.5 rounded text-base font-semibold text-indigo-700 underline decoration-indigo-300 underline-offset-4 hover:decoration-indigo-700 ${focusRing}`}>
                {allJobsLabel}
              </a>
            </p>
          ) : null}

          {eeoHeading ? (
            <aside aria-label={eeoHeading} className="mt-12 grid grid-cols-1 gap-4 rounded-2xl bg-neutral-50 p-6 ring-1 ring-neutral-200 sm:p-8 md:grid-cols-3 md:gap-10">
              <p className="text-base font-semibold text-neutral-950">{eeoHeading}</p>
              <div className="min-w-0 space-y-3 text-sm leading-6 text-pretty text-neutral-700 md:col-span-2">
                {eeoText ? <p>{eeoText}</p> : null}
                {accommodationText ? <p>{accommodationText}</p> : null}
                {tel || hrEmail ? (
                  <p className="flex flex-col gap-x-6 font-semibold sm:flex-row sm:flex-wrap">
                    {tel ? (
                      <a href={`tel:${tel}`} className={`inline-flex min-h-11 items-center rounded text-indigo-700 underline decoration-indigo-300 underline-offset-4 hover:decoration-indigo-700 ${focusRing}`}>
                        {hrPhone}
                      </a>
                    ) : null}
                    {hrEmail ? (
                      <a href={`mailto:${hrEmail}`} className={`inline-flex min-h-11 items-center rounded break-all text-indigo-700 underline decoration-indigo-300 underline-offset-4 hover:decoration-indigo-700 ${focusRing}`}>
                        {hrEmail}
                      </a>
                    ) : null}
                  </p>
                ) : null}
              </div>
            </aside>
          ) : null}
        </div>
      </section>
    );
  },
};
```
