diff --git a/src/contexts/UserAuthenticationContext.tsx b/src/contexts/UserAuthenticationContext.tsx new file mode 100644 index 0000000..6b13e03 --- /dev/null +++ b/src/contexts/UserAuthenticationContext.tsx @@ -0,0 +1,25 @@ +import { createContext, useContext, useState } from "react"; + +export interface UserAuthenticationContextProps { + isAuthenticated: boolean; + setIsAuthenticated: React.Dispatch>; +} + +export const UserAuthenticationContext = createContext({ + isAuthenticated: false, + setIsAuthenticated: () => {}, +}); + +export const UserAuthenticationContextProvider = ({ children }: { children: React.ReactNode }) => { + const [isAuthenticated, setIsAuthenticated] = useState(false); + + return ( + + {children} + + ); +}; + +export const useUserAuthenticationContext = () => { + return useContext(UserAuthenticationContext); +};