mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-13 23:16:47 +00:00
21 lines
420 B
JavaScript
21 lines
420 B
JavaScript
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
|