2022-12-17 21:35:07 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
import type { SearchResult } from './types'
|
2022-12-17 22:15:41 +00:00
|
|
|
defineProps<{ result: SearchResult; active: boolean }>()
|
2022-12-17 21:35:07 +00:00
|
|
|
|
|
|
|
const onActivate = () => {
|
|
|
|
(document.activeElement as HTMLElement).blur()
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2022-12-17 22:15:41 +00:00
|
|
|
<CommonScrollIntoView as="RouterLink" :active="active" :to="result.to" py2 block px2 :aria-selected="active" :class="{ 'bg-active': active }" hover:bg-active @click="() => onActivate()">
|
2022-12-17 21:35:07 +00:00
|
|
|
<SearchHashtagInfo v-if="result.type === 'hashtag'" :hashtag="result.hashtag" />
|
|
|
|
<AccountInfo v-else-if="result.type === 'account'" :account="result.account" />
|
2022-12-29 14:44:26 +00:00
|
|
|
<StatusCard v-else-if="result.type === 'status'" :status="result.status" :actions="false" :show-reply-to="false" />
|
2022-12-17 21:35:07 +00:00
|
|
|
<div v-else-if="result.type === 'action'" text-center>
|
|
|
|
{{ result.action!.label }}
|
|
|
|
</div>
|
2022-12-17 22:15:41 +00:00
|
|
|
</CommonScrollIntoView>
|
2022-12-17 21:35:07 +00:00
|
|
|
</template>
|