diff --git a/src/components/BudgetCategoriesSection.tsx b/src/components/BudgetCategoriesSection.tsx index c6147e0..bf9e872 100644 --- a/src/components/BudgetCategoriesSection.tsx +++ b/src/components/BudgetCategoriesSection.tsx @@ -1,5 +1,8 @@ + import React from 'react'; -import BudgetCard from '@/components/BudgetCard'; +import { categoryIcons } from '@/constants/categoryIcons'; +import { formatCurrency } from '@/utils/formatters'; + interface BudgetCategoriesSectionProps { categories: { title: string; @@ -7,14 +10,43 @@ interface BudgetCategoriesSectionProps { total: number; }[]; } + const BudgetCategoriesSection: React.FC = ({ categories }) => { return <> -

지출 그래프

-
- {categories.map((category, index) => )} -
- ; +

지출 그래프

+
+ {categories.map((category, index) => ( +
+
+
+ {categoryIcons[category.title]} +
+

{category.title}

+
+ +
+

{formatCurrency(category.current)}

+

/ {formatCurrency(category.total)}

+
+ +
+
+
+ +
+ + {Math.min(Math.round((category.current / category.total) * 100), 100)}% + +
+
+ ))} +
+ ; }; -export default BudgetCategoriesSection; \ No newline at end of file + +export default BudgetCategoriesSection;