2021-02-08 11:08:35 +00:00
|
|
|
<template>
|
2021-12-01 07:15:39 +00:00
|
|
|
<woot-button
|
|
|
|
v-tooltip.right="$t(`SIDEBAR.PROFILE_SETTINGS`)"
|
|
|
|
variant="link"
|
|
|
|
class="current-user"
|
|
|
|
@click="handleClick"
|
|
|
|
>
|
2021-02-08 11:08:35 +00:00
|
|
|
<thumbnail
|
|
|
|
:src="currentUser.avatar_url"
|
2021-12-01 07:15:39 +00:00
|
|
|
:username="currentUser.name"
|
|
|
|
:status="statusOfAgent"
|
|
|
|
should-show-status-always
|
|
|
|
size="32px"
|
2021-02-08 11:08:35 +00:00
|
|
|
/>
|
2021-12-01 07:15:39 +00:00
|
|
|
</woot-button>
|
2021-02-08 11:08:35 +00:00
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
import Thumbnail from '../../widgets/Thumbnail';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
Thumbnail,
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapGetters({
|
|
|
|
currentUser: 'getCurrentUser',
|
2021-12-01 07:15:39 +00:00
|
|
|
currentUserAvailability: 'getCurrentUserAvailability',
|
2021-02-08 11:08:35 +00:00
|
|
|
}),
|
2021-12-01 07:15:39 +00:00
|
|
|
statusOfAgent() {
|
|
|
|
return this.currentUserAvailability || 'offline';
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
handleClick() {
|
|
|
|
this.$emit('toggle-menu');
|
2021-02-08 11:08:35 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
2021-12-01 07:15:39 +00:00
|
|
|
.current-user {
|
2021-02-08 11:08:35 +00:00
|
|
|
align-items: center;
|
|
|
|
display: flex;
|
2021-12-01 07:15:39 +00:00
|
|
|
border-radius: 50%;
|
|
|
|
border: 2px solid var(--white);
|
2021-02-08 11:08:35 +00:00
|
|
|
}
|
|
|
|
</style>
|