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

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

const reducer = {
    "Components/StorePickupOverlay/SetStorePickupOverlayIsOpen": (
        draft: Draft<StorePickupOverlayState>,
        action: { isOpen: boolean },
    ) => {
        draft.isOpen = action.isOpen;
    },
};

export default createTypedReducerWithImmer(initialState, reducer);
