TicketDetailTopBar.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { useTicketChannel } from '#shared/entities/ticket/composables/useTicketChannel.ts'
  4. import { useTicketView } from '#shared/entities/ticket/composables/useTicketView.ts'
  5. import TopBarHeader from '#desktop/pages/ticket/components/TicketDetailView/TicketDetailTopBar/TopBarHeader.vue'
  6. import { useTicketInformation } from '#desktop/pages/ticket/composables/useTicketInformation.ts'
  7. interface Props {
  8. hideDetails: boolean
  9. }
  10. defineProps<Props>()
  11. const { ticket } = useTicketInformation()
  12. const { isTicketAgent, isTicketEditable } = useTicketView(ticket)
  13. const { hasChannelAlert, channelAlert } = useTicketChannel(ticket)
  14. </script>
  15. <template>
  16. <div v-if="isTicketAgent && isTicketEditable && hasChannelAlert" class="z-10">
  17. <TopBarHeader :hide-details="hideDetails" />
  18. <CommonAlert
  19. class="rounded-none px-14 md:grid-cols-none md:justify-center"
  20. :variant="channelAlert?.variant"
  21. >
  22. {{ $t(channelAlert?.text, channelAlert?.textPlaceholder) }}
  23. </CommonAlert>
  24. </div>
  25. <TopBarHeader v-else :hide-details="hideDetails" />
  26. </template>