2022-11-13 16:05:32 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
const props = defineProps<{
|
|
|
|
modelValue?: boolean
|
|
|
|
}>()
|
|
|
|
|
|
|
|
const params = useRoute().params
|
2022-11-15 12:08:49 +00:00
|
|
|
const user = $computed(() => params.user as string)
|
2022-11-22 23:08:36 +00:00
|
|
|
|
2022-11-15 12:08:49 +00:00
|
|
|
const { data: account } = await useAsyncData(`${user}:info`, () => masto.accounts.lookup({ acct: user }))
|
2022-11-20 21:38:52 +00:00
|
|
|
|
|
|
|
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')
|
|
|
|
|
|
|
|
const paginator = $computed(() => {
|
2022-11-21 08:07:20 +00:00
|
|
|
return masto.accounts.getStatusesIterable(account.value!.id!, { excludeReplies: tab === 'Posts' } as any)
|
2022-11-20 21:38:52 +00:00
|
|
|
})
|
2022-11-13 16:05:32 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div>
|
2022-11-15 03:26:52 +00:00
|
|
|
<AccountHeader :account="account" />
|
2022-11-13 16:05:32 +00:00
|
|
|
</div>
|
2022-11-20 21:38:52 +00:00
|
|
|
<CommonTabs v-model="tab" :options="tabNames" />
|
|
|
|
<TimelinePaginator :key="tab" :paginator="paginator" />
|
2022-11-13 16:05:32 +00:00
|
|
|
</template>
|