Fix budget input and display

- Fix issue where budget input for transportation and other categories were not saved correctly.
- Fix issue where total budget amount was calculated incorrectly.
- Fix issue where daily and weekly budgets were not displayed correctly.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-22 07:35:55 +00:00
parent 22aae75d13
commit b79c6b2314
6 changed files with 66 additions and 65 deletions

View File

@@ -1,45 +1,31 @@
import React from 'react';
import { Coffee, Home, Car, Package, Banknote } from 'lucide-react';
import { ShoppingBag, Coffee, Bus, Landmark, MoreHorizontal } from 'lucide-react';
// 카테고리와 아이콘 매핑 정의
// 지출 카테고리 정의
export const EXPENSE_CATEGORIES = [
'음식',
'쇼핑',
'교통비',
'교통',
'기타'
];
// 카테고리별 아이콘 매핑
export const categoryIcons: Record<string, React.ReactNode> = {
: <Coffee size={18} />,
: <Home size={18} />,
: <Car size={18} />,
: <Package size={18} />,
: <Banknote size={18} />,
'음식': <Coffee className="h-4 w-4" />,
'쇼핑': <ShoppingBag className="h-4 w-4" />,
'교통비': <Bus className="h-4 w-4" />,
'교통': <Bus className="h-4 w-4" />,
'기타': <MoreHorizontal className="h-4 w-4" />,
'수입': <Landmark className="h-4 w-4" />
};
// 지출 카테고리 목록 - 4개로 확장
export const EXPENSE_CATEGORIES = ['음식', '쇼핑', '교통', '기타'];
// 카테고리 부가 설명 정의
export const CATEGORY_DESCRIPTIONS: Record<string, string> = {
: '(식비, 음료)',
: '',
: '(차량 유지비)',
: '(기타 지출)',
: '(식비, 음료)', // 이전 이름과의 호환성 유지
: '', // 이전 이름과의 호환성 유지
: '(차량 유지비)', // 이전 이름과의 호환성 유지
};
// 기본 카테고리 예산 설정
export const DEFAULT_CATEGORY_BUDGETS = {
음식: 400000,
쇼핑: 600000,
교통: 200000,
기타: 100000
};
// 기본 월간 예산
export const DEFAULT_MONTHLY_BUDGET = 1300000;
// 카테고리별 대표 제목 목록 정의 - 자주 사용하는 순서로 재정렬
export const CATEGORY_TITLE_SUGGESTIONS: Record<string, string[]> = {
: ['점심', '저녁', '간식', '아침', '음료', '외식'],
: ['생활용품', '의류', '화장품', '가전제품', '운동용품'],
: ['택시', '주유', '지하철', '버스', '주차', '교통카드'],
: ['통신비', '구독', '관리비', '의료비', '전기요금', '취미']
// 기본 카테고리 설정 (신규 사용자용)
export const DEFAULT_CATEGORIES = {
'음식': 0,
'쇼핑': 0,
'교통비': 0,
'교통': 0,
'기타': 0
};