mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-11-03 20:48:07 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			50 lines
		
	
	
		
			977 B
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			50 lines
		
	
	
		
			977 B
		
	
	
	
		
			Vue
		
	
	
	
	
	
<template>
 | 
						|
  <woot-button
 | 
						|
    v-tooltip.right="$t(`SIDEBAR.PROFILE_SETTINGS`)"
 | 
						|
    variant="link"
 | 
						|
    class="current-user"
 | 
						|
    @click="handleClick"
 | 
						|
  >
 | 
						|
    <thumbnail
 | 
						|
      :src="currentUser.avatar_url"
 | 
						|
      :username="currentUser.name"
 | 
						|
      :status="statusOfAgent"
 | 
						|
      should-show-status-always
 | 
						|
      size="32px"
 | 
						|
    />
 | 
						|
  </woot-button>
 | 
						|
</template>
 | 
						|
<script>
 | 
						|
import { mapGetters } from 'vuex';
 | 
						|
import Thumbnail from '../../widgets/Thumbnail.vue';
 | 
						|
 | 
						|
export default {
 | 
						|
  components: {
 | 
						|
    Thumbnail,
 | 
						|
  },
 | 
						|
  computed: {
 | 
						|
    ...mapGetters({
 | 
						|
      currentUser: 'getCurrentUser',
 | 
						|
      currentUserAvailability: 'getCurrentUserAvailability',
 | 
						|
    }),
 | 
						|
    statusOfAgent() {
 | 
						|
      return this.currentUserAvailability || 'offline';
 | 
						|
    },
 | 
						|
  },
 | 
						|
  methods: {
 | 
						|
    handleClick() {
 | 
						|
      this.$emit('toggle-menu');
 | 
						|
    },
 | 
						|
  },
 | 
						|
};
 | 
						|
</script>
 | 
						|
 | 
						|
<style scoped lang="scss">
 | 
						|
.current-user {
 | 
						|
  align-items: center;
 | 
						|
  display: flex;
 | 
						|
  border-radius: 50%;
 | 
						|
  border: 2px solid var(--white);
 | 
						|
}
 | 
						|
</style>
 |