/**
 * The content fields each section's website design actually shows, per CMS page and
 * section key. The admin form lists only these, so editors don't fill in fields the
 * page never displays (the API accepts more: e.g. every text-image takes a lead,
 * figures, points and buttons, but most designs show none of them).
 *
 * - A field key keeps the whole field; "items.title" keeps one field of a list's items
 *   (or of a group).
 * - A section or page that isn't listed shows every field of its type.
 *
 * Keep in sync with the renderers in ./<page>/sections.tsx and ../home/sections.tsx.
 */
const TEXT_IMAGE = ["title", "body", "image", "imagePosition"];
/** feature-cards whose cards show an icon, title and description (no buttons). */
const CARDS = ["title", "body", "items.title", "items.description", "items.icon"];
/** feature-cards whose cards show an icon, title and bullet list (no buttons). */
const BULLET_CARDS = ["title", "body", "items.title", "items.bullets", "items.icon"];

export const DESIGN_FIELDS: Record<string, Record<string, string[]>> = {
  home: {
    "trust-badges": ["items.title", "items.description", "items.icon"],
    about: TEXT_IMAGE,
    mission: TEXT_IMAGE,
    "global-impact": TEXT_IMAGE,
    solutions: ["title", "items.title", "items.description", "items.icon", "ctas"],
    "strategic-partners": ["title", "logos"],
    contact: ["title", "body", "phone", "email", "address", "mapUrl", "formTitle", "submitLabel", "ctas"],
  },
  about: {
    introduction: TEXT_IMAGE,
    vision: ["title", "body", "bullets", "note", "image", "imagePosition"],
    "what-we-deliver": ["title", "items.title", "items.description", "items.icon"],
    expansion: ["title", "body", "bullets", "note", "image", "imagePosition"],
    "why-us": ["title", "body", "items.title", "items.description", "items.icon"],
  },
  partners: {
    introduction: TEXT_IMAGE,
    "industry-sectors": ["title", "body", "items.title", "items.description", "items.icon"],
  },
  "why-choose-us": {
    introduction: TEXT_IMAGE,
    "in-action": ["title", "items.title", "items.description", "items.icon"],
    "built-to-lead": [...TEXT_IMAGE, "stats"],
  },
  careers: {
    introduction: [...TEXT_IMAGE, "features.title", "features.description", "features.icon"],
    offerings: ["title", "body", "items.title", "items.bullets", "items.icon"],
    "hiring-areas": ["title", "body", "items.title", "items.description", "items.icon"],
  },
  "global-strategy": {
    introduction: [...TEXT_IMAGE, "features.title", "features.description", "features.icon"],
    "focus-areas": CARDS,
    mission: BULLET_CARDS,
    leadership: CARDS,
  },
  awards: {
    introduction: TEXT_IMAGE,
    pending: CARDS,
    "why-us": CARDS,
    offerings: BULLET_CARDS,
  },
  testimonials: {
    introduction: [...TEXT_IMAGE, "stats"],
  },
  "partner-with-us": {
    introduction: [...TEXT_IMAGE, "lead"],
    "why-partner": CARDS,
    "who-can-partner": CARDS,
  },
  "sustainability-esg": {
    introduction: TEXT_IMAGE,
    sourcing: CARDS,
    "forest-planting": ["title", "body", "bullets", "image", "imagePosition"],
    environmental: CARDS,
    governance: CARDS,
  },
  "social-responsibility": {
    introduction: [...TEXT_IMAGE, "features.title", "features.description"],
    initiatives: ["title", "body", "items.title", "items.details", "items.icon"],
    partnerships: CARDS,
  },
  roadmap: {
    introduction: TEXT_IMAGE,
    "final-words": CARDS,
  },
  "ai-innovation-lab": {
    introduction: [...TEXT_IMAGE, "features.title", "features.description", "features.icon"],
    "ethical-sourcing": TEXT_IMAGE,
    "core-capabilities": ["title", "items.title", "items.description", "items.icon"],
    robotics: TEXT_IMAGE,
    manufacturing: ["title", "items.title", "items.description", "items.icon"],
    "risk-intelligence": TEXT_IMAGE,
    "risk-capabilities": ["title", "items.title", "items.description", "items.icon"],
  },
  "media-insights": {
    // press-kit: the banner is a picture with its text drawn in; the CMS text is its accessible text.
    "latest-news": ["title", "body", "count", "cta"],
    "media-inquiries": ["title", "body", "phone", "email", "address", "mapUrl", "ctas", "formTitle", "inquiryTypes", "submitLabel"],
  },
  "unionists-magazine": {
    introduction: [...TEXT_IMAGE, "ctas"],
    voice: [...TEXT_IMAGE, "ctas"],
  },
  "global-presence": {
    introduction: TEXT_IMAGE,
    "growth-strategy": ["title", "body", "items.title", "items.description"],
  },
  donations: {
    introduction: TEXT_IMAGE,
    offers: ["title", "items.title", "items.description", "items.icon"],
    campaigns: ["title", "body", "count", "cta"],
    commitment: CARDS,
  },
  contact: {
    contact: ["title", "body", "phone", "email", "emails", "address", "mapUrl", "formTitle", "inquiryTypes", "meetingDateOptions", "meetingTimeOptions", "submitLabel"],
    "business-meeting": ["title", "body", "items.title", "items.bullets", "items.numbered"],
  },
  "product-services": {
    introduction: TEXT_IMAGE,
    certifications: ["title", "lead", "body", "image", "imagePosition"],
  },
  "global-agriculture": {
    introduction: TEXT_IMAGE,
    catalog: ["searchPlaceholder", "filtersLabel", "filterHeadings", "productTypeLabels", "volumeLabels", "seeMoreLabel"],
  },
  services: {
    introduction: TEXT_IMAGE,
    "global-network": TEXT_IMAGE,
  },
  "industries-we-serve": {
    introduction: TEXT_IMAGE,
    "industry-sectors": ["title", "body", "items.title", "items.description", "items.icon", "ctas"],
  },
  /** Every service page (Services folder). */
  service: {
    introduction: TEXT_IMAGE,
    "core-innovations": ["title", "items.title", "items.description", "items.icon"],
    collaboration: ["title", "body", "ctas", "image"],
  },
};
