UserTaskbarTabForbidden.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { toRef } from 'vue'
  4. import { useUserTaskbarTabLink } from '#desktop/composables/useUserTaskbarTabLink.ts'
  5. import type { UserTaskbarTabEntityProps } from './types.ts'
  6. const props = defineProps<UserTaskbarTabEntityProps>()
  7. const { tabLinkInstance, taskbarTabActive } = useUserTaskbarTabLink(
  8. toRef(props, 'taskbarTab'),
  9. )
  10. </script>
  11. <template>
  12. <CommonLink
  13. v-if="taskbarTabLink"
  14. ref="tabLinkInstance"
  15. v-tooltip="$t('You have insufficient rights to view this object.')"
  16. class="flex grow gap-2 rounded-md px-2 py-3 hover:no-underline focus-visible:rounded-md focus-visible:outline-none group-hover/tab:bg-blue-600 group-hover/tab:dark:bg-blue-900"
  17. :class="{
  18. ['!bg-blue-800 text-white']: taskbarTabActive,
  19. }"
  20. :link="taskbarTabLink"
  21. internal
  22. >
  23. <CommonIcon
  24. name="x-lg"
  25. size="small"
  26. class="shrink-0 text-red-500"
  27. decorative
  28. />
  29. <CommonLabel
  30. class="-:text-gray-300 -:dark:text-neutral-400 block truncate group-hover/tab:text-white group-focus-visible/link:text-white"
  31. :class="{
  32. '!text-white': taskbarTabActive,
  33. }"
  34. >
  35. {{ $t('Access denied') }}
  36. </CommonLabel>
  37. </CommonLink>
  38. </template>