<template>
    <chat :chatEngine=chatEngine 
          :chatId="chatId" />
</template>

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
import globals from '../components/dev/globals';
import Chat from '../components/Chat.vue';
import ChatEngine from '../components/ChatEngine';

@Component({
  components: {
    Chat,
  },
})
export default class ChatConversationView extends Vue {
  @Prop() private chatEngine!: ChatEngine;
  private chatId: string = '';

  public created() {
    this.chatId = this.$root.$route.params.id;

    /* Check if we got an id for the chat */
    if (!(this.chatId)) {
      this.$root.$router.push({path: '/chat'});
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">

</style>
