Ticket.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <!-- Copyright (C) 2012-2025 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { computed } from 'vue'
  4. import type { TicketById } from '#shared/entities/ticket/types.ts'
  5. import CommonTicketStateIndicatorIcon from '#desktop/components/CommonTicketStateIndicator/CommonTicketStateIndicatorIcon.vue'
  6. import type { QuickSearchPluginProps } from '../types.ts'
  7. const props = defineProps<QuickSearchPluginProps>()
  8. const itemLabel = computed(() => {
  9. if (props.mode === 'recently-viewed') {
  10. return (props.item as TicketById).title
  11. }
  12. return `#${props.item.number} - ${props.item.title}`
  13. })
  14. </script>
  15. <template>
  16. <CommonLink
  17. class="group/item flex grow gap-2 rounded-md px-2 py-3 hover:bg-blue-900 hover:no-underline!"
  18. :link="`/tickets/${item.internalId}`"
  19. internal
  20. >
  21. <CommonTicketStateIndicatorIcon
  22. class="shrink-0"
  23. icon-size="small"
  24. :color-code="(item as TicketById).stateColorCode"
  25. :label="(item as TicketById).state.name"
  26. />
  27. <CommonLabel class="block! truncate group-hover/item:text-white">
  28. {{ itemLabel }}
  29. </CommonLabel>
  30. </CommonLink>
  31. </template>