fix: address reviewer feedback (#29)

- Remove dead code: navigateBudgetMonth function and its export from
  useReports.ts (replaced by setBudgetMonth, no longer imported anywhere)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
medic-bot 2026-03-09 21:03:42 -04:00
parent 0d324b89c4
commit 8971e443d8

View file

@ -224,19 +224,6 @@ export function useReports() {
dispatch({ type: "SET_PERIOD", payload: period }); dispatch({ type: "SET_PERIOD", payload: period });
}, []); }, []);
const navigateBudgetMonth = useCallback((delta: -1 | 1) => {
let newMonth = state.budgetMonth + delta;
let newYear = state.budgetYear;
if (newMonth < 1) {
newMonth = 12;
newYear -= 1;
} else if (newMonth > 12) {
newMonth = 1;
newYear += 1;
}
dispatch({ type: "SET_BUDGET_MONTH", payload: { year: newYear, month: newMonth } });
}, [state.budgetYear, state.budgetMonth]);
const setBudgetMonth = useCallback((year: number, month: number) => { const setBudgetMonth = useCallback((year: number, month: number) => {
dispatch({ type: "SET_BUDGET_MONTH", payload: { year, month } }); dispatch({ type: "SET_BUDGET_MONTH", payload: { year, month } });
}, []); }, []);
@ -253,5 +240,5 @@ export function useReports() {
dispatch({ type: "SET_SOURCE_ID", payload: id }); dispatch({ type: "SET_SOURCE_ID", payload: id });
}, []); }, []);
return { state, setTab, setPeriod, setCustomDates, navigateBudgetMonth, setBudgetMonth, setPivotConfig, setSourceId }; return { state, setTab, setPeriod, setCustomDates, setBudgetMonth, setPivotConfig, setSourceId };
} }