certificateStatusLabel function

String certificateStatusLabel(
  1. AppLocalizations l10n,
  2. String status
)

All-caps status label for a user_certificates.status value.

Deliberately distinct from complianceStatusLabel: that one names where a member stands against a requirement, this one names the lifecycle of an issued certificate. The two sets coincide on "EXPIRED" in English but are not interchangeable.

Implementation

String certificateStatusLabel(AppLocalizations l10n, String status) =>
    switch (status) {
      'active' => l10n.orgCertStatusActive,
      'expired' => l10n.orgCertStatusExpired,
      'revoked' => l10n.orgCertStatusRevoked,
      _ => status.toUpperCase(),
    };