diff --git a/app/javascript/dashboard/components-next/NewConversation/components/ActionButtons.vue b/app/javascript/dashboard/components-next/NewConversation/components/ActionButtons.vue index 6f2178408..773ebe315 100644 --- a/app/javascript/dashboard/components-next/NewConversation/components/ActionButtons.vue +++ b/app/javascript/dashboard/components-next/NewConversation/components/ActionButtons.vue @@ -11,12 +11,14 @@ import { extractTextFromMarkdown } from 'dashboard/helper/editorHelper'; import Button from 'dashboard/components-next/button/Button.vue'; import WhatsAppOptions from './WhatsAppOptions.vue'; +import ContentTemplateSelector from './ContentTemplateSelector.vue'; const props = defineProps({ attachedFiles: { type: Array, default: () => [] }, isWhatsappInbox: { type: Boolean, default: false }, isEmailOrWebWidgetInbox: { type: Boolean, default: false }, isTwilioSmsInbox: { type: Boolean, default: false }, + isTwilioWhatsAppInbox: { type: Boolean, default: false }, messageTemplates: { type: Array, default: () => [] }, channelType: { type: String, default: '' }, isLoading: { type: Boolean, default: false }, @@ -32,6 +34,7 @@ const emit = defineEmits([ 'discard', 'sendMessage', 'sendWhatsappMessage', + 'sendTwilioMessage', 'insertEmoji', 'addSignature', 'removeSignature', @@ -63,6 +66,20 @@ const sendWithSignature = computed(() => { return fetchSignatureFlagFromUISettings(props.channelType); }); +const showTwilioContentTemplates = computed(() => { + return props.isTwilioWhatsAppInbox && props.inboxId; +}); + +const shouldShowEmojiButton = computed(() => { + return ( + !props.isWhatsappInbox && !props.isTwilioWhatsAppInbox && !props.hasNoInbox + ); +}); + +const isRegularMessageMode = computed(() => { + return !props.isWhatsappInbox && !props.isTwilioWhatsAppInbox; +}); + const setSignature = () => { if (signatureToApply.value) { if (sendWithSignature.value) { @@ -125,7 +142,7 @@ const keyboardEvents = { action: () => { if ( isEditorHotKeyEnabled('enter') && - !props.isWhatsappInbox && + isRegularMessageMode.value && !props.isDropdownActive ) { emit('sendMessage'); @@ -136,7 +153,7 @@ const keyboardEvents = { action: () => { if ( isEditorHotKeyEnabled('cmd_enter') && - !props.isWhatsappInbox && + isRegularMessageMode.value && !props.isDropdownActive ) { emit('sendMessage'); @@ -158,8 +175,13 @@ useKeyboardEvents(keyboardEvents); :message-templates="messageTemplates" @send-message="emit('sendWhatsappMessage', $event)" /> +
@@ -172,7 +194,7 @@ useKeyboardEvents(keyboardEvents); />
@@ -199,7 +221,7 @@ useKeyboardEvents(keyboardEvents); />