Update category labels

Add descriptions to category labels in the UI.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-21 10:10:25 +00:00
parent 9352b1bb27
commit 11d824a38f
2 changed files with 16 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
import React from 'react'; import React from 'react';
import { formatCurrency } from '@/utils/formatters'; import { formatCurrency } from '@/utils/formatters';
import { useIsMobile } from '@/hooks/use-mobile'; import { useIsMobile } from '@/hooks/use-mobile';
import { CATEGORY_DESCRIPTIONS } from '@/constants/categoryIcons';
interface CategorySpending { interface CategorySpending {
title: string; title: string;
@@ -42,7 +43,14 @@ const CategorySpendingList: React.FC<CategorySpendingListProps> = ({
<div className="w-6 h-6 rounded-full" style={{ <div className="w-6 h-6 rounded-full" style={{
backgroundColor: getCategoryColor(category.title) backgroundColor: getCategoryColor(category.title)
}}></div> }}></div>
<span>{category.title}</span> <span>
{category.title}
{CATEGORY_DESCRIPTIONS[category.title] && (
<span className="text-gray-500 text-sm ml-1">
{CATEGORY_DESCRIPTIONS[category.title]}
</span>
)}
</span>
</div> </div>
<div className="text-right"> <div className="text-right">
<p className="font-medium"> <p className="font-medium">

View File

@@ -13,6 +13,13 @@ export const categoryIcons: Record<string, React.ReactNode> = {
// 지출 카테고리 목록 - 3개로 제한 // 지출 카테고리 목록 - 3개로 제한
export const EXPENSE_CATEGORIES = ['음식', '쇼핑', '교통비']; export const EXPENSE_CATEGORIES = ['음식', '쇼핑', '교통비'];
// 카테고리 부가 설명 정의
export const CATEGORY_DESCRIPTIONS: Record<string, string> = {
: '(식비, 음료)',
: '',
: '(차량 유지비)',
};
// 기본 카테고리 예산 설정 // 기본 카테고리 예산 설정
export const DEFAULT_CATEGORY_BUDGETS = { export const DEFAULT_CATEGORY_BUDGETS = {
음식: 400000, 음식: 400000,