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