From eb93b66c49b6e9c7a0a6d4270e92dc7b2bb99ae0 Mon Sep 17 00:00:00 2001 From: maretol Date: Mon, 13 Jan 2025 20:56:11 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=A8=E3=82=8A=E3=81=82=E3=81=88=E3=81=9A?= =?UTF-8?q?=E6=AC=A1=E3=81=AE=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=92=E8=AA=AD?= =?UTF-8?q?=E3=81=BF=E8=BE=BC=E3=82=80=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/components/small/comic_image.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pages/components/small/comic_image.tsx b/pages/components/small/comic_image.tsx index e3e7fba..178a4c3 100644 --- a/pages/components/small/comic_image.tsx +++ b/pages/components/small/comic_image.tsx @@ -3,7 +3,19 @@ import Image from 'next/image' import { PlaceholderImageBase64 } from './placeholder' -export default function ComicImage({ src, alt, className }: { src: string; alt: string; className?: string }) { +export default function ComicImage({ + src, + alt, + priority, + loading, + className, +}: { + src: string + alt: string + priority?: boolean + loading?: 'lazy' | 'eager' + className?: string +}) { const imageLoader = ({ src }: { src: string }) => { const url = 'https://www.maretol.xyz/cdn-cgi/image/#{option}/#{origin}' return url.replace('#{option}', 'format=auto').replace('#{origin}', src) @@ -15,7 +27,8 @@ export default function ComicImage({ src, alt, className }: { src: string; alt: src={src} width={500} height={1000} - priority + priority={priority} + loading={loading} alt={alt} className={className} placeholder={`data:image/png;base64,${PlaceholderImageBase64}`}