// /redux/slices/analogInputs/analogInputsUiSlice.ts
import { createSlice, PayloadAction } from "@reduxjs/toolkit";

interface AnalogInputsUiState {
  isSettingsModalOpen: boolean;
  isChartModalOpen: boolean;
}

const initialState: AnalogInputsUiState = {
  isSettingsModalOpen: false,
  isChartModalOpen: false,
};

const analogInputsUiSlice = createSlice({
  name: "analogInputsUi",
  initialState,
  reducers: {
    setIsSettingsModalOpen: (state, action: PayloadAction<boolean>) => {
      state.isSettingsModalOpen = action.payload;
    },
    setIsChartModalOpen: (state, action: PayloadAction<boolean>) => {
      state.isChartModalOpen = action.payload;
    },
  },
});

export const { setIsSettingsModalOpen, setIsChartModalOpen } =
  analogInputsUiSlice.actions;
export default analogInputsUiSlice.reducer;
