mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 16:33:15 +01:00
18 lines
No EOL
481 B
TypeScript
18 lines
No EOL
481 B
TypeScript
import React from 'react';
|
|
|
|
type ImgIconParams = { url: string; size: string|number; style?: any; };
|
|
|
|
export default function ImgIcon(inprops: ImgIconParams) {
|
|
|
|
const {url, size, style, ...props} = inprops;
|
|
|
|
return <span className='img-icon' style={{
|
|
display: 'inline-block',
|
|
backgroundImage: 'url('+url+')',
|
|
backgroundRepeat: 'no-repeat',
|
|
backgroundSize: `${size}px ${size}px`,
|
|
width: size + 'px',
|
|
height: size + 'px',
|
|
...style
|
|
}} {...props} />
|
|
} |