Chatwoot/app/javascript/dashboard/helper/inbox.js
Jordan Brough 49d08a6773
feat: Support Twilio Messaging Services (#4242)
This allows sending and receiving from multiple phone numbers using Twilio messaging services

Fixes: #4204
2022-07-08 18:20:07 +05:30

44 lines
940 B
JavaScript

import { INBOX_TYPES } from 'shared/mixins/inboxMixin';
export const getInboxClassByType = (type, phoneNumber) => {
switch (type) {
case INBOX_TYPES.WEB:
return 'globe-desktop';
case INBOX_TYPES.FB:
return 'brand-facebook';
case INBOX_TYPES.TWITTER:
return 'brand-twitter';
case INBOX_TYPES.TWILIO:
return phoneNumber?.startsWith('whatsapp')
? 'brand-whatsapp'
: 'brand-sms';
case INBOX_TYPES.WHATSAPP:
return 'brand-whatsapp';
case INBOX_TYPES.API:
return 'cloud';
case INBOX_TYPES.EMAIL:
return 'mail';
case INBOX_TYPES.TELEGRAM:
return 'brand-telegram';
case INBOX_TYPES.LINE:
return 'brand-line';
default:
return 'chat';
}
};
export const getInboxWarningIconClass = (type, reauthorizationRequired) => {
if (type === INBOX_TYPES.FB && reauthorizationRequired) {
return 'warning';
}
return '';
};