import { useProfile } from "@/system"; import type { Metadata } from "@/types"; import { type ReactNode, createContext, useContext } from "react"; interface UserContext { pubkey: string; profile: Metadata | undefined; isLoading: boolean; } const UserContext = createContext(null); export function UserProvider({ pubkey, children, data, }: { pubkey: string; children: ReactNode; data?: string; }) { const { isLoading, profile } = useProfile(pubkey, data); return ( {children} ); } export function useUserContext() { const context = useContext(UserContext); return context; }