1
0
mirror of https://github.com/elk-zone/elk synced 2024-12-24 03:28:00 +09:00
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 06:01:25 +09:00
import AccountTabs from '~/components/account/AccountTabs.vue'
const params = useRoute().params
2022-11-30 16:08:10 +09:00
const handle = $(computedEager(() => params.account as string))
definePageMeta({ name: 'account-index' })
2022-12-14 06:01:25 +09:00
const { t } = useI18n()
const { data: account } = await useAsyncData(`account:${handle}`, async () => (
window.history.state?.account as Account | undefined)
2022-12-14 06:01:25 +09:00
?? await fetchAccountByHandle(handle),
)
2022-12-14 06:01:25 +09:00
const paginator = useMasto().accounts.iterateStatuses(account.value!.id, { excludeReplies: true })
2022-11-27 02:36:23 +09:00
2022-12-14 06:01:25 +09:00
if (account) {
useHeadFixed({
title: () => `${t('account.posts')} | ${getDisplayName(account.value!)} (@${account.value!.acct})`,
})
}
</script>
<template>
<div>
2022-12-14 06:01:25 +09:00
<AccountTabs />
<TimelinePaginator :paginator="paginator" context="account" />
</div>
</template>