refactor: migrate img tags to next/image and fix hook usage

This commit is contained in:
2026-06-10 19:16:41 +08:00
parent 47591be41c
commit 2bc2e1b691
30 changed files with 62 additions and 55 deletions
+4 -2
View File
@@ -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)}
/>
)}