1
0
elk/components/account/AccountInfo.vue

29 lines
1.2 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
2022-11-23 12:48:01 +09:00
const { account, link = true, fullServer = false } = defineProps<{
2022-11-13 14:34:43 +09:00
account: Account
2022-11-21 19:16:04 +09:00
link?: boolean
2022-11-23 12:48:01 +09:00
fullServer?: boolean
2022-11-25 19:54:49 +09:00
hover?: boolean
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>
2022-11-25 23:39:15 +09:00
<div flex gap-3 cursor-default>
2022-11-26 02:16:50 +09:00
<div flex-shrink-0>
<NuxtLink :to="link ? getAccountPath(account) : null">
2022-11-25 19:54:49 +09:00
<AccountAvatar :account="account" :hover="hover" w-12 h-12 />
2022-11-14 11:20:07 +09:00
</NuxtLink>
2022-11-13 14:34:43 +09:00
</div>
<NuxtLink flex flex-col :to="link ? getAccountPath(account) : null">
<ContentRich font-bold hover:underline :content="getDisplayName(account, { rich: true })" :emojis="account.emojis" />
<AccountHandle :account="account" text-sm />
2022-11-23 09:00:52 +09:00
<slot name="bottom" />
2022-11-14 11:20:07 +09:00
</NuxtLink>
2022-11-14 11:56:48 +09:00
<slot />
2022-11-13 14:34:43 +09:00
</div>
</template>