ArticleMetaDetectedLanguage.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <!-- Copyright (C) 2012-2025 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { computed } from 'vue'
  4. import ObjectAttributeContent from '#shared/components/ObjectAttributes/ObjectAttribute.vue'
  5. import { useObjectAttributes } from '#shared/entities/object-attributes/composables/useObjectAttributes.ts'
  6. import type { TicketArticle } from '#shared/entities/ticket/types.ts'
  7. import { EnumObjectManagerObjects } from '#shared/graphql/types.ts'
  8. interface Props {
  9. context: {
  10. article: TicketArticle
  11. }
  12. }
  13. defineProps<Props>()
  14. const { attributesLookup } = useObjectAttributes(
  15. EnumObjectManagerObjects.TicketArticle,
  16. )
  17. const detectedLanguageAttribute = computed(() =>
  18. attributesLookup.value.get('detected_language'),
  19. )
  20. </script>
  21. <template>
  22. <CommonLabel class="text-black dark:text-white">
  23. <ObjectAttributeContent
  24. v-if="detectedLanguageAttribute"
  25. :attribute="detectedLanguageAttribute"
  26. :object="context.article"
  27. />
  28. <template v-else>{{ context.article.detectedLanguage }}</template>
  29. </CommonLabel>
  30. </template>