Modify Shot Data Table Functions

This commit is contained in:
2026-03-05 22:12:02 +08:00
parent c8c4c99a6e
commit 1f229bff6c
26 changed files with 212 additions and 186 deletions
+5 -10
View File
@@ -34,11 +34,11 @@
<Avatar class="h-10 w-10">
<AvatarImage
v-if="user?.avatar_url"
:src="getAvatarUrl(user.avatar_url)"
:src="getAvatarUrl(user.avatar_url, user.first_name, user.last_name)"
/>
<AvatarImage
v-else
:src="`https://api.dicebear.com/7.x/initials/svg?seed=${user?.first_name} ${user?.last_name}`"
:src="getInitialsAvatarUrl(user.first_name, user.last_name)"
/>
<AvatarFallback>{{ userInitials }}</AvatarFallback>
</Avatar>
@@ -116,14 +116,9 @@ const userInitials = computed(() => {
return `${user.value.first_name.charAt(0)}${user.value.last_name.charAt(0)}`.toUpperCase()
})
const getAvatarUrl = (url: string | null | undefined) => {
if (!url) return ''
// If it's already a full URL, return it
if (url.startsWith('http')) return url
// Use direct static file serving
const cleanUrl = url.replace(/^backend[\/\\]/, '').replace(/\\/g, '/')
return `/${cleanUrl}`
}
import { useAvatarUrl } from '@/composables/useAvatarUrl'
const { getAvatarUrl } = useAvatarUrl()
// Generate breadcrumbs based on current route with enhanced context
const breadcrumbs = ref<BreadcrumbData[]>([])