/*
 * Copyright (c) 2022, J2 Innovations. All Rights Reserved
 */
import { useEval } from 'haystack-react';
import React, { useContext } from 'react';
const UserContext = React.createContext(undefined);
UserContext.displayName = 'CurrentUser';
/**
 * User context retrieval hook.
 */
export function useCurrentUser() {
    return useContext(UserContext);
}
/**
 * User context provider for FIN 5.
 */
export const UserContextProvider = ({ children, }) => {
    const { grid, isLoading } = useEval('finGetCurrentUser()');
    return (<UserContext.Provider value={isLoading ? undefined : grid[0]}>
			{children}
		</UserContext.Provider>);
};
//# sourceMappingURL=useCurrentUser.jsx.map