mirror of
https://github.com/elk-zone/elk
synced 2024-12-12 21:58:05 +09:00
27 lines
725 B
Vue
27 lines
725 B
Vue
<script setup lang="ts">
|
|
import type { mastodon } from 'masto'
|
|
|
|
const props = defineProps<{
|
|
account?: mastodon.v1.Account
|
|
handle?: string
|
|
disabled?: boolean
|
|
}>()
|
|
|
|
const account = props.account || (props.handle ? useAccountByHandle(props.handle!) : undefined)
|
|
const userSettings = useUserSettings()
|
|
|
|
defineOptions({
|
|
inheritAttrs: false,
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<VMenu v-if="!disabled && account && !getPreferences(userSettings, 'hideAccountHoverCard')" placement="bottom-start" :delay="{ show: 500, hide: 100 }" v-bind="$attrs" :close-on-content-click="false">
|
|
<slot />
|
|
<template #popper>
|
|
<AccountHoverCard v-if="account" :account="account" />
|
|
</template>
|
|
</VMenu>
|
|
<slot v-else />
|
|
</template>
|