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:
13
src/components/transaction/categoryUtils.ts
Normal file
13
src/components/transaction/categoryUtils.ts
Normal 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 '쇼핑';
|
||||
};
|
||||
Reference in New Issue
Block a user