// src/context/UserContext.tsx
import { createContext, useContext } from "react";
import { useAuthUser } from "../hooks/useAuthUser";

const UserContext = createContext<any>(null);

export const UserProvider = ({ children }: { children: React.ReactNode }) => {
  const { userDetails, isLoading } = useAuthUser();
  //   if (isLoading) return <div>Loading...</div>;
  return (
    <UserContext.Provider value={userDetails}>{children}</UserContext.Provider>
  );
};

export const useUser = () => useContext(UserContext);
