elk/components/account/AccountInfo.vue

32 lines
1.3 KiB
Vue
Raw Permalink Normal View History

2022-11-13 05:34:43 +00:00
<script setup lang="ts">
2023-01-08 06:21:09 +00:00
import type { mastodon } from 'masto'
2022-11-13 05:34:43 +00:00
const { account, as = 'div' } = defineProps<{
2023-01-08 06:21:09 +00:00
account: mastodon.v1.Account
as?: string
2022-11-28 17:24:39 +00:00
hoverCard?: boolean
square?: 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">
<AccountHoverWrapper :disabled="!hoverCard" :account="account">
<AccountBigAvatar :account="account" shrink-0 :square="square" />
2022-11-28 17:24:39 +00:00
</AccountHoverWrapper>
<div flex="~ col" shrink pt-1 h-full overflow-hidden justify-center leading-none select-none>
2022-12-11 15:43:23 +00:00
<div flex="~" gap-2>
<AccountDisplayName :account="account" font-bold line-clamp-1 ws-pre-wrap break-all text-lg />
<AccountBotIndicator v-if="account.bot" text-xs />
2022-12-11 15:43:23 +00:00
</div>
<AccountHandle :account="account" text-secondary-light />
</div>
</component>
2022-11-13 05:34:43 +00:00
</template>