File size: 551 Bytes
f2e9a59 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | 'use client';
import { FC } from 'react';
import { ImageProps } from 'next/image';
type SafeImageProps = Omit<ImageProps, 'src'> & {
src: string;
};
const SafeImage: FC<SafeImageProps> = ({
src,
alt,
width,
height,
className,
style,
...rest
}) => {
return (
<img
src={src}
alt={alt?.toString() || ''}
width={typeof width === 'number' ? width : undefined}
height={typeof height === 'number' ? height : undefined}
className={className}
style={style}
/>
);
};
export default SafeImage;
|