PowerSearchEntry.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div
  3. class="
  4. cursor-pointer
  5. flex
  6. py-2
  7. px-6
  8. transition
  9. items-center
  10. group
  11. hover:bg-primaryLight
  12. focus:outline-none
  13. focus-visible:bg-primaryLight
  14. "
  15. tabindex="0"
  16. @click="$emit('action', shortcut.action)"
  17. @keydown.enter="$emit('action', shortcut.action)"
  18. >
  19. <SmartIcon
  20. class="
  21. mr-4
  22. opacity-75
  23. transition
  24. svg-icons
  25. group-hover:opacity-100
  26. group-focus:opacity-100
  27. "
  28. :name="shortcut.icon"
  29. />
  30. <span
  31. class="
  32. flex flex-1
  33. mr-4
  34. transition
  35. group-hover:text-secondaryDark
  36. group-focus:text-secondaryDark
  37. "
  38. >
  39. {{ $t(shortcut.label) }}
  40. </span>
  41. <span
  42. v-for="(key, keyIndex) in shortcut.keys"
  43. :key="`key-${keyIndex}`"
  44. class="shortcut-key"
  45. >
  46. {{ key }}
  47. </span>
  48. </div>
  49. </template>
  50. <script setup lang="ts">
  51. defineProps<{
  52. shortcut: Object
  53. }>()
  54. </script>
  55. <style lang="scss" scoped>
  56. .shortcut-key {
  57. @apply bg-dividerLight;
  58. @apply rounded;
  59. @apply ml-2;
  60. @apply py-1;
  61. @apply px-2;
  62. @apply inline-flex;
  63. }
  64. </style>