feat: 调整resource为服务端渲染

This commit is contained in:
2025-12-12 18:08:49 +08:00
parent 90f080e9b1
commit 14137c5472
7 changed files with 70 additions and 34 deletions

View File

@@ -0,0 +1,26 @@
'use client';
import React from "react";
import Image from "next/image";
interface ResourceCardImage {
imageUrl: string;
}
export default function ResourceCardImage({ imageUrl }: ResourceCardImage) {
const [imageError, setImageError] = React.useState(false);
return (
<>
{!imageError && <Image
src={imageUrl}
alt="资源图片"
width={90}
height={90}
className="rounded-md shadow"
priority
quality={80}
onError={() => setImageError(true)}
/>}
</>
)
}