1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-05 08:29:57 +00:00
elk/components/account/AccountInfo.vue

28 lines
1.1 KiB
Vue
Raw Normal View History

2022-11-13 05:34:43 +00:00
<script setup lang="ts">
2022-11-14 02:20:07 +00:00
import type { Account } from 'masto'
2022-11-13 05:34:43 +00:00
const { account, as = 'div' } = defineProps<{
2022-11-13 05:34:43 +00:00
account: Account
as?: string
2022-11-28 17:24:39 +00:00
hoverCard?: boolean
2022-11-13 05:34:43 +00:00
}>()
defineOptions({
inheritAttrs: false,
})
2022-11-13 05:34:43 +00: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 05:34:43 +00:00
<template>
<component :is="as" flex gap-3 v-bind="$attrs">
2022-11-28 17:24:39 +00:00
<AccountHoverWrapper :disabled="!hoverCard" :account="account">
<AccountAvatar :account="account" w-12 h-12 />
</AccountHoverWrapper>
<div flex="~ col">
2022-11-27 03:54:46 +00:00
<ContentRich font-bold :content="getDisplayName(account, { rich: true })" :emojis="account.emojis" />
<AccountHandle :account="account" text-sm />
</div>
</component>
2022-11-13 05:34:43 +00:00
</template>