akkoma-fe/src/components/chat_title/chat_title.js

27 lines
611 B
JavaScript
Raw Normal View History

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