# Add the "CTA App Download" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/cta-app-download) to this Pantheon Content Publisher (P1) Next.js project. Mobile app promo with a feature list, App Store and Google Play links, a no-app fallback line and a CSS phone-framed screenshot.

## Steps

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

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

/**
 * CTA App Download — promotes a mobile app (a city service app, a museum audio guide) with a
 * feature list, App Store and Google Play links, and a screenshot in a pure-CSS phone frame.
 * Register: `CtaAppDownloadBlock: ctaAppDownloadBlock` in puck.config.tsx.
 */

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

export type CtaAppDownloadProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  body: string;
  features: { text: string }[];
  appStoreLabel: string;
  appStoreHref: string;
  playStoreLabel: string;
  playStoreHref: string;
  hint: string;
  imageUrl: string;
  imageAlt: string;
};

export const ctaAppDownloadBlock: ComponentConfig<CtaAppDownloadProps> = {
  label: "CTA App Download",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "Usually the app's name. 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." },
    },
    body: { type: "textarea", label: "Body" },
    features: {
      type: "array",
      label: "Features",
      min: 0,
      max: 5,
      getItemSummary: (item) => item?.text || "Feature",
      defaultItemProps: { text: "What people can do in the app" },
      arrayFields: { text: { type: "text", label: "Feature" } },
      metadata: { help: "Short lines on what the app does. Three or four read best." },
    },
    appStoreLabel: { type: "text", label: "App Store link text", metadata: { help: "Leave blank to hide the App Store link." } },
    appStoreHref: { type: "text", label: "App Store link", metadata: { help: "Your app's page on the Apple App Store." } },
    playStoreLabel: { type: "text", label: "Google Play link text", metadata: { help: "Leave blank to hide the Google Play link." } },
    playStoreHref: { type: "text", label: "Google Play link", metadata: { help: "Your app's page on Google Play." } },
    hint: { type: "text", label: "Small print", metadata: { help: "Such as other ways to reach the service without the app. Leave blank to hide it." } },
    imageUrl: { type: "text", label: "Screenshot URL", metadata: { help: "A tall app screenshot (about 9:19). Shown inside a phone frame. Leave blank to hide it." } },
    imageAlt: { type: "text", label: "Screenshot alt text", metadata: { help: "Describe what the screen shows, such as \"Report form with a map pin on Main Street\"." } },
  },
  defaultProps: {
    eyebrow: "Lakeview 311",
    heading: "Report it in under a minute, from the curb",
    headingLevel: "h2",
    body: "Snap a photo of a pothole, broken streetlight or missed pickup. The app drops a pin, routes it to the right crew and texts you when it's fixed.",
    features: [
      { text: "Photo and map pin attached automatically" },
      { text: "Track every request you've made" },
      { text: "Alerts for street sweeping and snow routes" },
      { text: "Available in English, Spanish and Vietnamese" },
    ],
    appStoreLabel: "Download on the App Store",
    appStoreHref: "https://apps.apple.com/",
    playStoreLabel: "Get it on Google Play",
    playStoreHref: "https://play.google.com/store",
    hint: "No smartphone? Call 311 or use the web form at lakeview.gov/311, any time of day.",
    imageUrl: "https://picsum.photos/seed/cityapp/540/1140",
    imageAlt: "The Lakeview 311 app showing a report form with a map pin on Main Street",
  },
  render: ({ eyebrow, heading, headingLevel, body, features, appStoreLabel, appStoreHref, playStoreLabel, playStoreHref, hint, imageUrl, imageAlt }) => {
    const H = headingLevel || "h2";
    const list = (features ?? []).map((f) => f?.text?.trim()).filter(Boolean) as string[];
    const hasCopy = Boolean(eyebrow || heading || body || list.length || appStoreLabel || playStoreLabel || hint);
    if (!hasCopy && !imageUrl) return <></>;
    const storeClass =
      "inline-flex min-h-14 items-center gap-3 rounded-xl bg-white px-5 py-2.5 text-neutral-950 shadow-sm ring-1 ring-white/20 transition hover:bg-indigo-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white";

    return (
      <section className="bg-white px-4 py-16 sm:px-6 sm:py-20 lg:px-8 lg:py-24">
        <div className="relative isolate mx-auto max-w-7xl overflow-hidden rounded-3xl bg-indigo-950 px-6 pt-12 sm:px-12 sm:pt-16 lg:px-16">
          <svg aria-hidden="true" viewBox="0 0 600 600" fill="none" className="absolute -top-40 -left-40 -z-10 size-160 text-indigo-800/60">
            {[80, 140, 200, 260].map((r) => (
              <circle key={r} cx="300" cy="300" r={r} stroke="currentColor" strokeWidth="1" />
            ))}
          </svg>
          <div className={`grid grid-cols-1 gap-12 ${imageUrl && hasCopy ? "lg:grid-cols-12 lg:gap-8" : ""}`}>
            {hasCopy ? (
              <div className={`pb-12 sm:pb-16 ${imageUrl ? "lg:col-span-7 lg:pb-20" : "max-w-2xl"}`}>
                {eyebrow ? (
                  <p className="inline-flex items-center gap-2 rounded-full bg-indigo-400/15 px-3 py-1 text-sm font-semibold text-indigo-100 ring-1 ring-indigo-300/30 ring-inset">
                    {eyebrow}
                  </p>
                ) : null}
                {heading ? (
                  <H className={`text-3xl font-semibold tracking-tight text-balance text-white sm:text-4xl lg:text-5xl ${eyebrow ? "mt-6" : ""}`}>{heading}</H>
                ) : null}
                {body ? <p className="mt-5 max-w-xl text-lg leading-8 text-pretty text-indigo-100">{body}</p> : null}
                {list.length ? (
                  <ul role="list" className="mt-8 grid grid-cols-1 gap-x-8 gap-y-3 text-base leading-7 text-white sm:grid-cols-2">
                    {list.map((f, i) => (
                      <li key={i} className="flex gap-3">
                        <span aria-hidden="true" className="mt-2.5 h-px w-4 shrink-0 bg-indigo-300" />
                        {f}
                      </li>
                    ))}
                  </ul>
                ) : null}
                {appStoreLabel || playStoreLabel ? (
                  <div className="mt-10 flex flex-col gap-3 sm:flex-row sm:flex-wrap">
                    {appStoreLabel ? (
                      <a href={appStoreHref || "#"} className={storeClass}>
                        <svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" className="size-7 shrink-0">
                          <rect x="6" y="2.5" width="12" height="19" rx="2.5" />
                          <path strokeLinecap="round" d="M10.5 18.5h3" />
                        </svg>
                        <span className="text-base leading-tight font-semibold">{appStoreLabel}</span>
                      </a>
                    ) : null}
                    {playStoreLabel ? (
                      <a href={playStoreHref || "#"} className={storeClass}>
                        <svg aria-hidden="true" viewBox="0 0 24 24" fill="currentColor" className="size-7 shrink-0">
                          <path d="M6 3.8v16.4c0 .8.9 1.3 1.6.9l13.3-8.2c.6-.4.6-1.4 0-1.8L7.6 2.9C6.9 2.5 6 3 6 3.8Z" />
                        </svg>
                        <span className="text-base leading-tight font-semibold">{playStoreLabel}</span>
                      </a>
                    ) : null}
                  </div>
                ) : null}
                {hint ? <p className="mt-6 max-w-lg text-sm leading-6 text-pretty text-indigo-200">{hint}</p> : null}
              </div>
            ) : null}

            {imageUrl ? (
              <div className={`flex justify-center ${hasCopy ? "lg:col-span-5 lg:items-end" : ""}`}>
                <div className="relative w-56 translate-y-6 rotate-2 rounded-t-4xl bg-neutral-900 p-2.5 pb-0 shadow-2xl ring-1 ring-white/15 sm:w-64 lg:w-72">
                  <div aria-hidden="true" className="absolute top-5 left-1/2 z-10 h-5 w-20 -translate-x-1/2 rounded-full bg-neutral-950" />
                  <img src={imageUrl} alt={imageAlt || ""} className="aspect-9/16 w-full rounded-t-3xl object-cover object-top" />
                </div>
              </div>
            ) : null}
          </div>
        </div>
      </section>
    );
  },
};
```
