// Status of a wallet top-up / withdrawal request (WalletEnum.WalletTopupStatus and // WalletWithdrawalStatus in solvway-core-libs share the same codes). type Tone = "positive" | "warning" | "negative" | "neutral"; const STATUS: Record = { P: { label: "Pending", tone: "warning" }, S: { label: "Submitted", tone: "warning" }, V: { label: "Verified", tone: "warning" }, F: { label: "Failed verification", tone: "negative" }, Y: { label: "Approved", tone: "positive" }, N: { label: "Rejected", tone: "negative" }, O: { label: "Processing", tone: "warning" }, C: { label: "Completed", tone: "positive" }, R: { label: "Reversed", tone: "negative" }, }; /** Unknown or missing code -> the code itself (or "—"), neutral. */ export function walletRequestStatus(code: string | undefined): { label: string; tone: Tone } { return (code && STATUS[code]) || { label: code || "—", tone: "neutral" }; }