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

export const initialState = {
  id: '',
  avatar: '',
  fullName: '',
  mobileNo: '',
  createdDate: '',
  updatedDate: '',
  userName: '',
  email: '',
  authority: ["GUEST"],
  countryCode: '',
};

export const userSlice = createSlice({
  name: 'auth/user',
  initialState,
  reducers: {
    setUser: (_, action) => action.payload,
    userLoggedOut: () => initialState,
  },
});

export const { setUser } = userSlice.actions;

export default userSlice.reducer;
