2021-03-09 14:22:14 +00:00
|
|
|
import { INBOX_TYPES } from 'shared/mixins/inboxMixin';
|
|
|
|
|
|
|
|
export const getInboxClassByType = (type, phoneNumber) => {
|
|
|
|
switch (type) {
|
|
|
|
case INBOX_TYPES.WEB:
|
2021-12-01 05:03:18 +00:00
|
|
|
return 'globe-desktop';
|
2021-03-09 14:22:14 +00:00
|
|
|
|
|
|
|
case INBOX_TYPES.FB:
|
2021-12-01 05:03:18 +00:00
|
|
|
return 'brand-facebook';
|
2021-03-09 14:22:14 +00:00
|
|
|
|
|
|
|
case INBOX_TYPES.TWITTER:
|
2021-12-01 05:03:18 +00:00
|
|
|
return 'brand-twitter';
|
2021-03-09 14:22:14 +00:00
|
|
|
|
|
|
|
case INBOX_TYPES.TWILIO:
|
|
|
|
return phoneNumber.startsWith('whatsapp')
|
2021-12-01 05:03:18 +00:00
|
|
|
? 'brand-whatsapp'
|
|
|
|
: 'brand-sms';
|
2021-03-09 14:22:14 +00:00
|
|
|
|
2021-10-05 18:05:06 +00:00
|
|
|
case INBOX_TYPES.WHATSAPP:
|
2021-12-01 05:03:18 +00:00
|
|
|
return 'brand-whatsapp';
|
2021-10-05 18:05:06 +00:00
|
|
|
|
2021-03-09 14:22:14 +00:00
|
|
|
case INBOX_TYPES.API:
|
2021-12-01 05:03:18 +00:00
|
|
|
return 'cloud';
|
2021-03-09 14:22:14 +00:00
|
|
|
|
|
|
|
case INBOX_TYPES.EMAIL:
|
2021-12-01 05:03:18 +00:00
|
|
|
return 'mail';
|
2021-03-09 14:22:14 +00:00
|
|
|
|
2021-09-15 12:42:56 +00:00
|
|
|
case INBOX_TYPES.TELEGRAM:
|
2021-12-01 05:03:18 +00:00
|
|
|
return 'brand-telegram';
|
|
|
|
|
|
|
|
case INBOX_TYPES.LINE:
|
|
|
|
return 'brand-line';
|
2021-09-15 12:42:56 +00:00
|
|
|
|
2021-03-09 14:22:14 +00:00
|
|
|
default:
|
2021-12-01 05:03:18 +00:00
|
|
|
return 'chat';
|
2021-03-09 14:22:14 +00:00
|
|
|
}
|
|
|
|
};
|
2022-06-07 12:20:51 +00:00
|
|
|
|
|
|
|
export const getInboxWarningIconClass = (type, reauthorizationRequired) => {
|
|
|
|
if (type === INBOX_TYPES.FB && reauthorizationRequired) {
|
|
|
|
return 'warning';
|
|
|
|
}
|
|
|
|
return '';
|
|
|
|
};
|