import { createContext, useContext, useState } from "react"; import type { IauthenticationData } from "./Types"; export interface UserAuthenticationContextProps { isAuthenticated: boolean; setIsAuthenticated: React.Dispatch>; setAuthenticationData: React.Dispatch>; } export const UserAuthenticationContext = createContext({ isAuthenticated: false, setIsAuthenticated: () => {}, setAuthenticationData: () => {}, }); export const UserAuthenticationContextProvider = ({ children }: { children: React.ReactNode }) => { const [isAuthenticated, setIsAuthenticated] = useState(false); const [authenticationData, setAuthenticationData] = useState({ access: "", refresh: "", }); return ( {children} ); }; export const useUserAuthenticationContext = () => { return useContext(UserAuthenticationContext); };