feat(components/system): implement Image
This commit is contained in:
parent
3ae150f448
commit
1272b00014
19
src/components/system/Image/Image.tsx
Normal file
19
src/components/system/Image/Image.tsx
Normal 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}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
1
src/components/system/Image/index.ts
Normal file
1
src/components/system/Image/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export * from './Image'
|
Loading…
Reference in New Issue
Block a user