import { User } from '@lib/account.types.ts';
import { createContext, useContext } from 'react';

interface UserContextType {
  user?: User;
  setUser: (user: User | undefined) => void;
  loading: boolean;
}

export const UserContext = createContext<UserContextType>({
  user: undefined,
  setUser: () => {},
  loading: true
});

export function useUserContext(): UserContextType {
  return useContext(UserContext);
}
