mirror of
https://github.com/elk-zone/elk.git
synced 2024-09-07 04:39:10 +01:00
28 lines
815 B
Vue
28 lines
815 B
Vue
<script setup lang="ts">
|
|
const props = defineProps<{
|
|
modelValue?: boolean
|
|
}>()
|
|
|
|
const params = useRoute().params
|
|
const user = $computed(() => params.user as string)
|
|
|
|
const { data: account } = await useAsyncData(`${user}:info`, () => masto.accounts.lookup({ acct: user }))
|
|
|
|
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(() => {
|
|
return masto.accounts.getStatusesIterable(account.value!.id!, { excludeReplies: tab === 'Posts' } as any)
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<div>
|
|
<AccountHeader :account="account" />
|
|
</div>
|
|
<CommonTabs v-model="tab" :options="tabNames" />
|
|
<TimelinePaginator :key="tab" :paginator="paginator" />
|
|
</template>
|