txStatusLabel function

String txStatusLabel(
  1. WalletLocalizations l10n,
  2. TxStatus s
)

Status word for a history row / the detail sheet — ONE mapping for both surfaces (the list row imports this; they must never disagree).

Implementation

String txStatusLabel(WalletLocalizations l10n, TxStatus s) => switch (s) {
  TxStatus_Queued() => l10n.walletActivityQueued,
  TxStatus_Pending() => l10n.walletActivityPending,
  TxStatus_Confirmed(:final depth) => l10n.walletActivityConfirmations(depth),
  TxStatus_Expired() => l10n.walletActivityExpired,
  TxStatus_Failed() => l10n.walletActivityFailed,
  // Forward-compat arm (a future Rust status the bridge maps to Unknown):
  // render as Pending rather than crash — honest "in progress". Matched
  // EXPLICITLY (no `_`) so a regen that adds a named arm fails the build
  // loud instead of silently reading as Pending.
  TxStatus_Unknown() => l10n.walletActivityPending,
};