UserItem.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { useEditedBy } from '#mobile/composables/useEditedBy.ts'
  4. import CommonUserAvatar from '#shared/components/CommonUserAvatar/CommonUserAvatar.vue'
  5. import { toRef } from 'vue'
  6. import type { UserItemData } from './types.ts'
  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="truncate">
  22. {{
  23. entity.ticketsCount?.open === 1
  24. ? `1 ${$t('ticket')}`
  25. : $t('%s tickets', entity.ticketsCount?.open || 0)
  26. }}
  27. <template v-if="entity.organization">
  28. ·
  29. {{ entity.organization.name }}
  30. </template>
  31. </span>
  32. <span
  33. class="mb-1 line-clamp-3 whitespace-normal text-lg font-bold leading-5"
  34. >
  35. <slot> {{ entity.firstname }} {{ entity.lastname }} </slot>
  36. </span>
  37. <div v-if="stringUpdated" class="truncate" data-test-id="stringUpdated">
  38. {{ stringUpdated }}
  39. </div>
  40. </div>
  41. </div>
  42. </template>