2022-11-25 23:49:56 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
const params = useRoute().params
|
|
|
|
const accountName = $computed(() => params.account as string)
|
|
|
|
|
|
|
|
const account = await fetchAccountByName(accountName)
|
|
|
|
const tabNames = ['Posts', 'Posts and replies'] as const
|
|
|
|
|
|
|
|
// Don't use local storage because it is better to default to Posts every time you visit a user's profile.
|
|
|
|
const tab = $ref('Posts')
|
|
|
|
|
2022-11-26 15:42:58 +00:00
|
|
|
const paginatorPosts = useMasto().accounts.getStatusesIterable(account.id, { excludeReplies: true })
|
|
|
|
const paginatorPostsWithReply = useMasto().accounts.getStatusesIterable(account.id, { excludeReplies: false })
|
2022-11-25 23:49:56 +00:00
|
|
|
|
|
|
|
const paginator = $computed(() => {
|
|
|
|
return tab === 'Posts' ? paginatorPosts : paginatorPostsWithReply
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<CommonTabs v-model="tab" :options="tabNames" />
|
|
|
|
<KeepAlive>
|
|
|
|
<TimelinePaginator :key="tab" :paginator="paginator" />
|
|
|
|
</KeepAlive>
|
|
|
|
</div>
|
|
|
|
</template>
|