# Add the "Faculty Spotlight" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/faculty-spotlight) to this Pantheon Content Publisher (P1) Next.js project. A featured professor with portrait, pull quote, bio, research-area tags and selected publications.

## Steps

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

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

/**
 * Faculty Spotlight — one featured professor: portrait (or initials), a pull quote,
 * short bio, research areas as tags and a few selected publications.
 * Register: `FacultySpotlightBlock: facultySpotlightBlock` in puck.config.tsx.
 */

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

type Publication = { title: string; venue: string; href: string };

export type FacultySpotlightProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  imageUrl: string;
  imageAlt: string;
  name: string;
  title: string;
  department: string;
  quote: string;
  bio: string;
  research: string;
  publications: Publication[];
  profileLabel: string;
  profileHref: string;
};

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

function initials(name: string | undefined): string {
  const words = (name || "")
    .split(/\s+/)
    .filter((w) => w && !w.endsWith(".") && /\p{L}/u.test(w));
  if (!words.length) return "";
  const first = words[0].match(/\p{L}/u)?.[0] ?? "";
  const last = words.length > 1 ? (words[words.length - 1].match(/\p{L}/u)?.[0] ?? "") : "";
  return (first + last).toUpperCase();
}

export const facultySpotlightBlock: ComponentConfig<FacultySpotlightProps> = {
  label: "Faculty Spotlight",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "Small line above the heading. Leave blank to hide it." } },
    heading: { type: "text", label: "Heading", metadata: { help: "Section heading, such as Faculty spotlight. Leave blank to lead with the name." } },
    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." },
    },
    imageUrl: { type: "text", label: "Photo URL", metadata: { help: "A portrait, ideally 4:5. Leave blank to show initials instead." } },
    imageAlt: { type: "text", label: "Photo alt text", metadata: { help: "Describe the photo, such as Professor Okafor in her lab. Screen readers already hear the name below it." } },
    name: { type: "text", label: "Name" },
    title: { type: "text", label: "Title", metadata: { help: "Such as Associate Professor of Biology." } },
    department: { type: "text", label: "Department" },
    quote: { type: "textarea", label: "Pull quote", metadata: { help: "One or two sentences in their own words. Leave blank to hide it." } },
    bio: { type: "textarea", label: "Bio", metadata: { help: "Blank lines start a new paragraph." } },
    research: { type: "textarea", label: "Research areas", metadata: { help: "One area per line. Each becomes a tag." } },
    publications: {
      type: "array",
      label: "Selected publications",
      min: 0,
      max: 6,
      getItemSummary: (item) => item?.title?.slice(0, 48) || "Publication",
      defaultItemProps: { title: "Publication title", venue: "Journal name, 2026", href: "" },
      arrayFields: {
        title: { type: "text", label: "Title" },
        venue: { type: "text", label: "Venue and year", metadata: { help: "Such as Journal of Applied Ecology, 2025." } },
        href: { type: "text", label: "Link", metadata: { help: "DOI or full URL. Leave blank for no link." } },
      },
    },
    profileLabel: { type: "text", label: "Profile link text", metadata: { help: "Leave blank to hide it." } },
    profileHref: { type: "text", label: "Profile link" },
  },
  defaultProps: {
    eyebrow: "Faculty spotlight",
    heading: "Research that starts in the river and ends up in the classroom",
    headingLevel: "h2",
    imageUrl: "https://picsum.photos/seed/professor/960/1200",
    imageAlt: "Dr. Amara Okafor standing on a riverbank holding a water sampling kit",
    name: "Dr. Amara Okafor",
    title: "Associate Professor of Environmental Science",
    department: "Department of Earth and Environmental Sciences",
    quote: "My undergraduates aren't assisting on the research. They're doing it, and a few of them have caught things I would have missed.",
    bio: "Dr. Okafor studies how agricultural runoff moves through small watersheds and what that means for the towns downstream. Her lab partners with three county water districts on long-term monitoring.\n\nShe joined Northfield State in 2018 and teaches Introduction to Hydrology and the senior field methods capstone.",
    research: "Watershed hydrology\nNutrient runoff\nCommunity science\nWater policy",
    publications: [
      {
        title: "Seasonal nitrate pulses in tile-drained headwater streams",
        venue: "Journal of Freshwater Systems, 2025",
        href: "",
      },
      {
        title: "Training undergraduates as co-investigators in long-term watershed monitoring",
        venue: "Field Methods in Environmental Education, 2024",
        href: "",
      },
      {
        title: "What county water boards need from academic researchers",
        venue: "Rural Water Policy Review, 2023",
        href: "",
      },
    ],
    profileLabel: "View full faculty profile",
    profileHref: "/faculty/amara-okafor",
  },
  render: ({ eyebrow, heading, headingLevel, imageUrl, imageAlt, name, title, department, quote, bio, research, publications, profileLabel, profileHref }) => {
    const H = headingLevel || "h2";
    const Sub = childHeading[headingLevel] || "h3";
    const SubSub = grandchildHeading[headingLevel] || "h4";
    const NameTag = heading ? Sub : H;
    const LabelTag = heading ? SubSub : Sub;
    const tags = (research || "")
      .split("\n")
      .map((t) => t.trim())
      .filter(Boolean);
    const pubs = (publications ?? []).filter((p) => p?.title);
    const paragraphs = (bio || "").split(/\n\s*\n/).filter((p) => p.trim());
    const monogram = initials(name);
    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">
          {eyebrow || heading ? (
            <div className="max-w-3xl">
              {eyebrow ? <p className="text-sm font-semibold tracking-wide text-indigo-700 uppercase">{eyebrow}</p> : null}
              {heading ? (
                <H className={`text-3xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-4xl ${eyebrow ? "mt-3" : ""}`}>{heading}</H>
              ) : null}
            </div>
          ) : null}
          <article className={`grid gap-10 lg:grid-cols-12 lg:gap-16 ${eyebrow || heading ? "mt-10 sm:mt-14" : ""}`}>
            <div className="lg:col-span-5">
              <div className="mx-auto max-w-sm lg:sticky lg:top-8 lg:max-w-none">
                {imageUrl ? (
                  <img
                    src={imageUrl}
                    alt={imageAlt || ""}
                    className="aspect-4/5 w-full rounded-2xl bg-neutral-100 object-cover shadow-xl ring-1 ring-neutral-900/5"
                  />
                ) : monogram ? (
                  <div
                    aria-hidden="true"
                    className="grid aspect-4/5 w-full place-items-center rounded-2xl bg-indigo-50 text-7xl font-semibold tracking-tight text-indigo-700 ring-1 ring-indigo-600/10 ring-inset sm:text-8xl"
                  >
                    {monogram}
                  </div>
                ) : null}
                {name || title || department ? (
                  <div className={imageUrl || monogram ? "mt-6" : undefined}>
                    {name ? <NameTag className="text-2xl font-semibold tracking-tight text-neutral-950">{name}</NameTag> : null}
                    {title ? <p className="mt-1 text-base leading-7 text-neutral-700">{title}</p> : null}
                    {department ? <p className="text-sm leading-6 text-neutral-600">{department}</p> : null}
                  </div>
                ) : null}
              </div>
            </div>
            <div className="lg:col-span-7">
              {quote ? (
                <figure className="relative">
                  <svg aria-hidden="true" viewBox="0 0 32 24" fill="currentColor" className="h-6 w-8 text-indigo-600">
                    <path d="M0 24V14.4C0 6.4 4.4 1.6 12 0l1.6 3.2C9.2 4.8 7.2 7.6 7.2 11.2H12V24H0Zm19.2 0V14.4C19.2 6.4 23.6 1.6 31.2 0l1.6 3.2c-4.4 1.6-6.4 4.4-6.4 8H32V24H19.2Z" />
                  </svg>
                  <blockquote className="mt-5 text-2xl leading-snug font-medium tracking-tight text-pretty text-neutral-950 sm:text-3xl sm:leading-snug">
                    <p>{quote}</p>
                  </blockquote>
                  {name ? <figcaption className="sr-only">{name}</figcaption> : null}
                </figure>
              ) : null}
              {paragraphs.length ? (
                <div className={`max-w-2xl space-y-4 text-base leading-7 text-pretty text-neutral-700 ${quote ? "mt-8 border-t border-neutral-200 pt-8" : ""}`}>
                  {paragraphs.map((para, i) => (
                    <p key={i}>{para}</p>
                  ))}
                </div>
              ) : null}
              {tags.length ? (
                <div className="mt-10">
                  <LabelTag className="text-xs font-semibold tracking-widest text-neutral-600 uppercase">Research areas</LabelTag>
                  <ul role="list" className="mt-4 flex flex-wrap gap-2">
                    {tags.map((tag, i) => (
                      <li key={`${tag}-${i}`} className="rounded-full bg-neutral-100 px-3.5 py-1.5 text-sm font-medium text-neutral-800 ring-1 ring-neutral-200 ring-inset">
                        {tag}
                      </li>
                    ))}
                  </ul>
                </div>
              ) : null}
              {pubs.length ? (
                <div className="mt-10">
                  <LabelTag className="text-xs font-semibold tracking-widest text-neutral-600 uppercase">Selected publications</LabelTag>
                  <ol role="list" className="mt-4 divide-y divide-neutral-200 border-y border-neutral-200">
                    {pubs.map((pub, i) => (
                      <li key={`${pub.title}-${i}`} className="flex gap-4 py-4">
                        <span aria-hidden="true" className="w-6 shrink-0 pt-0.5 text-sm font-semibold text-indigo-700 tabular-nums">
                          {String(i + 1).padStart(2, "0")}
                        </span>
                        <div className="min-w-0">
                          {pub.href ? (
                            <a
                              href={pub.href}
                              className="inline-flex min-h-11 items-center text-base leading-6 font-medium break-words text-neutral-950 underline decoration-neutral-300 underline-offset-4 hover:decoration-indigo-600 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                            >
                              {pub.title}
                            </a>
                          ) : (
                            <p className="text-base leading-6 font-medium text-neutral-950">{pub.title}</p>
                          )}
                          {pub.venue ? <p className="mt-1 text-sm leading-6 text-neutral-600 italic">{pub.venue}</p> : null}
                        </div>
                      </li>
                    ))}
                  </ol>
                </div>
              ) : null}
              {profileLabel ? (
                <a
                  href={profileHref || "#"}
                  className="group mt-10 inline-flex min-h-11 items-center justify-center gap-1.5 rounded-lg bg-indigo-600 px-5 py-3 text-base font-semibold text-white shadow-sm transition hover:bg-indigo-500 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                >
                  {profileLabel}
                  <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 transition 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>
          </article>
        </div>
      </section>
    );
  },
};
```
