Skip to content

Commit 75c18d1

Browse files
committed
fix image
1 parent fa9dd2a commit 75c18d1

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/components/atoms/FallbackImgImage.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import React from "react";
2-
import Image, { ImageProps, StaticImageData } from "next/image";
2+
import { ImageProps } from "next/image";
33
import styled, { css } from "styled-components";
4-
import { StaticImport } from "next/dist/shared/lib/get-img-props";
54

65
interface FallbackImgImageProps extends ImageProps {
7-
fallbackSrc: StaticImageData | string;
6+
fallbackSrc: string;
87
alt: string;
98
sizes?: string;
109
rounded?: boolean;
1110
isShouldHide?: boolean;
11+
src: string;
1212
}
1313

1414
const FallbackImgImage = ({
@@ -20,12 +20,10 @@ const FallbackImgImage = ({
2020
rounded,
2121
...props
2222
}: FallbackImgImageProps) => {
23-
const [imgSrc, setImgSrc] = React.useState<
24-
StaticImageData | StaticImport | string
25-
>("");
23+
const [imgSrc, setImgSrc] = React.useState<string>("");
2624

2725
React.useEffect(() => {
28-
setImgSrc(src ?? "/");
26+
setImgSrc(src);
2927
}, [src]);
3028

3129
return (

0 commit comments

Comments
 (0)