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

const initialState = {
  area: null,
};

const selectedAreaSlice = createSlice({
  name: "selectedArea",
  initialState,
  reducers: {
    setSelectedArea: (state, action) => {
      state.area = action.payload;
    },
    clearSelectedArea: (state) => {
      state.area = null;
    },
  },
});

export const { setSelectedArea, clearSelectedArea } = selectedAreaSlice.actions;
export default selectedAreaSlice.reducer;
