import { useState, type ReactNode } from "react";
import type { NPEDUser } from "../../types/types";
import { NPEDUserContext } from "../NPEDUserContext";

type NPEDUserProviderType = {
  children: ReactNode;
};

export const NPEDUserProvider = ({ children }: NPEDUserProviderType) => {
  const [user, setUser] = useState<NPEDUser | null>(null);

  return (
    <NPEDUserContext.Provider value={{ user, setUser }}>
      {children}
    </NPEDUserContext.Provider>
  );
};
