Admin API and screens: dashboard and setup checklist, template and style, pages and blocks, ministries, leadership, media library with the storage limit, publish and history. Pending changes with who and when, discard one, one Publish, restore any version (each version keeps the working copy's rows, never sent to visitors). Preview on the site's own addresses with a bar (widths, back, publish); shared preview links for 7 days or until revoked. Roles checked, same-origin changes only. Publish refreshes the public pages at once (WEBSITE_CONTENT_CACHE_SECONDS). E2E on a production build: the admin's flows and axe on every screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
22 lines
937 B
TypeScript
22 lines
937 B
TypeScript
"use client";
|
|
|
|
import { canEdit } from "@/admin/api";
|
|
import { ListEditor } from "@/admin/ListEditor";
|
|
import { Title, useAdmin } from "@/admin/ui";
|
|
|
|
/** The team (§6): shown on the Leadership page and the home page's Team section. */
|
|
export default function Leaders() {
|
|
const { data } = useAdmin<{ user: { role: string } }>("/me");
|
|
return (
|
|
<>
|
|
<Title sub="The people who lead your church. The first is shown largest in the Featured layout.">Leadership</Title>
|
|
<ListEditor path="/leaders" nameKey="name" subKey="role" addLabel="Add a person" canAdd={!!data && canEdit(data.user.role)} fields={[
|
|
{ key: "name", label: "Name", kind: "text", max: 120 },
|
|
{ key: "role", label: "Role", kind: "text", max: 120, hint: "E.g. “Lead pastor”." },
|
|
{ key: "bio", label: "About them", kind: "textarea", max: 4000 },
|
|
{ key: "photoId", label: "Photo", kind: "image" },
|
|
]} />
|
|
</>
|
|
);
|
|
}
|