Refactor TransactionEditDialog component

The TransactionEditDialog component was refactored into smaller, more manageable components to improve code organization and maintainability. The functionality remains the same.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-21 10:05:01 +00:00
parent 8ef3d998f5
commit c473abda72
4 changed files with 223 additions and 161 deletions

View File

@@ -0,0 +1,13 @@
import { EXPENSE_CATEGORIES } from '@/constants/categoryIcons';
/**
* 카테고리 매핑 함수 - 이전 카테고리명을 새 카테고리명으로 변환
*/
export const mapCategoryToNew = (oldCategory: string): "음식" | "쇼핑" | "교통비" => {
if (oldCategory === '식비') return '음식';
if (oldCategory === '생활비') return '쇼핑';
if (EXPENSE_CATEGORIES.includes(oldCategory as any)) return oldCategory as "음식" | "쇼핑" | "교통비";
// 기본값은 '쇼핑'으로 설정
return '쇼핑';
};