UserItem.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <!-- Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { useEditedBy } from '@mobile/composables/useEditedBy'
  4. import CommonUserAvatar from '@shared/components/CommonUserAvatar/CommonUserAvatar.vue'
  5. import { toRef } from 'vue'
  6. import type { UserItemData } from './types'
  7. export interface Props {
  8. entity: UserItemData
  9. }
  10. const props = defineProps<Props>()
  11. const { stringUpdated } = useEditedBy(toRef(props, 'entity'))
  12. </script>
  13. <template>
  14. <div class="flex ltr:pr-3 rtl:pl-3">
  15. <div class="mt-4 flex w-14 justify-center">
  16. <CommonUserAvatar aria-hidden="true" :entity="entity" />
  17. </div>
  18. <div
  19. class="flex flex-1 flex-col overflow-hidden border-b border-white/10 py-3 text-gray-100"
  20. >
  21. <span class="overflow-hidden text-ellipsis whitespace-nowrap">
  22. <!-- TODO: Should we show open or closed or nothing at all? -->
  23. {{
  24. entity.ticketsCount?.open === 1
  25. ? `1 ${$t('ticket')}`
  26. : $t('%s tickets', entity.ticketsCount?.open || 0)
  27. }}
  28. <template v-if="entity.organization">
  29. ·
  30. {{ entity.organization.name }}
  31. </template>
  32. </span>
  33. <span
  34. class="mb-1 whitespace-normal text-lg font-bold leading-5 line-clamp-3"
  35. >
  36. <slot> {{ entity.firstname }} {{ entity.lastname }} </slot>
  37. </span>
  38. <div
  39. v-if="stringUpdated"
  40. class="overflow-hidden text-ellipsis text-gray"
  41. data-test-id="stringUpdated"
  42. >
  43. {{ stringUpdated }}
  44. </div>
  45. </div>
  46. </div>
  47. </template>