import React, { useContext, useEffect, useState } from 'react';

const UserContext = React.createContext();

export const UserProvider = ({ children }) => {
    const [signedIn, setSignedIn] = useState(false);
    const [user, setUser] = useState(null);
    const [token, setToken] = useState(null);
    const [signInError, setSignInError] = useState(null);
    const [signUpError, setSignUpError] = useState(null);

    const signIn = (email, password) => {

    };
    
    const signUp = (email, password, confirmPassword) => {

    };

    return (
        <UserContext.Provider value={{
            signedIn,
            user,
            token,
            signInError,
            signUpError,
            signIn,
            signUp,
        }}>
            {children}
        </UserContext.Provider>
    );
};

export const useUserContext = () => useContext(UserContext);
