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

const initialState = {};

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

  reducers: {
    logOutEventAction: (state, action: PayloadAction<{ logOutPage?: boolean; logoutFrom?: string } | undefined>) => {
      if (action.payload) {
        return state;
      }
      return state;
    },
    loggedInEventAction: (state) => state,
    cancelImpersonationAction: (state) => state,
  },
});

export const { cancelImpersonationAction, loggedInEventAction, logOutEventAction } = slice.actions;

export default slice.reducer;
