chore: initial commit of HouseholdBudgetBook (backend, frontend, desktop)

This commit is contained in:
mapleferry committed 2026-11-29 21:29:06 +08:00
commit 4a5db3f1f9
167 files changed
+21732

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
import { createContext, type Dispatch } from 'react'
export interface AppState {
selectedYear: string
selectedMonth: string
}
export type AppAction =
| { type: 'SET_YEAR'; year: string }
| { type: 'SET_MONTH'; month: string }
export const initialState: AppState = (() => {
const now = new Date()
return {
selectedYear: now.getFullYear().toString(),
selectedMonth: (now.getMonth() + 1).toString().padStart(2, '0'),
}
})()
export const AppCtx = createContext<{
state: AppState
dispatch: Dispatch<AppAction>
}>({ state: initialState, dispatch: () => {} })