Chatwoot/app/javascript/dashboard/components/widgets/conversation/ConversationBox.vue

51 lines
988 B
Vue
Raw Normal View History

<template>
2019-11-14 08:16:43 +00:00
<div :class="conversationClass">
<messages-view
v-if="currentChat.id"
:inbox-id="inboxId"
:is-contact-panel-open="isContactPanelOpen"
@contactPanelToggle="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,
},
2019-11-14 08:16:43 +00:00
isContactPanelOpen: {
type: Boolean,
default: false,
},
},
computed: {
...mapGetters({
currentChat: 'getSelectedChat',
}),
2019-11-14 08:16:43 +00:00
conversationClass() {
return `medium-${
this.isContactPanelOpen ? '5' : '8'
} columns conversation-wrap`;
},
},
methods: {
2019-11-14 08:16:43 +00:00
onToggleContactPanel() {
this.$emit('contactPanelToggle');
},
},
};
</script>