TicketViewerItem.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { computed } from 'vue'
  4. import CommonUserAvatar from '#shared/components/CommonUserAvatar/CommonUserAvatar.vue'
  5. import type { AvatarUser } from '#shared/components/CommonUserAvatar/types.ts'
  6. import { EnumTaskbarApp } from '#shared/graphql/types.ts'
  7. interface Props {
  8. user: AvatarUser
  9. editing: boolean
  10. idle?: boolean
  11. app: EnumTaskbarApp
  12. }
  13. const props = defineProps<Props>()
  14. const showDesktopIcon = computed(() => {
  15. return props.app === EnumTaskbarApp.Desktop
  16. })
  17. const idleClasses = computed(() => {
  18. return props.idle !== undefined && props.idle ? 'opacity-20 grayscale' : ''
  19. })
  20. </script>
  21. <template>
  22. <div class="flex items-center justify-between px-3 first:pt-1 last:pb-1">
  23. <div class="flex items-center">
  24. <CommonUserAvatar :entity="user" :class="idleClasses" />
  25. <div class="ltr:ml-3 rtl:mr-3">{{ user.fullname }}</div>
  26. </div>
  27. <div v-if="editing || showDesktopIcon" class="flex items-center">
  28. <CommonIcon
  29. v-if="editing && showDesktopIcon"
  30. :label="__('Editing on Desktop')"
  31. name="desktop-edit"
  32. />
  33. <CommonIcon
  34. v-else-if="showDesktopIcon"
  35. :label="__('Desktop')"
  36. name="desktop"
  37. />
  38. <CommonIcon v-else-if="editing" :label="__('Editing')" name="edit" />
  39. </div>
  40. </div>
  41. </template>