♻️ enhan: add prop blurDataURL to component ImgWithLink

:%s
This commit is contained in:
lytrankieio123
2021-09-14 14:36:54 +07:00
parent 208ddd146f
commit df47b3a6f4

View File

@@ -6,16 +6,17 @@ import { BLUR_DATA_IMG } from 'src/utils/constanst.utils'
export interface ImgWithLinkProps { export interface ImgWithLinkProps {
src: string, src: string,
alt?: string, alt?: string,
blurDataURL?: string,
} }
const ImgWithLink = ({ src, alt }: ImgWithLinkProps) => { const ImgWithLink = ({ src, alt, blurDataURL = BLUR_DATA_IMG }: ImgWithLinkProps) => {
return ( return (
<div className={s.imgWithLink}> <div className={s.imgWithLink}>
<Image src={src} alt={alt} <Image src={src} alt={alt}
layout="fill" layout="fill"
className={s.imgWithLink} className={s.imgWithLink}
placeholder="blur" placeholder="blur"
blurDataURL={BLUR_DATA_IMG} blurDataURL={blurDataURL}
/> />
</div> </div>
) )