2022-12-11 19:52:36 +09:00
|
|
|
<script lang="ts" setup>
|
2022-12-14 03:44:40 +09:00
|
|
|
const { t } = useI18n()
|
|
|
|
|
2022-12-11 19:52:36 +09:00
|
|
|
// limit: 20 is the default configuration of the official client
|
2022-12-25 23:04:50 +09:00
|
|
|
const masto = useMasto()
|
2022-12-11 19:52:36 +09:00
|
|
|
const { data, pending, error } = useLazyAsyncData(
|
2023-01-08 15:21:09 +09:00
|
|
|
async () => masto.v2.suggestions.list({ limit: 20 }),
|
2022-12-11 19:52:36 +09:00
|
|
|
{ immediate: true },
|
|
|
|
)
|
2022-12-14 03:44:40 +09:00
|
|
|
|
|
|
|
useHeadFixed({
|
2022-12-28 02:49:15 +09:00
|
|
|
title: () => `${t('tab.for_you')} | ${t('nav.explore')}`,
|
2022-12-14 03:44:40 +09:00
|
|
|
})
|
2022-12-11 19:52:36 +09:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div v-if="data && data.length">
|
|
|
|
<AccountBigCard
|
|
|
|
v-for="suggestion of data"
|
|
|
|
:key="suggestion.account.id"
|
|
|
|
:account="suggestion.account"
|
|
|
|
as="router-link"
|
|
|
|
:to="getAccountRoute(suggestion.account)"
|
|
|
|
border="b base"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<div p5 text-center text-secondary-light italic>
|
|
|
|
{{ $t('common.end_of_list') }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-else-if="pending">
|
|
|
|
<AccountBigCardSkeleton border="b base" />
|
|
|
|
<AccountBigCardSkeleton border="b base" op50 />
|
|
|
|
<AccountBigCardSkeleton border="b base" op25 />
|
|
|
|
</div>
|
|
|
|
<div v-else-if="error" p5 text-center text-red italic>
|
|
|
|
{{ $t('common.error') }}: {{ error }}
|
|
|
|
</div>
|
|
|
|
<div v-else p5 text-center text-secondary italic>
|
|
|
|
{{ $t('common.not_found') }}
|
|
|
|
</div>
|
|
|
|
</template>
|