import { createContext, useContext, type SetStateAction } from "react"; import type { NPEDUser } from "../types/types"; type UserContextValue = { user: NPEDUser | null; setUser: React.Dispatch>; }; export const NPEDUserContext = createContext( undefined ); export const useNPEDContext = () => { const ctx = useContext(NPEDUserContext); if (!ctx) throw new Error("useNPEDContext must be used within "); return ctx; };