17 lines
441 B
TypeScript
17 lines
441 B
TypeScript
import { createContext, useContext } from 'react';
|
|
|
|
import type { AuthUser } from '../../services/authService';
|
|
|
|
type AuthUiContextValue = {
|
|
user: AuthUser | null;
|
|
openAccountModal: () => void;
|
|
logout: () => Promise<void>;
|
|
setGlobalAccountActionsVisible: (visible: boolean) => void;
|
|
};
|
|
|
|
export const AuthUiContext = createContext<AuthUiContextValue | null>(null);
|
|
|
|
export function useAuthUi() {
|
|
return useContext(AuthUiContext);
|
|
}
|