feat: 新增账户卡片组件及核心类型定义。
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user