feat: hover card for content @

This commit is contained in:
Anthony Fu 2022-11-30 15:08:10 +08:00
parent 66393cd838
commit 2becb254b4
8 changed files with 61 additions and 27 deletions

View file

@ -1,17 +1,20 @@
<script setup lang="ts">
import type { Account } from 'masto'
defineProps<{
account: Account
const props = defineProps<{
account?: Account
handle?: string
disabled?: boolean
}>()
const account = props.account || (props.handle ? useAccountByHandle(props.handle!) : undefined)
</script>
<template>
<VMenu v-if="!disabled" placement="bottom-start" :delay="{ show: 500, hide: 100 }">
<VMenu v-if="!disabled && account" placement="bottom-start" :delay="{ show: 500, hide: 100 }">
<slot />
<template #popper>
<AccountHoverCard :account="account" />
<AccountHoverCard v-if="account" :account="account" />
</template>
</VMenu>
<slot v-else />

View file

@ -5,7 +5,7 @@ const { status } = defineProps<{
status: Status
}>()
const account = asyncComputed(() => fetchAccount(status.inReplyToAccountId!))
const account = useAccountById(status.inReplyToAccountId!)
</script>
<template>