1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-09 18:39:58 +00:00
elk/components/account/AccountHoverWrapper.vue

25 lines
615 B
Vue
Raw Normal View History

2022-11-27 02:13:18 +00:00
<script setup lang="ts">
import type { Account } from 'masto'
2022-11-30 07:08:10 +00:00
const props = defineProps<{
account?: Account
handle?: string
2022-11-28 17:24:39 +00:00
disabled?: boolean
2022-11-27 02:13:18 +00:00
}>()
2022-11-30 07:08:10 +00:00
const account = props.account || (props.handle ? useAccountByHandle(props.handle!) : undefined)
2022-11-30 09:49:07 +00:00
defineOptions({
inheritAttrs: false,
})
2022-11-27 02:13:18 +00:00
</script>
<template>
<VMenu v-if="!disabled && account" placement="bottom-start" :delay="{ show: 500, hide: 100 }" v-bind="$attrs" :close-on-content-click="false">
2022-11-27 02:13:18 +00:00
<slot />
<template #popper>
2022-11-30 07:08:10 +00:00
<AccountHoverCard v-if="account" :account="account" />
2022-11-27 02:13:18 +00:00
</template>
</VMenu>
2022-11-28 17:24:39 +00:00
<slot v-else />
2022-11-27 02:13:18 +00:00
</template>