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

const initialState = { isOpen: false }

const adminMenuSlice = createSlice({
  name: 'adminMenu',
  initialState,
  reducers: {
    setOpenAdminMenu: (state, action) => {
      state.isOpen = true
    },
    setCloseAdminMenu: (state, action) => {
      return initialState
    },
    setIsOpenAdminMenu: (state, action) => {
      state.isOpen = !state.isOpen
    },
  },
})

export const { setOpenAdminMenu, setCloseAdminMenu, setIsOpenAdminMenu } = adminMenuSlice.actions

export default adminMenuSlice.reducer
