mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 03:39:29 +00:00
27 lines
480 B
JavaScript
27 lines
480 B
JavaScript
import React, { createContext } from "react";
|
|
|
|
import useAuth from "./useAuth";
|
|
|
|
const AuthContext = createContext();
|
|
|
|
const AuthProvider = ({ children }) => {
|
|
const {
|
|
loading,
|
|
user,
|
|
setUser,
|
|
isAuth,
|
|
handleLogin,
|
|
handleLogout,
|
|
} = useAuth();
|
|
|
|
return (
|
|
<AuthContext.Provider
|
|
value={{ loading, user, setUser, isAuth, handleLogin, handleLogout }}
|
|
>
|
|
{children}
|
|
</AuthContext.Provider>
|
|
);
|
|
};
|
|
|
|
export { AuthContext, AuthProvider };
|