api-client/components/app/PowerSearchEntry.vue

67 lines
1.1 KiB
Vue
Raw Normal View History

2021-08-29 06:30:19 +00:00
<template>
<div
class="
cursor-pointer
flex
py-2
px-6
transition
items-center
group
hover:bg-primaryLight
2021-08-29 07:55:01 +00:00
focus:outline-none
focus-visible:bg-primaryLight
2021-08-29 06:30:19 +00:00
"
2021-08-29 07:55:01 +00:00
tabindex="0"
2021-08-29 06:30:19 +00:00
@click="$emit('action', shortcut.action)"
2021-08-29 07:55:01 +00:00
@keydown.enter="$emit('action', shortcut.action)"
2021-08-29 06:30:19 +00:00
>
<SmartIcon
2021-08-29 07:55:01 +00:00
class="
mr-4
opacity-75
transition
svg-icons
group-hover:opacity-100
group-focus:opacity-100
"
2021-08-29 06:30:19 +00:00
:name="shortcut.icon"
/>
2021-08-29 07:55:01 +00:00
<span
class="
flex flex-1
mr-4
transition
group-hover:text-secondaryDark
group-focus:text-secondaryDark
"
>
2021-08-29 06:30:19 +00:00
{{ $t(shortcut.label) }}
</span>
<span
v-for="(key, keyIndex) in shortcut.keys"
:key="`key-${keyIndex}`"
class="shortcut-key"
>
{{ key }}
</span>
</div>
</template>
<script setup lang="ts">
defineProps<{
shortcut: Object
}>()
</script>
<style lang="scss" scoped>
.shortcut-key {
@apply bg-dividerLight;
@apply rounded;
@apply ml-2;
@apply py-1;
@apply px-2;
@apply inline-flex;
}
</style>