import React, {createContext, useState} from "react";

import {maybeGetUser} from "helpers/Auth.jsx";

const UserContext = createContext(null);
function UserContextProvider({children}) {
    const state = useState(maybeGetUser());

    return (
        <UserContext.Provider value={state}>
            {children}
        </UserContext.Provider>
    );
}

export {UserContext, UserContextProvider};