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