feat(components/system): implement Image

This commit is contained in:
Walid 2023-04-23 20:13:52 +01:00
parent 3ae150f448
commit 1272b00014
Signed by: Walidoux
GPG Key ID: CCF21881FE8BEBAF
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,19 @@
import classNames from 'classnames'
interface ImageProps extends React.ComponentPropsWithoutRef<'img'> {
size?: number
icon?: boolean
}
export const Image: React.FC<ImageProps> = ({ size, icon, ...rest }) => {
return (
<img
{...rest}
draggable={false}
style={{ imageRendering: Boolean(icon) ? 'pixelated' : 'unset' }}
className={classNames(rest.className, 'select-none')}
height={size ?? rest.height}
width={size ?? rest.width}
/>
)
}

View File

@ -0,0 +1 @@
export * from './Image'