refactor: reorganize imports and improve error handling across components
This commit is contained in:
16
frontend/src/context/AuthContextValue.ts
Normal file
16
frontend/src/context/AuthContextValue.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { createContext } from 'react';
|
||||
|
||||
export interface User {
|
||||
user_id: number;
|
||||
role: string;
|
||||
}
|
||||
|
||||
export interface AuthContextType {
|
||||
user: User | null;
|
||||
login: () => Promise<void>;
|
||||
logout: () => void;
|
||||
isAuthenticated: boolean;
|
||||
isLoading: boolean;
|
||||
}
|
||||
|
||||
export const AuthContext = createContext<AuthContextType | undefined>(undefined);
|
||||
Reference in New Issue
Block a user