2019-10-29 07:20:54 +00:00
|
|
|
<template>
|
2020-01-09 07:36:40 +00:00
|
|
|
<div class="chat-bubble agent">
|
|
|
|
<span v-html="formatMessage(message)"></span>
|
|
|
|
<email-input
|
|
|
|
v-if="shouldShowInput"
|
|
|
|
:message-id="messageId"
|
|
|
|
:message-content-attributes="messageContentAttributes"
|
|
|
|
/>
|
|
|
|
</div>
|
2019-10-29 07:20:54 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-11-23 18:59:55 +00:00
|
|
|
import messageFormatterMixin from 'shared/mixins/messageFormatterMixin';
|
2020-01-09 07:36:40 +00:00
|
|
|
import EmailInput from './template/EmailInput';
|
2019-11-23 18:59:55 +00:00
|
|
|
|
2019-10-29 07:20:54 +00:00
|
|
|
export default {
|
|
|
|
name: 'AgentMessageBubble',
|
2020-01-09 07:36:40 +00:00
|
|
|
components: {
|
|
|
|
EmailInput,
|
|
|
|
},
|
2019-11-23 18:59:55 +00:00
|
|
|
mixins: [messageFormatterMixin],
|
2019-10-29 07:20:54 +00:00
|
|
|
props: {
|
|
|
|
message: String,
|
2020-01-09 07:36:40 +00:00
|
|
|
contentType: String,
|
|
|
|
messageType: Number,
|
|
|
|
messageId: Number,
|
|
|
|
messageContentAttributes: {
|
|
|
|
type: Object,
|
|
|
|
default: () => {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
shouldShowInput() {
|
|
|
|
return this.contentType === 'input_email' && this.messageType === 3;
|
|
|
|
},
|
2019-10-29 07:20:54 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import '~widget/assets/scss/variables.scss';
|
|
|
|
|
|
|
|
.chat-bubble {
|
|
|
|
&.agent {
|
|
|
|
background: $color-white;
|
|
|
|
border-bottom-left-radius: $space-smaller;
|
|
|
|
color: $color-body;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|