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

interface IntegrationsState {
  selectedService: string | null;
}

const initialState: IntegrationsState = {
  selectedService: null,
};

const integrationsSlice = createSlice({
  name: 'integrations',
  initialState,
  reducers: {
    setSelectedService: (state, action: PayloadAction<string>) => {
      state.selectedService = action.payload;
    },
    clearSelectedService: state => {
      state.selectedService = null;
    },
  },
});

export const { setSelectedService, clearSelectedService } = integrationsSlice.actions;
export default integrationsSlice;


