FieldCustomerOptionIcon.vue 769 B

123456789101112131415161718192021222324
  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. />
  16. <CommonOrganizationAvatar
  17. v-else-if="option.object?.__typename === 'Organization'"
  18. :entity="option.object"
  19. size="xs"
  20. />
  21. </template>