File size: 420 Bytes
1b72d7e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import LazyImage from './LazyImage'
/**
* notion的图标icon
* 可能是emoji 可能是 svg 也可能是 图片
* @returns
*/
const NotionIcon = ({ icon }) => {
if (!icon) {
return <></>
}
if (icon.startsWith('http') || icon.startsWith('data:')) {
return <LazyImage src={icon} className='w-8 h-8 my-auto inline mr-1'/>
}
return <span className='mr-1'>{icon}</span>
}
export default NotionIcon
|