import React from 'react'; import { cn } from '@/lib/utils'; import { Coffee, Home, Car } from 'lucide-react'; interface BudgetCardProps { title: string; current: number; total: number; color?: string; } // Category icons mapping const categoryIcons: Record = { 식비: , 생활비: , 교통비: , }; const BudgetCard: React.FC = ({ title, current, total, color = 'neuro-income' }) => { const percentage = Math.min(Math.round((current / total) * 100), 100); const formattedCurrent = new Intl.NumberFormat('ko-KR', { style: 'currency', currency: 'KRW', maximumFractionDigits: 0 }).format(current); const formattedTotal = new Intl.NumberFormat('ko-KR', { style: 'currency', currency: 'KRW', maximumFractionDigits: 0 }).format(total); // Determine progress bar color based on percentage const progressBarColor = percentage >= 90 ? 'bg-yellow-400' : `bg-${color}`; return (
{categoryIcons[title]}

{title}

{formattedCurrent}

/ {formattedTotal}

{percentage}%
); }; export default BudgetCard;