24 lines
512 B
TypeScript
24 lines
512 B
TypeScript
import React, { ImgHTMLAttributes } from 'react';
|
|
|
|
interface ImageProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
src: string;
|
|
alt: string;
|
|
width?: number;
|
|
height?: number;
|
|
className?: string;
|
|
}
|
|
|
|
export function Image({ src, alt, width, height, className = '', ...props }: ImageProps) {
|
|
return (
|
|
// eslint-disable-next-line @next/next/no-img-element
|
|
<img
|
|
src={src}
|
|
alt={alt}
|
|
width={width}
|
|
height={height}
|
|
className={className}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|