2022-12-17 22:35:07 +01:00
|
|
|
<script setup lang="ts">
|
2023-01-07 15:52:58 +01:00
|
|
|
import type { SearchResult } from '~/composables/masto/search'
|
2023-01-05 17:48:20 +01:00
|
|
|
|
|
|
|
defineProps<{
|
|
|
|
result: SearchResult
|
|
|
|
active: boolean
|
|
|
|
}>()
|
2022-12-17 22:35:07 +01:00
|
|
|
|
2023-03-30 21:01:24 +02:00
|
|
|
function onActivate() {
|
2022-12-17 22:35:07 +01:00
|
|
|
(document.activeElement as HTMLElement).blur()
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-01-05 23:50:14 +01:00
|
|
|
<CommonScrollIntoView
|
|
|
|
as="RouterLink"
|
|
|
|
hover:bg-active
|
|
|
|
:active="active"
|
|
|
|
:to="result.to" py2 block px2
|
|
|
|
:aria-selected="active"
|
|
|
|
:class="{ 'bg-active': active }"
|
|
|
|
@click="() => onActivate()"
|
|
|
|
>
|
2023-01-07 15:52:58 +01:00
|
|
|
<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" />
|
2023-01-05 17:48:20 +01:00
|
|
|
<!-- <div v-else-if="result.type === 'action'" text-center>
|
2022-12-17 22:35:07 +01:00
|
|
|
{{ result.action!.label }}
|
2023-01-05 17:48:20 +01:00
|
|
|
</div> -->
|
2022-12-17 23:15:41 +01:00
|
|
|
</CommonScrollIntoView>
|
2022-12-17 22:35:07 +01:00
|
|
|
</template>
|