fix grid balance card component
This commit is contained in:
@ -29,6 +29,10 @@ const BalanceCard = ({ id }: BalanceCardProps) => {
|
|||||||
}).format(value);
|
}).format(value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const formatNumberWithDots = (value: number) => {
|
||||||
|
return value.toLocaleString('id-ID');
|
||||||
|
};
|
||||||
|
|
||||||
const getColorClass = (amount: number) => {
|
const getColorClass = (amount: number) => {
|
||||||
if (amount > 0) return 'bg-amber-300';
|
if (amount > 0) return 'bg-amber-300';
|
||||||
if (amount > 500) return 'bg-blue-500';
|
if (amount > 500) return 'bg-blue-500';
|
||||||
@ -79,9 +83,11 @@ const BalanceCard = ({ id }: BalanceCardProps) => {
|
|||||||
|
|
||||||
<div className="mt-3 pt-3 border-t border-gray-200 flex items-center justify-between">
|
<div className="mt-3 pt-3 border-t border-gray-200 flex items-center justify-between">
|
||||||
<div className="text-xs text-gray-500">Credit Limit:</div>
|
<div className="text-xs text-gray-500">Credit Limit:</div>
|
||||||
<div className="text-sm">{wallet.credit_limit}</div>
|
<div className="text-sm">{formatNumberWithDots(wallet.credit_limit)}</div>
|
||||||
|
</div>
|
||||||
|
<div className="mt-3 flex items-center justify-between">
|
||||||
<div className="text-xs text-gray-500">Monthly Limit:</div>
|
<div className="text-xs text-gray-500">Monthly Limit:</div>
|
||||||
<div className="text-sm">{wallet.monthly_limit}</div>
|
<div className="text-sm">{formatNumberWithDots(wallet.monthly_limit)}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user