File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
- import Image , { ImageProps , StaticImageData } from "next/image" ;
2
+ import { ImageProps } from "next/image" ;
3
3
import styled , { css } from "styled-components" ;
4
- import { StaticImport } from "next/dist/shared/lib/get-img-props" ;
5
4
6
5
interface FallbackImgImageProps extends ImageProps {
7
- fallbackSrc : StaticImageData | string ;
6
+ fallbackSrc : string ;
8
7
alt : string ;
9
8
sizes ?: string ;
10
9
rounded ?: boolean ;
11
10
isShouldHide ?: boolean ;
11
+ src : string ;
12
12
}
13
13
14
14
const FallbackImgImage = ( {
@@ -20,12 +20,10 @@ const FallbackImgImage = ({
20
20
rounded,
21
21
...props
22
22
} : FallbackImgImageProps ) => {
23
- const [ imgSrc , setImgSrc ] = React . useState <
24
- StaticImageData | StaticImport | string
25
- > ( "" ) ;
23
+ const [ imgSrc , setImgSrc ] = React . useState < string > ( "" ) ;
26
24
27
25
React . useEffect ( ( ) => {
28
- setImgSrc ( src ?? "/" ) ;
26
+ setImgSrc ( src ) ;
29
27
} , [ src ] ) ;
30
28
31
29
return (
You can’t perform that action at this time.
0 commit comments