feat: 新增账户卡片组件及核心类型定义。
This commit is contained in:
@@ -136,9 +136,15 @@ export const AccountCard: React.FC<AccountCardProps> = ({
|
||||
<span
|
||||
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>
|
||||
</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">
|
||||
<h3 className="account-card__name" title={account.name}>{account.name}</h3>
|
||||
|
||||
@@ -141,6 +141,7 @@ export interface Account {
|
||||
name: string;
|
||||
type: AccountType;
|
||||
balance: number;
|
||||
frozen_balance?: number;
|
||||
currency: CurrencyCode;
|
||||
icon: string;
|
||||
isCredit: boolean;
|
||||
|
||||
Reference in New Issue
Block a user