1
0
elk/pages/@[account]/index.vue

33 lines
904 B
Vue
Raw Normal View History

2022-11-14 01:05:32 +09:00
<script setup lang="ts">
const props = defineProps<{
modelValue?: boolean
}>()
const params = useRoute().params
2022-11-24 14:47:14 +09:00
const accountName = $computed(() => params.account as string)
2022-11-24 14:47:14 +09:00
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')
const paginator = $computed(() => {
2022-11-24 14:49:50 +09:00
return masto.accounts.getStatusesIterable(account.id, { excludeReplies: tab === 'Posts' } as any)
})
2022-11-14 01:05:32 +09:00
</script>
<template>
2022-11-24 02:16:10 +09:00
<template v-if="account">
<div>
<AccountHeader :account="account" />
</div>
<CommonTabs v-model="tab" :options="tabNames" />
<TimelinePaginator :key="tab" :paginator="paginator" />
</template>
<CommonNotFound v-else>
Account @{{ params.user }} not found
</CommonNotFound>
2022-11-14 01:05:32 +09:00
</template>