Add frontend components: dashboard, accounts, auth callback, and modal forms

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-01 14:07:56 +00:00
parent dfe5af1898
commit f26ab702de
28 changed files with 8522 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
import { create } from 'zustand';
import { User } from '@/lib/api';
interface AuthState {
user: User | null;
isAuthenticated: boolean;
isLoading: boolean;
setUser: (user: User | null) => void;
setLoading: (loading: boolean) => void;
logout: () => void;
}
export const useAuthStore = create<AuthState>((set) => ({
user: null,
isAuthenticated: false,
isLoading: true,
setUser: (user) => set({
user,
isAuthenticated: !!user,
isLoading: false,
}),
setLoading: (loading) => set({ isLoading: loading }),
logout: () => {
localStorage.removeItem('access_token');
localStorage.removeItem('user');
set({ user: null, isAuthenticated: false });
},
}));