/*!
 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

import {actionTypes, typeEnum} from './GlobalModalConstants.js';

export default (state = null, action) => {
	switch (action.type) {
		case actionTypes.GLOBAL_MODAL_SHOW:			
			return {
				...action.data
			};
		case actionTypes.GLOBAL_MODAL_ERROR:
			return {
				type: typeEnum.ERROR,
				modalClassName: 'notification-modal',
				...action.data
			};
		case actionTypes.GLOBAL_MODAL_WARNING:
			return {
				type: typeEnum.WARNING,
				modalClassName: 'notification-modal',
				...action.data
			};

		case actionTypes.GLOBAL_MODAL_SUCCESS:
			return {
				type: typeEnum.SUCCESS,
				modalClassName: 'notification-modal',
				...action.data
			};	

		case actionTypes.GLOBAL_MODAL_CLOSE:
			return null;			
		default:
			return state;
	}
};
