mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
Backport of #8516 to `cloud/1.41` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9538-backport-cloud-1-41-feat-Integrated-tab-UI-updates-31c6d73d36508199a52cf9312ce5ad6c) by [Unito](https://www.unito.io) Co-authored-by: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: github-actions <github-actions@github.com>
28 lines
712 B
Vue
28 lines
712 B
Vue
<template>
|
|
<Avatar
|
|
class="aspect-square bg-interface-panel-selected-surface"
|
|
:image="photoUrl ?? undefined"
|
|
:icon="hasAvatar ? undefined : 'icon-[lucide--user]'"
|
|
:pt:icon:class="{ 'size-4': !hasAvatar }"
|
|
shape="circle"
|
|
:aria-label="ariaLabel ?? $t('auth.login.userAvatar')"
|
|
@error="handleImageError"
|
|
/>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import Avatar from 'primevue/avatar'
|
|
import { computed, ref } from 'vue'
|
|
|
|
const { photoUrl, ariaLabel } = defineProps<{
|
|
photoUrl?: string | null
|
|
ariaLabel?: string
|
|
}>()
|
|
|
|
const imageError = ref(false)
|
|
const handleImageError = () => {
|
|
imageError.value = true
|
|
}
|
|
const hasAvatar = computed(() => photoUrl && !imageError.value)
|
|
</script>
|