ArticleMetaSecurity.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { toRef } from 'vue'
  4. import { useArticleSecurity } from '#shared/composables/useArticleSecurity.ts'
  5. import type { TicketArticle } from '#shared/entities/ticket/types.ts'
  6. interface Props {
  7. context: {
  8. article: TicketArticle
  9. }
  10. }
  11. const props = defineProps<Props>()
  12. const {
  13. typeLabel,
  14. signingIcon,
  15. encryptionIcon,
  16. encryptionMessage,
  17. signedStatusMessage,
  18. encryptedStatusMessage,
  19. signingMessage,
  20. } = useArticleSecurity(toRef(props.context.article))
  21. </script>
  22. <template>
  23. <div class="flex items-center gap-1.5">
  24. <CommonLabel v-if="typeLabel">{{ typeLabel }}</CommonLabel>
  25. <CommonLabel
  26. v-if="encryptionMessage"
  27. v-tooltip="encryptionMessage"
  28. :prefix-icon="encryptionIcon"
  29. class="text-black dark:text-white"
  30. >
  31. {{ $t(encryptedStatusMessage) }}
  32. </CommonLabel>
  33. <CommonLabel
  34. v-if="signingMessage"
  35. v-tooltip="signingMessage"
  36. :prefix-icon="signingIcon"
  37. class="text-black dark:text-white"
  38. >
  39. {{ $t(signedStatusMessage) }}
  40. </CommonLabel>
  41. </div>
  42. </template>