import { createSlice } from '@reduxjs/toolkit';
const initialState = {
  showPostTypeChoiceModal: false,
  userId: null,
  targetId: null,
  targetType: '',
  targetName: '',
  postSetting: null,
  needApprovalOnPostCreation: true,
  isPublic: false
};
const uiSlice = createSlice({
  name: 'ui',
  initialState,
  reducers: {
    openPostTypeChoiceModal: (state, action) => {
      state.showPostTypeChoiceModal = true;
      state.userId = action.payload.userId;
      state.targetId = action.payload.targetId || null;
      state.targetName = action.payload.targetName || '';
      state.targetType = action.payload.targetType || '';
      state.postSetting = action.payload.postSetting || null;
      state.isPublic = action.payload.isPublic;
      state.needApprovalOnPostCreation = action.payload.needApprovalOnPostCreation;
    },
    closePostTypeChoiceModal: state => {
      state.showPostTypeChoiceModal = false;
      state.userId = null;
      state.targetId = null;
      state.targetType = '';
      state.targetName = '';
      state.postSetting = null;
      state.needApprovalOnPostCreation = true;
      state.isPublic = false;
    },
    showToastMessage: (state, action) => {
      state.showToastMessage = true;
      state.toastMessage = action.payload.toastMessage;
      state.isLoadingToast = action.payload.isLoadingToast;
      state.isSuccessToast = action.payload.isSuccessToast;
    },
    hideToastMessage: state => {
      state.showToastMessage = false;
      state.toastMessage = '';
      state.isLoadingToast = false;
      state.isSuccessToast = false;
    }
  }
});
export default uiSlice;
//# sourceMappingURL=uiSlice.js.map