import React, {createContext, useContext, useState, ReactNode} from 'react'; interface AuthContextProps { isLoggedIn: boolean; login: () => void; logout: () => void; } const AuthContext = createContext(undefined); export const AuthProvider = ({children}: {children: ReactNode}) => { const [isLoggedIn, setIsLoggedIn] = useState(true); const login = () => setIsLoggedIn(true); const logout = () => setIsLoggedIn(false); return ( {children} ); }; export const useAuthContext = () => { const context = useContext(AuthContext); if (!context) { throw new Error('useAuthContext must be used within an AuthProvider'); } return context; };