18 lines
553 B
TypeScript
18 lines
553 B
TypeScript
|
import { TActionEnterpriseModules } from '../actions/enterpriseModules';
|
||
|
import { ENTERPRISE_MODULES } from '../actions/actionsTypes';
|
||
|
|
||
|
export type IEnterpriseModules = 'omnichannel-mobile-enterprise' | 'livechat-enterprise';
|
||
|
|
||
|
export const initialState: IEnterpriseModules[] = [];
|
||
|
|
||
|
export default (state = initialState, action: TActionEnterpriseModules): IEnterpriseModules[] => {
|
||
|
switch (action.type) {
|
||
|
case ENTERPRISE_MODULES.SET:
|
||
|
return action.payload;
|
||
|
case ENTERPRISE_MODULES.CLEAR:
|
||
|
return initialState;
|
||
|
default:
|
||
|
return state;
|
||
|
}
|
||
|
};
|