import { createHandlerChainRunner, Handler } from "@insite/client-framework/HandlerCreator";

type HandlerType = Handler<{
    isOpen: boolean;
}>;

export const DispatchSetIsOpen: HandlerType = ({ dispatch, parameter: { isOpen } }) => {
    dispatch({
        type: "Components/SignInOverlay/SetSignInOverlayIsOpen",
        isOpen,
    });
};

export const chain = [DispatchSetIsOpen];

const setSignInOverlayIsOpen = createHandlerChainRunner(chain, "SetSignInOverlayIsOpen");
export default setSignInOverlayIsOpen;
