feat: 新增账户卡片组件及核心类型定义。

This commit is contained in:
2026-02-01 18:58:19 +08:00
parent 6cceac65fe
commit e3b40259f4
2 changed files with 8 additions and 1 deletions

View File

@@ -136,9 +136,15 @@ export const AccountCard: React.FC<AccountCardProps> = ({
<span <span
className={`account-card__balance ${isNegative ? 'account-card__balance--negative' : ''}`} className={`account-card__balance ${isNegative ? 'account-card__balance--negative' : ''}`}
> >
{formatCurrency(account.balance, account.currency).replace(/[^0-9.,-]/g, '')} {formatCurrency((account.balance + (account.frozen_balance || 0)), account.currency).replace(/[^0-9.,-]/g, '')}
</span> </span>
</div> </div>
{(account.frozen_balance || 0) > 0 && (
<div className="text-xs text-slate-500 mt-1 flex gap-2">
<span>: {formatCurrency(account.balance, account.currency)}</span>
<span>: {formatCurrency(account.frozen_balance || 0, account.currency)}</span>
</div>
)}
<div className="account-card__info"> <div className="account-card__info">
<h3 className="account-card__name" title={account.name}>{account.name}</h3> <h3 className="account-card__name" title={account.name}>{account.name}</h3>

View File

@@ -141,6 +141,7 @@ export interface Account {
name: string; name: string;
type: AccountType; type: AccountType;
balance: number; balance: number;
frozen_balance?: number;
currency: CurrencyCode; currency: CurrencyCode;
icon: string; icon: string;
isCredit: boolean; isCredit: boolean;