diff --git a/apps/portal/src/app/features/licensing/components/LicenseCard.tsx b/apps/portal/src/app/features/licensing/components/LicenseCard.tsx index c8942a140..8fe493e76 100644 --- a/apps/portal/src/app/features/licensing/components/LicenseCard.tsx +++ b/apps/portal/src/app/features/licensing/components/LicenseCard.tsx @@ -81,6 +81,11 @@ export function LicenseCard({ // only for a cached response from before those fields existed. const days = license.daysUntilExpiry ?? daysUntil(license.expiryDate); const expired = license.status === 'EXPIRED' || days < 0; + // Suspended, cancelled and superseded are none of them "valid until" their + // expiry date — the card used to say exactly that, because only EXPIRED was + // treated as not-current. A suspended licence read as a live one with a grey + // badge. + const current = license.status === 'ACTIVE' && !expired; const renewable = license.renewable ?? false; const showDate = useDateDisplayer(); const localized = useLocalized(); @@ -100,9 +105,15 @@ export function LicenseCard({ - {expired ? t('licensing.card.expired') : license.status} + {/* The raw enum was rendered here, so an Amharic page showed + "SUSPENDED" among otherwise translated text. */} + {expired + ? t('licensing.card.expired') + : t(`licensing.card.status.${license.status}`, { + defaultValue: license.status, + })} @@ -113,8 +124,19 @@ export function LicenseCard({ {expired ? t('licensing.card.expiredOn', { date: showDate(license.expiryDate) }) - : t('licensing.card.validUntil', { date: showDate(license.expiryDate) })} + : current + ? t('licensing.card.validUntil', { date: showDate(license.expiryDate) }) + : t(`licensing.card.status.${license.status}`, { + defaultValue: license.status, + })} + {/* Why it stopped being current. The API returns it; the card threw + it away, leaving the holder to guess. */} + {!current && license.statusReason && ( + + {t('licensing.card.statusReason', { reason: license.statusReason })} + + )}