/**
 * Bank-rail `failureReason` codes the UI has a mapped Persian/English label for (i18n keys
 * `payouts.failure_code_{code}`). A `failed` payout must never show the raw vendor string as its
 * headline — known codes get the mapped label; anything else falls back to a generic message with the
 * raw code demoted to a secondary `dir="ltr"` caption (never hidden — it's still useful for support).
 */
const KNOWN_FAILURE_REASON_CODES = new Set(['invalid_sheba']);

/** The `payouts` namespace i18n key for a payout's `failureReason` — unknown/`null` codes fall back. */
export function failureReasonLabelKey(code: string | null): string {
  if (code && KNOWN_FAILURE_REASON_CODES.has(code)) return `failure_code_${code}`;
  return 'failure_code_unknown';
}
