mirror of
https://github.com/elk-zone/elk
synced 2024-11-24 07:06:08 +09:00
19 lines
726 B
Vue
19 lines
726 B
Vue
<script setup lang="ts">
|
|
import type { SearchResult } from './types'
|
|
defineProps<{ result: SearchResult; active: boolean }>()
|
|
|
|
const onActivate = () => {
|
|
(document.activeElement as HTMLElement).blur()
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<CommonScrollIntoView as="RouterLink" :active="active" :to="result.to" py2 block px2 :aria-selected="active" :class="{ 'bg-active': active }" hover:bg-active @click="() => onActivate()">
|
|
<SearchHashtagInfo v-if="result.type === 'hashtag'" :hashtag="result.hashtag" />
|
|
<AccountInfo v-else-if="result.type === 'account'" :account="result.account" />
|
|
<div v-else-if="result.type === 'action'" text-center>
|
|
{{ result.action!.label }}
|
|
</div>
|
|
</CommonScrollIntoView>
|
|
</template>
|