Some checks failed
Build Containers / build-containers-common (push) Has been cancelled
Build / build (22.12.0) (push) Has been cancelled
Build Containers / build-containers (amd64, ubuntu-latest) (push) Has been cancelled
Build Containers / build-containers (arm64, ubuntu-24.04-arm) (push) Has been cancelled
Build Containers / build-container-manifest (push) Has been cancelled
31 lines
551 B
TypeScript
31 lines
551 B
TypeScript
'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;
|