elk/pages/[[server]]/@[account]/index/index.vue

32 lines
855 B
Vue
Raw Normal View History

<script setup lang="ts">
import type { Account } from 'masto'
2022-12-14 00:01:25 +03:00
import AccountTabs from '~/components/account/AccountTabs.vue'
const params = useRoute().params
2022-11-30 10:08:10 +03:00
const handle = $(computedEager(() => params.account as string))
definePageMeta({ name: 'account-index' })
2022-12-14 00:01:25 +03:00
const { t } = useI18n()
const { data: account } = await useAsyncData(`account:${handle}`, async () => (
window.history.state?.account as Account | undefined)
2022-12-14 00:01:25 +03:00
?? await fetchAccountByHandle(handle),
)
2022-12-14 00:01:25 +03:00
const paginator = useMasto().accounts.iterateStatuses(account.value!.id, { excludeReplies: true })
2022-11-26 20:36:23 +03:00
2022-12-14 00:01:25 +03:00
if (account) {
useHeadFixed({
title: () => `${t('account.posts')} | ${getDisplayName(account.value!)} (@${account.value!.acct})`,
})
}
</script>
<template>
<div>
2022-12-14 00:01:25 +03:00
<AccountTabs />
<TimelinePaginator :paginator="paginator" context="account" />
</div>
</template>