Refactor SummaryCards component
Modify SummaryCards to display icon and title in one line with the amount below, centered.
This commit is contained in:
@@ -24,43 +24,37 @@ const SummaryCards: React.FC<SummaryCardsProps> = ({
|
||||
return (
|
||||
<div className={`grid ${isMobile ? 'grid-cols-1' : 'grid-cols-3'} gap-3 mb-8 w-full desktop-card`}>
|
||||
<div className="neuro-card w-full">
|
||||
<div className="flex items-center justify-between py-[5px]">
|
||||
<div className="flex items-center gap-2">
|
||||
<Wallet size={24} className="text-gray-500" />
|
||||
<p className="text-gray-500 text-base">예산</p>
|
||||
</div>
|
||||
<p className="text-sm font-bold text-neuro-income text-right">
|
||||
{formatCurrency(totalBudget)}
|
||||
</p>
|
||||
<div className="flex items-center justify-center gap-2 py-[5px]">
|
||||
<Wallet size={24} className="text-gray-500" />
|
||||
<p className="text-gray-500 text-base">예산</p>
|
||||
</div>
|
||||
<p className="text-sm font-bold text-neuro-income text-center">
|
||||
{formatCurrency(totalBudget)}
|
||||
</p>
|
||||
</div>
|
||||
<div className="neuro-card w-full">
|
||||
<div className="flex items-center justify-between py-[5px]">
|
||||
<div className="flex items-center gap-2">
|
||||
<CreditCard size={24} className="text-gray-500" />
|
||||
<p className="text-gray-500 font-medium text-base">지출</p>
|
||||
</div>
|
||||
<p className="text-sm font-bold text-neuro-income text-right">
|
||||
{formatCurrency(totalExpense)}
|
||||
</p>
|
||||
<div className="flex items-center justify-center gap-2 py-[5px]">
|
||||
<CreditCard size={24} className="text-gray-500" />
|
||||
<p className="text-gray-500 font-medium text-base">지출</p>
|
||||
</div>
|
||||
<p className="text-sm font-bold text-neuro-income text-center">
|
||||
{formatCurrency(totalExpense)}
|
||||
</p>
|
||||
</div>
|
||||
<div className="neuro-card w-full">
|
||||
<div className="flex items-center justify-between py-[5px]">
|
||||
<div className="flex items-center gap-2">
|
||||
<Coins size={24} className="text-gray-500" />
|
||||
<p className="text-gray-500 text-base">잔액</p>
|
||||
</div>
|
||||
{isOverBudget ? (
|
||||
<p className="text-sm font-bold text-red-500 text-right">
|
||||
초과액: {formatCurrency(Math.abs(remainingBudget))}
|
||||
</p>
|
||||
) : (
|
||||
<p className="text-sm font-bold text-neuro-income text-right">
|
||||
{formatCurrency(remainingBudget)}
|
||||
</p>
|
||||
)}
|
||||
<div className="flex items-center justify-center gap-2 py-[5px]">
|
||||
<Coins size={24} className="text-gray-500" />
|
||||
<p className="text-gray-500 text-base">잔액</p>
|
||||
</div>
|
||||
{isOverBudget ? (
|
||||
<p className="text-sm font-bold text-red-500 text-center">
|
||||
초과액: {formatCurrency(Math.abs(remainingBudget))}
|
||||
</p>
|
||||
) : (
|
||||
<p className="text-sm font-bold text-neuro-income text-center">
|
||||
{formatCurrency(remainingBudget)}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user