elk/pages/@[account].vue

26 lines
584 B
Vue
Raw Normal View History

2022-11-24 07:18:05 +01:00
<script setup lang="ts">
const params = useRoute().params
2022-11-25 18:50:03 +01:00
const accountName = $computed(() => toShortHandle(params.account as string))
2022-11-24 07:18:05 +01:00
2022-11-25 10:50:49 +01:00
const account = await fetchAccountByName(accountName).catch(() => null)
2022-11-25 12:48:48 +01:00
if (account) {
useHead({
title: `${account.displayName} (@${account.acct})`,
})
}
2022-11-24 07:18:05 +01:00
</script>
<template>
<MainContent>
<template v-if="account">
<AccountHeader :account="account" border="b base" />
<NuxtPage />
</template>
<CommonNotFound v-else>
2022-11-25 10:50:49 +01:00
Account @{{ accountName }} not found
2022-11-24 07:18:05 +01:00
</CommonNotFound>
</MainContent>
</template>