# Add the "Makerspace Equipment" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/makerspace-equipment) to this Pantheon Content Publisher (P1) Next.js project. A makerspace tool catalog with certification status, reservation length, material costs and book or certify links.

## Steps

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

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

/**
 * Makerspace Equipment — the makerspace tool catalog: each machine with a photo, description,
 * whether certification is required, reservation length, material costs and a book/certify link.
 * Register: `MakerspaceEquipmentBlock: makerspaceEquipmentBlock` in puck.config.tsx.
 */

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

type Equipment = {
  name: string;
  category: string;
  description: string;
  imageUrl: string;
  imageAlt: string;
  certification: "required" | "none";
  reservation: string;
  cost: string;
  linkLabel: string;
  href: string;
};

export type MakerspaceEquipmentProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  location: string;
  equipment: Equipment[];
  certifyText: string;
  certifyLabel: string;
  certifyHref: string;
};

const childLevel = { 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-600";

export const makerspaceEquipmentBlock: ComponentConfig<MakerspaceEquipmentProps> = {
  label: "Makerspace Equipment",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "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" },
    location: { type: "text", label: "Location and hours", metadata: { help: "One line, such as Main Library, lower level · Tue–Sat 10–6. Leave blank to hide it." } },
    equipment: {
      type: "array",
      label: "Equipment",
      min: 1,
      max: 16,
      getItemSummary: (item) => item?.name || "Equipment",
      defaultItemProps: { name: "New equipment", category: "", description: "", imageUrl: "", imageAlt: "", certification: "none", reservation: "Up to 2 hours", cost: "Free", linkLabel: "", href: "" },
      arrayFields: {
        name: { type: "text", label: "Name" },
        category: { type: "text", label: "Category", metadata: { help: "Such as Fabrication or Audio & video. Leave blank to hide it." } },
        description: { type: "textarea", label: "Description" },
        imageUrl: { type: "text", label: "Image URL", metadata: { help: "Leave blank to show a plain tile." } },
        imageAlt: { type: "text", label: "Image alt text", metadata: { help: "Describe the machine for someone who can't see the photo." } },
        certification: {
          type: "radio",
          label: "Certification",
          options: [
            { label: "Required", value: "required" },
            { label: "Not required", value: "none" },
          ],
          metadata: { help: "Required means patrons must finish a safety class before booking." },
        },
        reservation: { type: "text", label: "Reservation length", metadata: { help: "Such as Up to 4 hours per day." } },
        cost: { type: "text", label: "Cost", metadata: { help: "Such as Free, or 10¢ per gram of filament." } },
        linkLabel: { type: "text", label: "Link text", metadata: { help: "Leave blank to use Get certified or Reserve, based on the certification setting." } },
        href: { type: "text", label: "Link", metadata: { help: "Booking page, or the certification class sign-up. Leave blank to hide it." } },
      },
    },
    certifyText: { type: "textarea", label: "Certification note", metadata: { help: "Explains the safety classes. Leave blank to hide it." } },
    certifyLabel: { type: "text", label: "Class schedule link text" },
    certifyHref: { type: "text", label: "Class schedule link" },
  },
  defaultProps: {
    eyebrow: "The Workshop at Cedar Valley",
    heading: "Makerspace equipment",
    headingLevel: "h2",
    intro: "Prototype a product, mend a jacket, or record your first podcast. Anyone with a Cedar Valley library card, age 13 and up, can use the makerspace. Staff are on hand to help.",
    location: "Main Library, lower level · Tue–Sat 10 a.m.–6 p.m.",
    equipment: [
      { name: "3D printers", category: "Fabrication", description: "Two filament printers for models, replacement parts and prototypes. Bring a file or design one on our computers.", imageUrl: "https://picsum.photos/seed/printer3d/640/480", imageAlt: "A 3D printer building a small blue part layer by layer", certification: "required", reservation: "Up to 6 hours per print", cost: "10¢ per gram of filament", linkLabel: "", href: "/makerspace/3d-printing" },
      { name: "Laser cutter", category: "Fabrication", description: "Cut and engrave wood, acrylic, leather and cardstock up to 12 × 20 inches.", imageUrl: "https://picsum.photos/seed/lasercut/640/480", imageAlt: "A laser cutter engraving a pattern into a sheet of plywood", certification: "required", reservation: "1 hour per day", cost: "Free; bring materials or buy plywood at cost", linkLabel: "", href: "/makerspace/laser-cutter" },
      { name: "Sewing machines", category: "Textiles", description: "Two computerized sewing machines and a serger, plus irons, cutting mats and notions.", imageUrl: "", imageAlt: "", certification: "none", reservation: "Up to 3 hours", cost: "Free", linkLabel: "", href: "/makerspace/reserve?item=sewing" },
      { name: "Recording studio", category: "Audio & video", description: "A soundproofed booth with two microphones, an audio interface, keyboard and editing software for podcasts and music.", imageUrl: "https://picsum.photos/seed/studiomic/640/480", imageAlt: "A microphone with a pop filter in a small recording booth", certification: "required", reservation: "2 hours, twice a week", cost: "Free", linkLabel: "", href: "/makerspace/studio" },
    ],
    certifyText: "Free 60-minute safety classes run every Tuesday evening and Saturday morning. Certification lasts two years and works at every branch.",
    certifyLabel: "See the class schedule",
    certifyHref: "/makerspace/classes",
  },
  render: ({ id, eyebrow, heading, headingLevel, intro, location, equipment, certifyText, certifyLabel, certifyHref }) => {
    const H = headingLevel || "h2";
    const Sub = childLevel[H] ?? "h3";
    const uid = `p1-makerspace-${id || "block"}`;
    const list = (equipment ?? []).filter((e) => e?.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-6xl">
          <div className="flex flex-col gap-6 lg:flex-row lg:items-end lg:justify-between lg:gap-16">
            <div className="max-w-2xl">
              {eyebrow ? <p className="text-sm font-semibold tracking-wide text-indigo-700 uppercase">{eyebrow}</p> : null}
              {heading ? (
                <H className={`${eyebrow ? "mt-3" : ""} font-serif 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>
            {location ? (
              <p className="flex items-start gap-2 self-start rounded-xl bg-white px-4 py-3 text-sm leading-6 font-medium text-neutral-900 ring-1 ring-neutral-200 lg:max-w-xs lg:self-auto">
                <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="mt-0.5 size-5 shrink-0 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>
                {location}
              </p>
            ) : null}
          </div>

          {list.length ? (
            <ul role="list" className="mt-10 space-y-5 sm:mt-12">
              {list.map((e, i) => {
                const required = e.certification === "required";
                const nameId = `${uid}-item-${i}`;
                return (
                  <li key={`${e.name}-${i}`}>
                    <article aria-labelledby={nameId} className="grid grid-cols-1 overflow-hidden rounded-2xl bg-white shadow-xs ring-1 ring-neutral-200 sm:grid-cols-12">
                      <div className="relative sm:col-span-4 sm:min-h-48 lg:col-span-3">
                        {e.imageUrl ? (
                          <img src={e.imageUrl} alt={e.imageAlt || ""} loading="lazy" className="aspect-4/3 w-full bg-neutral-100 object-cover sm:absolute sm:inset-0 sm:aspect-auto sm:h-full" />
                        ) : (
                          <div aria-hidden="true" className="grid aspect-4/3 size-full place-items-center bg-indigo-50 sm:aspect-auto sm:min-h-48">
                            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.25" className="size-16 text-indigo-300">
                              <path strokeLinecap="round" strokeLinejoin="round" d="M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z" />
                            </svg>
                          </div>
                        )}
                      </div>
                      <div className="flex flex-col gap-5 p-5 sm:col-span-8 sm:p-6 lg:col-span-9 lg:flex-row lg:gap-8">
                        <div className="min-w-0 flex-1">
                          {e.category ? <p className="text-xs font-semibold tracking-wide text-indigo-700 uppercase">{e.category}</p> : null}
                          <Sub id={nameId} className="mt-1 text-xl font-semibold tracking-tight text-neutral-950">
                            {e.name}
                          </Sub>
                          {e.description ? <p className="mt-2 text-sm leading-6 text-pretty text-neutral-600">{e.description}</p> : null}
                          <p
                            className={`mt-4 inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-semibold ${required ? "bg-indigo-600 text-white" : "bg-neutral-100 text-neutral-800 ring-1 ring-neutral-300"}`}
                          >
                            <svg aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" className="size-3.5">
                              {required ? (
                                <path fillRule="evenodd" d="M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z" clipRule="evenodd" />
                              ) : (
                                <path fillRule="evenodd" d="M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14Zm3.844-8.791a.75.75 0 0 0-1.188-.918l-3.7 4.79-1.649-1.833a.75.75 0 1 0-1.114 1.004l2.25 2.5a.75.75 0 0 0 1.15-.043l4.25-5.5Z" clipRule="evenodd" />
                              )}
                            </svg>
                            {required ? "Certification required" : "No certification needed"}
                          </p>
                        </div>
                        <div className="flex flex-col gap-4 lg:w-60 lg:shrink-0 lg:border-l lg:border-neutral-200 lg:pl-8">
                          {e.reservation || e.cost ? (
                            <dl className="grid grid-cols-1 gap-3 text-sm sm:grid-cols-2 lg:grid-cols-1">
                              {e.reservation ? (
                                <div>
                                  <dt className="text-xs font-semibold tracking-wide text-neutral-500 uppercase">Reservation</dt>
                                  <dd className="mt-0.5 font-medium text-neutral-950">{e.reservation}</dd>
                                </div>
                              ) : null}
                              {e.cost ? (
                                <div>
                                  <dt className="text-xs font-semibold tracking-wide text-neutral-500 uppercase">Cost</dt>
                                  <dd className="mt-0.5 font-medium text-neutral-950">{e.cost}</dd>
                                </div>
                              ) : null}
                            </dl>
                          ) : null}
                          {e.href ? (
                            <a
                              href={e.href}
                              className={`mt-auto inline-flex min-h-11 items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold shadow-sm transition ${required ? "bg-white text-neutral-950 ring-1 ring-neutral-300 hover:bg-neutral-50" : "bg-indigo-600 text-white hover:bg-indigo-500"} ${focusRing}`}
                            >
                              {e.linkLabel || (required ? "Get certified" : "Reserve")}
                              <span className="sr-only">: {e.name}</span>
                            </a>
                          ) : null}
                        </div>
                      </div>
                    </article>
                  </li>
                );
              })}
            </ul>
          ) : null}

          {certifyText || certifyLabel ? (
            <div className="mt-10 flex flex-col gap-4 rounded-2xl border border-dashed border-indigo-300 bg-white p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6">
              <div className="flex gap-3">
                <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="mt-0.5 size-5 shrink-0 text-indigo-600">
                  <path fillRule="evenodd" d="M9.664 1.319a.75.75 0 0 1 .672 0 41.059 41.059 0 0 1 8.198 5.424.75.75 0 0 1-.254 1.285 31.372 31.372 0 0 0-7.86 3.83.75.75 0 0 1-.84 0 31.508 31.508 0 0 0-2.08-1.287V9.394c0-.244.116-.463.302-.592a35.504 35.504 0 0 1 3.305-2.033.75.75 0 0 0-.714-1.319 37 37 0 0 0-3.446 2.12A2.216 2.216 0 0 0 6 9.393v.38a31.293 31.293 0 0 0-4.28-1.746.75.75 0 0 1-.254-1.285 41.059 41.059 0 0 1 8.198-5.424ZM6 11.459a29.848 29.848 0 0 0-2.455-1.158 41.029 41.029 0 0 0-.39 3.114.75.75 0 0 0 .419.74c.528.256 1.046.53 1.554.82-.21.324-.455.63-.739.914a.75.75 0 1 0 1.06 1.06c.37-.369.69-.77.96-1.193a26.61 26.61 0 0 1 3.095 2.348.75.75 0 0 0 .992 0 26.547 26.547 0 0 1 5.93-3.95.75.75 0 0 0 .42-.739 41.053 41.053 0 0 0-.39-3.114 29.925 29.925 0 0 0-5.199 2.801 2.25 2.25 0 0 1-2.514 0c-.41-.275-.826-.541-1.25-.797a6.985 6.985 0 0 1-1.084 3.45 26.503 26.503 0 0 0-1.281-.78A5.487 5.487 0 0 0 6 12v-.54Z" clipRule="evenodd" />
                </svg>
                {certifyText ? <p className="text-sm leading-6 text-pretty text-neutral-700">{certifyText}</p> : null}
              </div>
              {certifyLabel ? (
                <a
                  href={certifyHref || "#"}
                  className={`inline-flex min-h-11 shrink-0 items-center justify-center rounded-xl bg-indigo-600 px-5 py-2.5 text-sm font-semibold text-white shadow-sm transition hover:bg-indigo-500 ${focusRing}`}
                >
                  {certifyLabel}
                </a>
              ) : null}
            </div>
          ) : null}
        </div>
      </section>
    );
  },
};
```
