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

const toastSlice = createSlice({
  name: 'toast',
  initialState: {
    snackbarId: null
  },
  reducers: {
    setSnackbarId: (state, action) => {
      state.snackbarId = action.payload;
    },
    clearSnackbarId: (state) => {
      state.snackbarId = null;
    }
  }
});

export const { setSnackbarId, clearSnackbarId } = toastSlice.actions;
export default toastSlice.reducer;
