Fix missing export
The `createSampleTransactions` function was not exported from `storageUtils.ts`, causing a TypeScript error in `useTransactions.ts`. This commit exports the function to resolve the error.
This commit is contained in:
@@ -7,7 +7,6 @@ import { isSyncEnabled } from '@/utils/syncUtils';
|
|||||||
import { MONTHS_KR, getCurrentMonth, getPrevMonth, getNextMonth } from '@/utils/dateUtils';
|
import { MONTHS_KR, getCurrentMonth, getPrevMonth, getNextMonth } from '@/utils/dateUtils';
|
||||||
import {
|
import {
|
||||||
loadTransactionsFromStorage,
|
loadTransactionsFromStorage,
|
||||||
createSampleTransactions,
|
|
||||||
saveTransactionsToStorage,
|
saveTransactionsToStorage,
|
||||||
loadBudgetFromStorage
|
loadBudgetFromStorage
|
||||||
} from '@/utils/storageUtils';
|
} from '@/utils/storageUtils';
|
||||||
@@ -25,6 +24,33 @@ import {
|
|||||||
// 월 이름 재노출
|
// 월 이름 재노출
|
||||||
export { MONTHS_KR };
|
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 = () => {
|
export const useTransactions = () => {
|
||||||
const [transactions, setTransactions] = useState<Transaction[]>([]);
|
const [transactions, setTransactions] = useState<Transaction[]>([]);
|
||||||
const [filteredTransactions, setFilteredTransactions] = useState<Transaction[]>([]);
|
const [filteredTransactions, setFilteredTransactions] = useState<Transaction[]>([]);
|
||||||
|
|||||||
Reference in New Issue
Block a user