1
0
elk/components/account/AccountInfo.vue

35 lines
1.3 KiB
Vue
Raw Normal View History

2022-11-13 14:34:43 +09:00
<script setup lang="ts">
2022-11-14 11:20:07 +09:00
import type { Account } from 'masto'
2022-11-13 14:34:43 +09:00
const { account, as = 'div' } = defineProps<{
2022-11-13 14:34:43 +09:00
account: Account
as?: string
2022-11-29 02:24:39 +09:00
hoverCard?: boolean
2022-11-13 14:34:43 +09:00
}>()
defineOptions({
inheritAttrs: false,
})
2022-11-13 14:34:43 +09:00
</script>
<!-- TODO: Make this work for both buttons and links -->
<!-- This is sometimes (like in the sidebar) used directly as a button, and sometimes, like in follow notifications, as a link. I think this component may need a second refactor that either lets an implementation pass in a link or an action and adapt to what's passed in, or the implementations need to be updated to wrap in the action they want to take and this be just the layout for these items -->
2022-11-13 14:34:43 +09:00
<template>
<component :is="as" flex gap-3 v-bind="$attrs">
<AccountHoverWrapper :disabled="!hoverCard" :account="account">
<AccountBigAvatar :account="account" shrink-0 />
2022-11-29 02:24:39 +09:00
</AccountHoverWrapper>
<div flex="~ col" shrink overflow-hidden justify-center leading-none>
2022-12-12 00:43:23 +09:00
<div flex="~" gap-2>
<ContentRich
font-bold line-clamp-1 ws-pre-wrap break-all text-lg
2022-12-12 00:43:23 +09:00
:content="getDisplayName(account, { rich: true })"
:emojis="account.emojis"
/>
<AccountBotIndicator v-if="account.bot" />
</div>
<AccountHandle :account="account" text-secondary-light />
</div>
</component>
2022-11-13 14:34:43 +09:00
</template>