import { Text } from "@tarojs/components";
import './index.scss'

export default function NamedIcon(props) {
  // const bg = `require('../../assets/${props.name}.png')`
  const bg = `background: url(../../assets/${props.name}.png); background-size:cover;`
  const size = props.size || 48
  const bound = `width: ${size}rpx; height: ${size}rpx;`

  // return <Text><Image src={bg}></Image><Text className="namedicon" style={`${bg} ${bound}`}></Text></Text> 
  return <Text className="namedicon" style={`${bg} ${bound}`}></Text>
}
