/* ═══════════════════════════════════════════════════════════════ REQUEST TYPES What the Request form (/request) can ask for, and whether each can be new, an update, or both. The ids and actions must match CATEGORIES in server/src/routes/requests.js (and the CHECK in 046_content_requests.sql); keep them in step. A link can open the form on one: requestLink("chapter") is /request?type=chapter. People, teams and awards have no buttons on the site, but are here to pick. ═══════════════════════════════════════════════════════════════ */ export type RequestAction = "new" | "update"; export const REQUEST_TYPES: { id: string; label: string; hint: string; actions: RequestAction[]; // What the name field asks, for a new one and for an update. subject: string; }[] = [ { id: "blog", label: "Blog post", hint: "A story or article for the community blog", actions: ["new"], subject: "Its title" }, { id: "event", label: "Event", hint: "A retreat, gathering or calendar event", actions: ["new", "update"], subject: "The event's name" }, { id: "chapter", label: "Chapter", hint: "A local NGU chapter", actions: ["new", "update"], subject: "The chapter's name" }, { id: "region", label: "Region", hint: "Details for a Unity region", actions: ["update"], subject: "Which region" }, { id: "partner", label: "Partner", hint: "A partner organization", actions: ["new", "update"], subject: "The organization's name" }, { id: "team", label: "Team", hint: "A team or committee", actions: ["new", "update"], subject: "The team's name" }, { id: "award", label: "Award", hint: "An award and who received it", actions: ["new", "update"], subject: "The award's name" }, { id: "person", label: "Person", hint: "Someone's profile", actions: ["new", "update"], subject: "Their name" }, ]; export const requestLink = (type: string) => `/request?type=${type}`; const BY_ID = new Map(REQUEST_TYPES.map((t) => [t.id, t.label])); export const requestTypeLabel = (id: string) => BY_ID.get(id) ?? id;