CommonTicketEscalationIndicator.vue 914 B

123456789101112131415161718192021222324252627282930313233
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { toRef } from 'vue'
  4. import {
  5. useEscalationState,
  6. EscalationState,
  7. } from '#shared/composables/useEscalationState.ts'
  8. import type { Scalars } from '#shared/graphql/types.ts'
  9. export interface Props {
  10. escalationAt?: Maybe<Scalars['ISO8601DateTime']['output']>
  11. }
  12. const props = defineProps<Props>()
  13. const escalationState = useEscalationState(toRef(() => props.escalationAt))
  14. </script>
  15. <template>
  16. <CommonBadge
  17. v-if="escalationAt && escalationState !== EscalationState.None"
  18. :variant="
  19. escalationState === EscalationState.Escalated ? 'danger' : 'warning'
  20. "
  21. class="uppercase"
  22. role="alert"
  23. >
  24. <CommonIcon name="warning-triangle" class="me-1" size="xs" decorative />
  25. {{ $t('escalation %s', i18n.relativeDateTime(escalationAt)) }}
  26. </CommonBadge>
  27. </template>