From 75c18d1eac1bc9c38f831452430a33916388888e Mon Sep 17 00:00:00 2001 From: Ubinquitous Date: Tue, 5 Mar 2024 09:53:24 +0900 Subject: [PATCH] fix image --- src/components/atoms/FallbackImgImage.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/atoms/FallbackImgImage.tsx b/src/components/atoms/FallbackImgImage.tsx index f5ec3aac..5e16d708 100644 --- a/src/components/atoms/FallbackImgImage.tsx +++ b/src/components/atoms/FallbackImgImage.tsx @@ -1,14 +1,14 @@ import React from "react"; -import Image, { ImageProps, StaticImageData } from "next/image"; +import { ImageProps } from "next/image"; import styled, { css } from "styled-components"; -import { StaticImport } from "next/dist/shared/lib/get-img-props"; interface FallbackImgImageProps extends ImageProps { - fallbackSrc: StaticImageData | string; + fallbackSrc: string; alt: string; sizes?: string; rounded?: boolean; isShouldHide?: boolean; + src: string; } const FallbackImgImage = ({ @@ -20,12 +20,10 @@ const FallbackImgImage = ({ rounded, ...props }: FallbackImgImageProps) => { - const [imgSrc, setImgSrc] = React.useState< - StaticImageData | StaticImport | string - >(""); + const [imgSrc, setImgSrc] = React.useState(""); React.useEffect(() => { - setImgSrc(src ?? "/"); + setImgSrc(src); }, [src]); return (