diff --git a/src/pages/Balance.tsx b/src/pages/Balance.tsx index b35594f..3d48dab 100644 --- a/src/pages/Balance.tsx +++ b/src/pages/Balance.tsx @@ -212,7 +212,13 @@ export default function Balance() { ) : transactions?.items && transactions.items.length > 0 ? (
- {transactions.items.map((tx) => ( + {transactions.items.map((tx) => { + // Determine if this is a debit (negative) or credit (positive) transaction + const isDebit = normalizeType(tx.type) === 'SUBSCRIPTION_PAYMENT' || normalizeType(tx.type) === 'WITHDRAWAL' + const sign = isDebit ? '-' : '+' + const colorClass = isDebit ? 'text-error-400' : 'text-success-400' + + return (
{tx.description}
)}
-
0 ? 'text-success-400' : 'text-error-400'}`}> - {tx.amount_kopeks > 0 ? '+' : ''}{formatAmount(tx.amount_rubles)} {currencySymbol} +
+ {sign}{formatAmount(tx.amount_rubles)} {currencySymbol}
- ))} + ) + })} ) : (