let validImageURLs = [];
let invalidImageURLs = [];
import * as avatarConstants from "./Avatar.actionConstants";
let avatarStateReducers = (state, action) => {
  let stateJson = { showAvatar: null };
  let actionType = action.type;
  switch (actionType) {
    case avatarConstants.SHOW_AVATAR_ENABLE:
      stateJson.showAvatar = true;
      return stateJson;
    case avatarConstants.SHOW_AVATAR_DISABLE:
      stateJson.showAvatar = false;
      return stateJson;
    case avatarConstants.VALID_PHOTOURL_PUSH:
      validImageURLs.push(state.photourl);
      stateJson.showAvatar = true;
      return stateJson;
    case avatarConstants.INVALID_PHOTOURL_PUSH:
      invalidImageURLs.push(state.photourl);
      stateJson.showAvatar = false;
      return stateJson;
    case avatarConstants.VALID_PHOTOURL_IS_CONATAINS:
      validImageURLs.includes(state.photourl);
      return validImageURLs;
    case avatarConstants.INVALID_PHOTOURL_IS_CONATAINS:
      invalidImageURLs.includes(state.photourl);
      return invalidImageURLs;
    case avatarConstants.VALID_PHOTOURL_CLEAR:
      validImageURLs = [];
      return validImageURLs;
    case avatarConstants.INVALID_PHOTOURL_CLEAR:
      invalidImageURLs = [];
      return invalidImageURLs;
    default:
      return state;
  }
};
export default avatarStateReducers;
