Chatwoot/app/javascript/dashboard/helper/inbox.js
Sojan Jose bd7aeba484
chore: Provider API prototype (#3112)
Enabling Support for Whatsapp via 360Dialog as a prototype for the provider APIs. 

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2021-10-05 23:35:06 +05:30

34 lines
775 B
JavaScript

import { INBOX_TYPES } from 'shared/mixins/inboxMixin';
export const getInboxClassByType = (type, phoneNumber) => {
switch (type) {
case INBOX_TYPES.WEB:
return 'ion-earth';
case INBOX_TYPES.FB:
return 'ion-social-facebook';
case INBOX_TYPES.TWITTER:
return 'ion-social-twitter';
case INBOX_TYPES.TWILIO:
return phoneNumber.startsWith('whatsapp')
? 'ion-social-whatsapp-outline'
: 'ion-android-textsms';
case INBOX_TYPES.WHATSAPP:
return 'ion-social-whatsapp-outline';
case INBOX_TYPES.API:
return 'ion-cloud';
case INBOX_TYPES.EMAIL:
return 'ion-ios-email';
case INBOX_TYPES.TELEGRAM:
return 'ion-ios-navigate';
default:
return 'ion-ios-chatbubble';
}
};