import { createSlice } from '@reduxjs/toolkit';

interface GameScreenState {
  modalOpen: boolean;
}

const initialState: GameScreenState = {
  modalOpen: true,
};

const gameScreenSlice = createSlice({
  name: 'gameScreen',
  initialState,
  reducers: {
    openModal: (state) => {
      state.modalOpen = true;
    },
    closeModal: (state) => {
      state.modalOpen = false;
    },
  },
});

export const { openModal, closeModal } = gameScreenSlice.actions;
export const GameScreenReducer = gameScreenSlice.reducer;