fix: skip rendering img element when src is empty in image preview dialog
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -42,13 +42,15 @@ function ImagePreviewDialog({
|
|||||||
>
|
>
|
||||||
<X className="h-5 w-5" />
|
<X className="h-5 w-5" />
|
||||||
</button>
|
</button>
|
||||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
{src && (
|
||||||
<img
|
/* eslint-disable-next-line @next/next/no-img-element */
|
||||||
src={src}
|
<img
|
||||||
alt={alt}
|
src={src}
|
||||||
onClick={(e) => e.stopPropagation()}
|
alt={alt}
|
||||||
className="max-h-[90vh] max-w-[90vw] rounded-lg object-contain"
|
onClick={(e) => e.stopPropagation()}
|
||||||
/>
|
className="max-h-[90vh] max-w-[90vw] rounded-lg object-contain"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</DialogPrimitive.Content>
|
</DialogPrimitive.Content>
|
||||||
</DialogPrimitive.Portal>
|
</DialogPrimitive.Portal>
|
||||||
</DialogPrimitive.Root>
|
</DialogPrimitive.Root>
|
||||||
|
|||||||
Reference in New Issue
Block a user