diff --git a/src/hooks/useTransactions.ts b/src/hooks/useTransactions.ts index 2e0e43d..417c964 100644 --- a/src/hooks/useTransactions.ts +++ b/src/hooks/useTransactions.ts @@ -7,7 +7,6 @@ import { isSyncEnabled } from '@/utils/syncUtils'; import { MONTHS_KR, getCurrentMonth, getPrevMonth, getNextMonth } from '@/utils/dateUtils'; import { loadTransactionsFromStorage, - createSampleTransactions, saveTransactionsToStorage, loadBudgetFromStorage } from '@/utils/storageUtils'; @@ -25,6 +24,33 @@ import { // 월 이름 재노출 export { MONTHS_KR }; +// 샘플 트랜잭션 데이터 생성 함수 (임시) +const createSampleTransactions = (month: string): Transaction[] => { + const today = new Date(); + const year = today.getFullYear(); + const monthIndex = MONTHS_KR.indexOf(month); + + // 기본 샘플 트랜잭션 + return [ + { + id: 'sample-1', + title: '식료품 구매', + amount: 35000, + category: '식비', + date: `${monthIndex + 1}월 10일, ${year}`, + notes: '주간 장보기' + }, + { + id: 'sample-2', + title: '교통카드 충전', + amount: 20000, + category: '교통비', + date: `${monthIndex + 1}월 5일, ${year}`, + notes: '월간 교통비' + } + ]; +}; + export const useTransactions = () => { const [transactions, setTransactions] = useState([]); const [filteredTransactions, setFilteredTransactions] = useState([]);