jsketcher/modules/ui/components/ImgIcon.tsx
2022-06-25 15:19:48 -07:00

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} />
}