FieldCustomerOptionIcon.vue 786 B

12345678910111213141516171819202122232425
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import CommonOrganizationAvatar from '#shared/components/CommonOrganizationAvatar/CommonOrganizationAvatar.vue'
  4. import CommonUserAvatar from '#shared/components/CommonUserAvatar/CommonUserAvatar.vue'
  5. import type { AutoCompleteCustomerGenericOption } from '#shared/components/Form/fields/FieldCustomer/types.ts'
  6. defineProps<{
  7. option: AutoCompleteCustomerGenericOption
  8. }>()
  9. </script>
  10. <template>
  11. <CommonUserAvatar
  12. v-if="option.object?.__typename === 'User'"
  13. :entity="option.object"
  14. size="xs"
  15. no-indicator
  16. />
  17. <CommonOrganizationAvatar
  18. v-else-if="option.object?.__typename === 'Organization'"
  19. :entity="option.object"
  20. size="xs"
  21. />
  22. </template>