mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-15 16:51:37 +00:00
26 lines
514 B
TypeScript
26 lines
514 B
TypeScript
import classNames from 'classnames';
|
|
import NextImage, { ImageProps } from 'next/future/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;
|