Files
DefectingCat.github.io/components/mdx/Image.tsx
DefectingCat d42e9a63e7 Remove comment
2022-11-01 14:06:44 +08:00

26 lines
507 B
TypeScript

import classNames from 'classnames';
import NextImage, { ImageProps } from 'next/image';
interface Props extends ImageProps {}
const Image = ({ alt, ...rest }: Props) => {
return (
<>
<NextImage className="mx-auto" alt={alt} {...rest} />
{alt && (
<span
className={classNames(
'block mx-auto',
'text-center text-gray-400',
'my-2'
)}
>
{alt}
</span>
)}
</>
);
};
export default Image;