import { createTypedReducerWithImmer } from "@insite/client-framework/Common/CreateTypedReducer";
import SignInOverlayState from "@insite/client-framework/Store/Components/SignInOverlay/SignInOverlayState";
import { Draft } from "immer";

const initialState: SignInOverlayState = {
    isOpen: false,
};

const reducer = {
    "Components/SignInOverlay/SetSignInOverlayIsOpen": (
        draft: Draft<SignInOverlayState>,
        action: { isOpen: boolean },
    ) => {
        draft.isOpen = action.isOpen;
    },
};

export default createTypedReducerWithImmer(initialState, reducer);
