elk/components/account/AccountInfo.vue

30 lines
842 B
Vue
Raw Normal View History

2022-11-13 13:34:43 +08:00
<script setup lang="ts">
2022-11-14 10:20:07 +08:00
import type { Account } from 'masto'
2022-11-13 13:34:43 +08:00
2022-11-23 11:48:01 +08:00
const { account, link = true, fullServer = false } = defineProps<{
2022-11-13 13:34:43 +08:00
account: Account
2022-11-21 18:16:04 +08:00
link?: boolean
2022-11-23 11:48:01 +08:00
fullServer?: boolean
2022-11-13 13:34:43 +08:00
}>()
2022-11-23 11:48:01 +08:00
const id = computed(() => fullServer && !account.acct.includes('@') ? `@${account.acct}@${account.url.match(UserLinkRE)?.[1]}` : getAccountHandle(account))
2022-11-13 13:34:43 +08:00
</script>
<template>
2022-11-23 15:46:34 +08:00
<div flex gap-3>
<div>
<NuxtLink :to="link ? getAccountPath(account) : null">
2022-11-23 15:46:34 +08:00
<AccountAvatar :account="account" w-12 h-12 />
2022-11-14 10:20:07 +08:00
</NuxtLink>
2022-11-13 13:34:43 +08:00
</div>
<NuxtLink flex flex-col :to="link ? getAccountPath(account) : null">
2022-11-24 14:18:05 +08:00
<ContentRich font-bold :content="getDisplayName(account)" :emojis="account.emojis" />
2022-11-21 14:55:31 +08:00
<p op35 text-sm>
2022-11-23 11:48:01 +08:00
{{ id }}
2022-11-13 13:34:43 +08:00
</p>
2022-11-23 08:00:52 +08:00
<slot name="bottom" />
2022-11-14 10:20:07 +08:00
</NuxtLink>
2022-11-14 10:56:48 +08:00
<slot />
2022-11-13 13:34:43 +08:00
</div>
</template>