// Humanises the machine-readable ineligibility reason returned alongside a // member voucher (api/voucher, api/voucher/[uuid], api/voucher/[uuid]/status). // Shared by the /store voucher section and the /vouchers/[uuid] detail page — // keep this the single source of truth rather than duplicating the map. export const REASON_TEXT: Record = { NOT_ACTIVE: "Not available", NOT_STARTED: "Not started yet", EXPIRED: "Expired", ALREADY_REDEEMED: "Already redeemed", PROFILE_INCOMPLETE: "Complete your profile to redeem", FULLY_REDEEMED: "Fully redeemed", }; export function humaniseReason(reason?: string | null): string { if (!reason) return "Unavailable"; return REASON_TEXT[reason] ?? "Unavailable"; }