mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-22 01:15:25 +03:00
3c43a1cdd1
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
31 lines
904 B
Vue
31 lines
904 B
Vue
<script setup lang="ts">
|
|
import type { SearchResult } from '~/composables/masto/search'
|
|
|
|
defineProps<{
|
|
result: SearchResult
|
|
active: boolean
|
|
}>()
|
|
|
|
function onActivate() {
|
|
(document.activeElement as HTMLElement).blur()
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<CommonScrollIntoView
|
|
as="RouterLink"
|
|
hover:bg-active
|
|
:active="active"
|
|
:to="result.to" py2 block px2
|
|
:aria-selected="active"
|
|
:class="{ 'bg-active': active }"
|
|
@click="() => onActivate()"
|
|
>
|
|
<SearchHashtagInfo v-if="result.type === 'hashtag'" :hashtag="result.data" />
|
|
<SearchAccountInfo v-else-if="result.type === 'account'" :account="result.data" />
|
|
<StatusCard v-else-if="result.type === 'status'" :status="result.data" :actions="false" :show-reply-to="false" />
|
|
<!-- <div v-else-if="result.type === 'action'" text-center>
|
|
{{ result.action!.label }}
|
|
</div> -->
|
|
</CommonScrollIntoView>
|
|
</template>
|