import * as types from '../types/global.types';

export const changeStatusModal = (status) => ({
	type: types.CHANGE_STATUS_MODAL,
	payload: status,
});

export const changeActionButtonText = (text) => ({
	type: types.CHANGE_ACTION_BUTTON_TEXT,
	payload: text,
});

export const changeSettings = (settings) => ({
	type: types.CHANGE_SETTINGS,
	payload: settings,
});

export const getGlobalSettings = (settings) => ({
	type: types.GET_SETTINGS,
	payload: settings,
});

export const changeAction = (action) => ({
	type: types.CHANGE_ACTION,
	payload: action,
});

export const getError = (error) => ({
	type: types.GET_ERROR,
	payload: error,
});

export const changeError = (error) => ({
	type: types.CHANGE_ERROR,
	payload: error,
});

export const changePageLink = (error) => ({
	type: types.CHANGE_PAGE_LINK,
	payload: error,
});

export const changeSecondError = (text) => ({
	type: types.CHANGE_SECOND_ERROR,
	payload: text,
});

export const changeStatusLoader = (status) => ({
	type: types.CHANGE_STATUS_LOADER,
	payload: status,
});

export const getSubscriptionId = (subscriptionId) => ({
	type: types.GET_SUBSCRIPTION_ID,
	payload: subscriptionId,
});

export const changeSubscriptionId = (subscriptionId) => ({
	type: types.CHANGE_SUBSCRIPTION_ID,
	payload: subscriptionId,
});

export const getSelectedSubscription = (selectedSubscription) => ({
	type: types.GET_SELECTED_SUBSCRIPTION,
	payload: selectedSubscription,
});

export const changeSelectedSubscription = (selectedSubscription) => ({
	type: types.CHANGE_SELECTED_SUBSCRIPTION,
	payload: selectedSubscription,
});

export const resetGlobal = () => ({
  type: types.RESTART_GLOBAL_STATE,
});
