// third-party
import { combineReducers } from 'redux';
import persistReducer from 'redux-persist/es/persistReducer';
import storage from 'redux-persist/lib/storage';
// project import
import menu from './menu';
import snackbar from './snackbar';
import fcm from '../../store/reducers/fcmSlice';
import userinfo from '../../store/reducers/userinfo';

const userinfoPersistConfig = {
  key: 'userinfo',
  storage,
  whitelist: ['userdata'] // only persist `userdata`, not everything (optional)
};
// ==============================|| COMBINE REDUCERS ||============================== //

const reducers = combineReducers({
  menu,
  snackbar,
  fcm,
  userinfo: persistReducer(userinfoPersistConfig, userinfo)
});

export default reducers;
