2022-11-13 14:34:43 +09:00
|
|
|
<script setup lang="ts">
|
2023-01-08 15:21:09 +09:00
|
|
|
import type { mastodon } from 'masto'
|
2022-11-13 14:34:43 +09:00
|
|
|
|
2023-07-03 01:26:23 +09:00
|
|
|
defineOptions({
|
|
|
|
inheritAttrs: false,
|
|
|
|
})
|
|
|
|
|
2022-11-28 04:40:16 +09:00
|
|
|
const { account, as = 'div' } = defineProps<{
|
2023-01-08 15:21:09 +09:00
|
|
|
account: mastodon.v1.Account
|
2022-11-28 04:40:16 +09:00
|
|
|
as?: string
|
2022-11-29 02:24:39 +09:00
|
|
|
hoverCard?: boolean
|
2023-01-05 21:10:22 +09:00
|
|
|
square?: boolean
|
2022-11-13 14:34:43 +09:00
|
|
|
}>()
|
|
|
|
</script>
|
|
|
|
|
2022-11-27 09:19:45 +09:00
|
|
|
<!-- 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>
|
2024-08-14 00:45:09 +09:00
|
|
|
<component :is="as" flex items-center gap-3 v-bind="$attrs">
|
2023-01-01 19:54:17 +09:00
|
|
|
<AccountHoverWrapper :disabled="!hoverCard" :account="account">
|
2023-01-05 21:10:22 +09:00
|
|
|
<AccountBigAvatar :account="account" shrink-0 :square="square" />
|
2022-11-29 02:24:39 +09:00
|
|
|
</AccountHoverWrapper>
|
2024-08-14 00:45:09 +09:00
|
|
|
<div flex="~ col" shrink h-full overflow-hidden justify-center leading-none select-none p-1>
|
2022-12-12 00:43:23 +09:00
|
|
|
<div flex="~" gap-2>
|
2023-01-07 04:12:00 +09:00
|
|
|
<AccountDisplayName :account="account" font-bold line-clamp-1 ws-pre-wrap break-all text-lg />
|
2023-07-21 21:50:36 +09:00
|
|
|
<AccountLockIndicator v-if="account.locked" text-xs />
|
2023-01-08 23:08:11 +09:00
|
|
|
<AccountBotIndicator v-if="account.bot" text-xs />
|
2022-12-12 00:43:23 +09:00
|
|
|
</div>
|
2022-12-26 17:00:57 +09:00
|
|
|
<AccountHandle :account="account" text-secondary-light />
|
2024-08-14 00:45:09 +09:00
|
|
|
<div self-start mt-1>
|
|
|
|
<AccountRolesIndicator v-if="account.roles?.length" :account="account" :limit="1" />
|
|
|
|
</div>
|
2022-11-27 12:34:55 +09:00
|
|
|
</div>
|
2022-11-28 04:40:16 +09:00
|
|
|
</component>
|
2022-11-13 14:34:43 +09:00
|
|
|
</template>
|