Chatwoot/app/javascript/dashboard/components/widgets/conversation/ConversationBox.vue
Sojan Jose 22880df429
Feature: Send chat transcript via email (#1152)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-08-17 11:25:13 +05:30

50 lines
992 B
Vue

<template>
<div :class="conversationClass">
<messages-view
v-if="currentChat.id"
:inbox-id="inboxId"
:is-contact-panel-open="isContactPanelOpen"
@contact-panel-toggle="onToggleContactPanel"
/>
<empty-state v-else />
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import EmptyState from './EmptyState';
import MessagesView from './MessagesView';
export default {
components: {
EmptyState,
MessagesView,
},
props: {
inboxId: {
type: [Number, String],
default: '',
required: false,
},
isContactPanelOpen: {
type: Boolean,
default: false,
},
},
computed: {
...mapGetters({
currentChat: 'getSelectedChat',
}),
conversationClass() {
return `medium-${
this.isContactPanelOpen ? '5' : '8'
} columns conversation-wrap`;
},
},
methods: {
onToggleContactPanel() {
this.$emit('contact-panel-toggle');
},
},
};
</script>