
import { useCallback } from 'react';
import { Transaction } from '../types';
import { calculateCategorySpending } from '../budgetUtils';

// 카테고리별 지출 계산 훅
export const useCategorySpending = (
  transactions: Transaction[], 
  categoryBudgets: Record<string, number>
) => {
  // 카테고리별 지출 계산
  const getCategorySpending = useCallback(() => {
    return calculateCategorySpending(transactions, categoryBudgets);
  }, [transactions, categoryBudgets]);

  return { getCategorySpending };
};
