ArticleReactionBadge.vue 1000 B

123456789101112131415161718192021222324252627282930313233
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. defineProps<{
  4. position: 'left' | 'right' | 'system'
  5. reaction?: Maybe<string>
  6. }>()
  7. </script>
  8. <template>
  9. <div
  10. v-if="reaction"
  11. class="absolute bottom-0 flex w-fit translate-y-1/2 items-center gap-1"
  12. :class="{
  13. 'ltr:right-3 rtl:left-3': position === 'left' || position === 'system',
  14. 'ltr:left-3 rtl:right-3': position === 'right',
  15. }"
  16. >
  17. <CommonLabel
  18. class="cursor-default rounded-md border px-1 py-0.5"
  19. :class="{
  20. 'border-neutral-100 bg-neutral-50 dark:border-gray-900 dark:bg-gray-500':
  21. position === 'left',
  22. 'border-neutral-100 bg-blue-100 dark:border-gray-900 dark:bg-stone-500':
  23. position === 'right',
  24. 'border-neutral-500 bg-blue-50 dark:border-neutral-500 dark:bg-gray-800':
  25. position === 'system',
  26. }"
  27. size="small"
  28. >{{ reaction }}</CommonLabel
  29. >
  30. </div>
  31. </template>