Files
docs.addonsejoli.pro/components/markdown/ImageMdx.tsx
Wildan Nursahidan 3f6a407a30 docu v 1.11.0
2025-05-26 22:28:27 +07:00

26 lines
510 B
TypeScript

import { ComponentProps } from "react";
import NextImage from "next/image";
type Height = ComponentProps<typeof NextImage>["height"];
type Width = ComponentProps<typeof NextImage>["width"];
export default function Image({
src,
alt = "alt",
width = 800,
height = 350,
...props
}: ComponentProps<"img">) {
if (!src) return null;
return (
<NextImage
src={src}
alt={alt}
width={width as Width}
height={height as Height}
quality={40}
{...props}
/>
);
}