create custom re-usable image

This commit is contained in:
MathieuG-P
2022-06-19 21:48:46 +02:00
parent e9e4dc7b72
commit b0e58c74dc
@@ -0,0 +1,6 @@
export function BsmImage({className, image, errorImage, loading}: {className?: string, image: string, errorImage?: string, loading?: "lazy"|"eager"}) {
return (
<img className={className} src={image} loading={loading} onError={({currentTarget}) => { currentTarget.onerror = null; currentTarget.src = errorImage ? errorImage : "" }}/>
)
}