// /redux/slices/poiLayerVisibleSlice.js
import { createSlice } from "@reduxjs/toolkit";

const initialState = {
  visible: true,
};

export const poiLayerVisibleSlice = createSlice({
  name: "poiLayerVisible",
  initialState,
  reducers: {
    setVisible: (state, action) => {
      state.visible = action.payload;
    },
    toggleVisible: (state) => {
      state.visible = !state.visible;
    },
  },
});

export const { setVisible, toggleVisible } = poiLayerVisibleSlice.actions;
export default poiLayerVisibleSlice.reducer;
