2020-05-07 23:10:53 +10:00
|
|
|
import Vue from 'vue'
|
2020-06-22 00:13:29 +10:00
|
|
|
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
|
|
|
import UserAvatar from '../user_avatar/user_avatar.vue'
|
2020-05-07 23:10:53 +10:00
|
|
|
|
|
|
|
export default Vue.component('chat-title', {
|
|
|
|
name: 'ChatTitle',
|
|
|
|
components: {
|
2020-06-22 00:13:29 +10:00
|
|
|
UserAvatar
|
2020-05-07 23:10:53 +10:00
|
|
|
},
|
|
|
|
props: [
|
|
|
|
'user', 'withAvatar'
|
|
|
|
],
|
|
|
|
computed: {
|
|
|
|
title () {
|
|
|
|
return this.user ? this.user.screen_name : ''
|
|
|
|
},
|
|
|
|
htmlTitle () {
|
|
|
|
return this.user ? this.user.name_html : ''
|
|
|
|
}
|
2020-06-22 00:13:29 +10:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
getUserProfileLink (user) {
|
|
|
|
return generateProfileLink(user.id, user.screen_name)
|
|
|
|
}
|
2020-05-07 23:10:53 +10:00
|
|
|
}
|
|
|
|
})
|