refactor: migrate img tags to next/image and fix hook usage
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
* - 点击 → 打开全屏查看器
|
||||
* - 错误占位符(broken image icon)
|
||||
*/
|
||||
import Image from "next/image";
|
||||
import { useState } from "react";
|
||||
|
||||
import { FullscreenImageViewer } from "./fullscreen-image-viewer";
|
||||
@@ -42,11 +43,12 @@ export function ImageBubble({ imageUrl }: ImageBubbleProps) {
|
||||
{error ? (
|
||||
<div className={styles.errorFallback}>🖼</div>
|
||||
) : (
|
||||
// eslint-disable-next-line @next/next/no-img-element
|
||||
<img
|
||||
<Image
|
||||
className={styles.image}
|
||||
src={src}
|
||||
alt=""
|
||||
width={240}
|
||||
height={240}
|
||||
onError={() => setError(true)}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user