mirror of
https://github.com/escalante29/WealthySmart.git
synced 2026-07-17 15:28:47 +02:00
Proyecciones: clicking a month row opens that month in Budget
The clicked year/month now travel in the navigation state; Budget seeds useBudget with them instead of always defaulting to today. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -16,11 +16,11 @@ import {
|
||||
|
||||
/** All budget data hangs off the ['budget', ...] key family; every mutation
|
||||
* invalidates the family so projection, month detail and items stay in sync. */
|
||||
export function useBudget(initialYear: number) {
|
||||
export function useBudget(initialYear: number, initialMonth?: number) {
|
||||
const queryClient = useQueryClient();
|
||||
const [year, setYear] = useState(initialYear);
|
||||
const [selectedMonth, setSelectedMonth] = useState<number>(
|
||||
new Date().getMonth() + 1,
|
||||
initialMonth ?? new Date().getMonth() + 1,
|
||||
);
|
||||
|
||||
const projectionQ = useQuery({
|
||||
|
||||
Reference in New Issue
Block a user