({ width, height, alt, src, ...props })
| 4 | import type { FC } from 'react'; |
| 5 | |
| 6 | const MDXImage: FC<ImageProps> = ({ width, height, alt, src, ...props }) => { |
| 7 | if (!width || !height) { |
| 8 | // Since `width` and `height` are not provided in the Markdown image format, |
| 9 | // we provide the height and width automatically. |
| 10 | // @see https://nextjs.org/docs/pages/building-your-application/optimizing/images |
| 11 | return ( |
| 12 | <Image |
| 13 | {...props} |
| 14 | src={src} |
| 15 | alt={alt} |
| 16 | width={0} |
| 17 | height={0} |
| 18 | sizes="(min-width: 768px) 200vw, 500vw" |
| 19 | className="h-auto w-auto" |
| 20 | /> |
| 21 | ); |
| 22 | } |
| 23 | |
| 24 | return <Image {...props} alt={alt} width={width} height={height} src={src} />; |
| 25 | }; |
| 26 | |
| 27 | export default MDXImage; |
nothing calls this directly
no outgoing calls
no test coverage detected