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

const initialState = {
  start: null,
  run: null,
  repeat: null,
  end: null,
  data: {},
};

export const slice = createSlice({
  name: '@@COMMON/MONITORING',
  initialState,

  reducers: {
    startAction: (state, action) => {
      state.start = action.payload;
    },
    runAction: (state, action) => {
      state.run = action.payload;
    },
    repeatAction: (state, action) => {
      state.repeat = action.payload;
    },
    endAction: (state, action) => {
      state.end = action.payload;
    },
    dataAction: (state, action) => {
      state.data = action.payload;
    },
  },
});

export const { dataAction, endAction, repeatAction, runAction, startAction } = slice.actions;

export default slice.reducer;
