# Add the "Quick Tasks" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/quick-tasks) to this Pantheon Content Publisher (P1) Next.js project. An "I want to…" grid of top online services with large tap-friendly tiles and an optional site search.

## Steps

1. Create `components/puck/quick-tasks-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 { quickTasksBlock } from "./components/puck/quick-tasks-block";`
3. Register it under `components` as `QuickTasksBlock: quickTasksBlock`.
4. Add `"QuickTasksBlock"` 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/quick-tasks-block.tsx`

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

/**
 * Quick Tasks — the "I want to…" grid of a city's most-used services, with an optional
 * site search. Large tiles make each task an easy tap on a phone.
 * Register: `QuickTasksBlock: quickTasksBlock` in puck.config.tsx.
 */

type Heading = "h1" | "h2" | "h3" | "h4";
type Icon = "pay" | "report" | "permit" | "trash" | "water" | "bus" | "vote" | "jobs" | "calendar" | "home";

export type QuickTasksProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  searchAction: string;
  searchParam: string;
  searchLabel: string;
  searchPlaceholder: string;
  tasks: {
    icon: Icon;
    label: string;
    description: string;
    href: string;
  }[];
};

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

const icons: Record<Icon, string> = {
  pay: "M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 0 0 2.25-2.25V6.75A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25v10.5A2.25 2.25 0 0 0 4.5 19.5Z",
  report:
    "M21.75 6.75a4.5 4.5 0 0 1-4.884 4.484c-1.076-.091-2.264.071-2.95.904l-7.152 8.684a2.548 2.548 0 1 1-3.586-3.586l8.684-7.152c.833-.686.995-1.874.904-2.95a4.5 4.5 0 0 1 6.336-4.486l-3.276 3.276a3.004 3.004 0 0 0 2.25 2.25l3.276-3.276c.256.565.398 1.192.398 1.852ZM4.867 19.125h.008v.008h-.008v-.008Z",
  permit:
    "M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z",
  trash:
    "m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0",
  water: "M12 2.75c-3.6 4.4-6.75 8.2-6.75 11.75a6.75 6.75 0 0 0 13.5 0C18.75 10.95 15.6 7.15 12 2.75ZM8.75 14.75a3.25 3.25 0 0 0 3.25 3.25",
  bus: "M6 3.75h12A2.25 2.25 0 0 1 20.25 6v10.5a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5V6A2.25 2.25 0 0 1 6 3.75ZM3.75 12.75h16.5M3.75 7.5h16.5M6.75 18v2.25M17.25 18v2.25M7.5 15.375h.008M16.5 15.375h.008",
  vote: "M7.5 12.75V4.5a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 .75.75v8.25M9.75 8.25l1.5 1.5 3-3M3.75 12.75h16.5v6a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5v-6Z",
  jobs: "M20.25 14.15v4.25c0 1.094-.787 2.036-1.872 2.18-2.087.277-4.216.42-6.378.42s-4.291-.143-6.378-.42c-1.085-.144-1.872-1.086-1.872-2.18v-4.25m16.5 0a2.18 2.18 0 0 0 .75-1.661V8.706c0-1.081-.768-2.015-1.837-2.175a48.114 48.114 0 0 0-3.413-.387m4.5 8.006c-.194.165-.42.295-.673.38A23.978 23.978 0 0 1 12 15.75c-2.648 0-5.195-.429-7.577-1.22a2.016 2.016 0 0 1-.673-.38m0 0A2.18 2.18 0 0 1 3 12.489V8.706c0-1.081.768-2.015 1.837-2.175a48.111 48.111 0 0 1 3.413-.387m7.5 0V5.25A2.25 2.25 0 0 0 13.5 3h-3a2.25 2.25 0 0 0-2.25 2.25v.894m7.5 0a48.667 48.667 0 0 0-7.5 0M12 12.75h.008v.008H12v-.008Z",
  calendar:
    "M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5",
  home: "m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25",
};

const iconOptions: { label: string; value: Icon }[] = [
  { label: "Card (pay)", value: "pay" },
  { label: "Wrench (report a problem)", value: "report" },
  { label: "Document (permits)", value: "permit" },
  { label: "Trash can", value: "trash" },
  { label: "Water drop", value: "water" },
  { label: "Bus (transit)", value: "bus" },
  { label: "Ballot box (vote)", value: "vote" },
  { label: "Briefcase (jobs)", value: "jobs" },
  { label: "Calendar", value: "calendar" },
  { label: "House (housing)", value: "home" },
];

export const quickTasksBlock: ComponentConfig<QuickTasksProps> = {
  label: "Quick Tasks",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "Small line above the heading, like \"I want to…\". 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." },
    },
    intro: { type: "textarea", label: "Intro", metadata: { help: "Leave blank to hide it." } },
    searchAction: {
      type: "text",
      label: "Search page URL",
      metadata: { help: "Where the search form sends people, like /search. Leave blank to hide the search box." },
    },
    searchParam: { type: "text", label: "Search query name", metadata: { help: "The URL parameter your search page reads, usually q." } },
    searchLabel: { type: "text", label: "Search label", metadata: { help: "Read aloud and shown above the box, like \"Search the city website\"." } },
    searchPlaceholder: { type: "text", label: "Search example text", metadata: { help: "A short example inside the box. Don't put instructions here; they disappear as people type." } },
    tasks: {
      type: "array",
      label: "Tasks",
      min: 1,
      max: 16,
      getItemSummary: (item) => item?.label || "Task",
      defaultItemProps: { icon: "permit", label: "New task", description: "", href: "" },
      arrayFields: {
        icon: { type: "select", label: "Icon", options: iconOptions },
        label: { type: "text", label: "Task", metadata: { help: "Start with a verb, like \"Pay a water bill\"." } },
        description: { type: "textarea", label: "Short description", metadata: { help: "Under ten words. Leave blank to hide it." } },
        href: { type: "text", label: "Link", metadata: { help: "A path (/pay), full URL, mailto: or tel:." } },
      },
    },
  },
  defaultProps: {
    eyebrow: "I want to…",
    heading: "How can we help?",
    headingLevel: "h2",
    intro: "The services Millbrook residents use most, in one place. Most can be done online in a few minutes.",
    searchAction: "/search",
    searchParam: "q",
    searchLabel: "Search the city website",
    searchPlaceholder: "Try \"building permit\"",
    tasks: [
      { icon: "pay", label: "Pay a utility bill", description: "Water, sewer and stormwater, online or by phone.", href: "/utilities/pay" },
      { icon: "report", label: "Report a problem", description: "Potholes, streetlights, graffiti and more.", href: "/311" },
      { icon: "permit", label: "Apply for a permit", description: "Building, fence, sign and special event permits.", href: "/permits" },
      { icon: "trash", label: "Check trash day", description: "Your pickup day and holiday changes.", href: "/sanitation/schedule" },
      { icon: "water", label: "Start or stop water", description: "Moving in or out of Millbrook.", href: "/utilities/service" },
      { icon: "vote", label: "Register to vote", description: "Find your polling place and ballot.", href: "/elections" },
      { icon: "jobs", label: "Find a city job", description: "Full-time, part-time and seasonal openings.", href: "/jobs" },
      { icon: "calendar", label: "Attend a meeting", description: "Agendas, livestreams and minutes.", href: "/meetings" },
    ],
  },
  render: ({ id, eyebrow, heading, headingLevel, intro, searchAction, searchParam, searchLabel, searchPlaceholder, tasks }) => {
    const H = headingLevel || "h2";
    const Sub = childHeading[headingLevel] || "h3";
    const list = (tasks ?? []).filter((t) => t?.label);
    const searchId = `${id || "quick-tasks"}-search`;
    const hasHeader = Boolean(eyebrow || heading || intro);
    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 || searchAction ? (
            <div className="flex flex-col gap-8 lg:flex-row lg:items-end lg:justify-between lg:gap-16">
              {hasHeader ? (
                <div className="max-w-2xl">
                  {eyebrow ? <p className="text-sm font-semibold tracking-wide text-indigo-700">{eyebrow}</p> : null}
                  {heading ? (
                    <H className={`text-3xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-4xl ${eyebrow ? "mt-2" : ""}`}>{heading}</H>
                  ) : null}
                  {intro ? <p className="mt-4 text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
                </div>
              ) : null}
              {searchAction ? (
                <form action={searchAction} method="get" role="search" className="w-full lg:max-w-md">
                  <label htmlFor={searchId} className="block text-sm leading-6 font-semibold text-neutral-900">
                    {searchLabel || "Search"}
                  </label>
                  <div className="mt-2 flex gap-2">
                    <input
                      id={searchId}
                      type="search"
                      name={searchParam || "q"}
                      placeholder={searchPlaceholder || undefined}
                      autoComplete="off"
                      className="block min-h-12 w-full min-w-0 flex-1 rounded-lg border-0 bg-white px-4 text-base text-neutral-950 shadow-sm ring-1 ring-neutral-300 ring-inset placeholder:text-neutral-500 focus:ring-2 focus:ring-indigo-600 focus:outline-none"
                    />
                    <button
                      type="submit"
                      className="inline-flex min-h-12 shrink-0 items-center gap-2 rounded-lg bg-indigo-700 px-4 text-base font-semibold text-white shadow-sm transition hover:bg-indigo-600 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-700 sm:px-5"
                    >
                      <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5">
                        <path fillRule="evenodd" d="M9 3.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11ZM2 9a7 7 0 1 1 12.452 4.391l3.328 3.329a.75.75 0 1 1-1.06 1.06l-3.329-3.328A7 7 0 0 1 2 9Z" clipRule="evenodd" />
                      </svg>
                      Search
                    </button>
                  </div>
                </form>
              ) : null}
            </div>
          ) : null}
          {list.length ? (
            <ul role="list" className={`grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-4 ${hasHeader || searchAction ? "mt-10 sm:mt-12" : ""}`}>
              {list.map((task, i) => (
                <li key={`${task.label}-${i}`} className="group relative flex">
                  <div className="flex w-full items-start gap-4 rounded-2xl bg-white p-5 shadow-sm ring-1 ring-neutral-200 transition group-hover:ring-indigo-300 motion-safe:group-hover:-translate-y-0.5 sm:flex-col sm:gap-0 sm:p-6">
                    <svg
                      aria-hidden="true"
                      viewBox="0 0 24 24"
                      fill="none"
                      stroke="currentColor"
                      strokeWidth={1.5}
                      strokeLinecap="round"
                      strokeLinejoin="round"
                      className="size-8 shrink-0 text-indigo-700 sm:size-9"
                    >
                      <path d={icons[task.icon] ?? icons.permit} />
                    </svg>
                    <div className="min-w-0 flex-1 sm:mt-6">
                      <Sub className="text-lg leading-6 font-semibold tracking-tight text-neutral-950">
                        {task.href ? (
                          <a
                            href={task.href}
                            className="outline-none after:absolute after:inset-0 after:rounded-2xl group-hover:text-indigo-800 focus-visible:after:outline-2 focus-visible:after:outline-offset-2 focus-visible:after:outline-indigo-700"
                          >
                            {task.label}
                          </a>
                        ) : (
                          task.label
                        )}
                      </Sub>
                      {task.description ? <p className="mt-1.5 text-sm leading-6 text-pretty text-neutral-600">{task.description}</p> : null}
                    </div>
                    {task.href ? (
                      <svg
                        aria-hidden="true"
                        viewBox="0 0 20 20"
                        fill="currentColor"
                        className="mt-1 size-5 shrink-0 text-neutral-400 transition group-hover:text-indigo-700 motion-safe:group-hover:translate-x-0.5 sm:hidden"
                      >
                        <path fillRule="evenodd" d="M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z" clipRule="evenodd" />
                      </svg>
                    ) : null}
                  </div>
                </li>
              ))}
            </ul>
          ) : null}
        </div>
      </section>
    );
  },
};
```
