mirror of
https://github.com/ershisan99/www.git
synced 2025-12-17 12:34:17 +00:00
fix avatars
This commit is contained in:
@@ -28,12 +28,15 @@ function AvatarImage({
|
||||
...props
|
||||
}: React.ComponentProps<typeof AvatarPrimitive.Image>) {
|
||||
const isDev = process.env.NODE_ENV === 'development'
|
||||
|
||||
let finalSrc = src
|
||||
if (src?.startsWith('/') && !isDev) {
|
||||
finalSrc = `${CDN_URL}${src}`
|
||||
}
|
||||
return (
|
||||
<AvatarPrimitive.Image
|
||||
data-slot='avatar-image'
|
||||
className={cn('aspect-square size-full object-cover!', className)}
|
||||
src={isDev ? src : `${CDN_URL}${src}`}
|
||||
src={finalSrc}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user