<template>
  <div class="text-h4" :class="{ 'text-negative': !thread.client }">
    {{ title }}
  </div>
</template>

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'
import { MessageThread } from '@/widgets/messages/types/MessageThread'

@Component
export default class ThreadTitle extends Vue {
  @Prop({ type: Object, required: true })
  thread!: MessageThread

  get href(): string {
    return ''
  }

  get title() {
    return this.thread.client
      ? this.thread.client.fullName
      : `Агент Смит ${this.thread.clientId}`
  }
}
</script>
