/* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import React from "react"; import { IMsalContext } from "../MsalContext.js"; import { useMsal } from "../hooks/useMsal.js"; import { Subtract } from "../utils/utilities.js"; export type WithMsalProps = { msalContext: IMsalContext; }; /** * Higher order component wraps provided component with msal by injecting msal context values into the component's props * @param Component */ export const withMsal =
( Component: React.ComponentType
): React.FunctionComponent
> = (props) => {
const msal = useMsal();
return