HEX
Server: Apache
System: Linux webm003.cluster111.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: assotraipi (849654)
PHP: 5.4.45
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/assotraipi/www/wp-content/plugins/download-monitor/assets/apps/reports/context/reducer.js
export const actionTypes = {
	SET_PERIODS: 'SET_PERIODS',
	SET_ACTIVE_TAB: 'SET_ACTIVE_TAB',
	SET_DETAILED_DOWNLOADS: 'SET_DETAILED_DOWNLOADS',
	SET_OVERVIEW_DOWNLOADS: 'SET_OVERVIEW_DOWNLOADS',
	SET_CHART_OPTIONS: 'SET_CHART_OPTIONS',
};

export const reducer = ( state, action ) => {
	switch ( action.type ) {
		case actionTypes.SET_PERIODS:
			return {
				...state,
				periods: action.payload,
			};
		case actionTypes.SET_ACTIVE_TAB:
			return {
				...state,
				activeTab: action.payload,
			};
		case actionTypes.SET_CHART_OPTIONS:
			return {
				...state,
				chart: action.payload,
			};
		default:
			return {
				...state,
				[ action.slug ]: action.payload,
			};
	}
};