const { text, textarea, image, icon, url, select, combobox, object, stringList, objectList, } = require("./sharedFields"); const statusOptions = [ { value: "Active", label: "Active" }, { value: "Inactive", label: "Inactive" }, ]; module.exports = { key: "accreditation", title: "Accreditation Management", subtitle: "Edit content displayed on the accreditation page", routeBase: "/admin/accreditation", apiPath: "/api/accreditation", previewPath: "/about/accreditation", dataFile: "accreditation", imageType: "accreditation", tabs: [ { key: "trustBanner", label: "Trust Banner", icon: "fas fa-shield-check", schema: object("trustBanner", "Trust banner", [ icon("icon", "Banner icon"), text("text", "Banner message", { maxLength: 120, helpText: "This is the slim credibility strip shown above the accreditation content.", }), objectList( "links", "Banner links", [ text("label", "Link label", { maxLength: 40 }), url("href", "Link URL", { maxLength: 255 }), icon("icon", "Link icon"), ], { itemLabel: "Link", sortable: true, emptyText: "No trust banner links yet.", }, ), ]), }, { key: "hero", label: "Hero", icon: "fas fa-image", schema: object("hero", "Hero", [ text("badge", "Eyebrow label", { maxLength: 40 }), text("title", "Headline", { maxLength: 60 }), textarea("description", "Supporting text", { maxLength: 420, rows: 5 }), ]), }, { key: "grid", label: "Accreditation Grid", icon: "fas fa-table-cells-large", schema: object("grid", "Accreditation grid", [ stringList("tabs", "Category tabs", { itemLabel: "Tab", maxLength: 30, sortable: true, helpText: "The frontend shows up to 3 direct tabs. Additional tabs move into a More dropdown.", }), objectList( "items", "Accreditation cards", [ icon("icon", "Fallback icon"), image("image", "Card image", { imageHint: "Recommended 118x58 px minimum visible ratio", helpText: "Logo or badge used at the top of the card.", }), select("status", "Status", statusOptions), combobox("category", "Category", { maxLength: 30, optionsPath: "grid.tabs", }), text("title", "Card title", { maxLength: 17, helpText: "Frontend title space is capped at 17 characters.", }), textarea("description", "Card description", { maxLength: 300, rows: 5, helpText: "Frontend description preview is capped at 300 characters.", }), text("scopeLabel", "Scope label", { maxLength: 20 }), text("scope", "Scope text", { maxLength: 60 }), text("validUntilLabel", "Validity label", { maxLength: 24 }), text("validUntil", "Validity text", { maxLength: 40 }), text("buttonLabel", "Certificate button label", { maxLength: 30 }), url("certificateHref", "Certificate URL", { maxLength: 255 }), ], { itemLabel: "Accreditation", sortable: true, itemTitleKey: "title", itemSubtitleKey: "category", emptyText: "No accreditation cards yet.", }, ), ]), }, ], };