feat: frontend

This commit is contained in:
2025-11-17 21:07:51 -07:00
parent dd0ab39985
commit e1396e2d24
87 changed files with 13616 additions and 148 deletions

View File

@@ -0,0 +1,27 @@
import { create } from 'zustand'
import { UserResponse } from '../client/response'
import { GetCurrentUser, SetUserName } from '../client/controllers'
export type UserActions = {
sync: () => Promise<UserResponse | undefined>
updateName: (name: string) => Promise<void>
}
export const useCurrentAuthenticatedUserStore = create<UserResponse & UserActions>((set) => ({
Id: -1,
Name: '',
JobPosition: '',
Active: false,
Admin: false,
sync: async () => {
const authUser = await GetCurrentUser()
set((state) => ({
...authUser,
...state
}))
return authUser
},
updateName: async (name: string) => {
await SetUserName(name)
}
}))