2019-11-15 22:10:53 +01:00
|
|
|
import React from 'react'
|
|
|
|
|
|
|
|
// https://featherstyles.com
|
2019-11-16 16:29:53 +01:00
|
|
|
// import * as Feather from 'react-feather'
|
|
|
|
import {
|
|
|
|
ArrowDownCircle,
|
|
|
|
Edit,
|
|
|
|
GitHub,
|
|
|
|
Twitter,
|
|
|
|
Rss,
|
|
|
|
Sun,
|
|
|
|
Moon,
|
|
|
|
Compass,
|
|
|
|
X,
|
|
|
|
Clipboard,
|
|
|
|
Search,
|
|
|
|
ExternalLink,
|
|
|
|
Link,
|
|
|
|
ChevronRight,
|
|
|
|
ChevronLeft
|
|
|
|
} from 'react-feather'
|
2019-11-15 22:10:53 +01:00
|
|
|
// custom icons
|
|
|
|
import { ReactComponent as Jsonfeed } from '../../images/jsonfeed.svg'
|
|
|
|
import { ReactComponent as Bitcoin } from '../../images/bitcoin.svg'
|
|
|
|
import styles from './Icon.module.scss'
|
|
|
|
|
2019-11-16 16:10:34 +01:00
|
|
|
const components: any = {
|
2019-11-16 16:29:53 +01:00
|
|
|
Download: ArrowDownCircle,
|
2019-11-16 16:10:34 +01:00
|
|
|
Jsonfeed,
|
2019-11-16 16:29:53 +01:00
|
|
|
Bitcoin,
|
|
|
|
ArrowDownCircle,
|
|
|
|
Edit,
|
|
|
|
GitHub,
|
|
|
|
Twitter,
|
|
|
|
Rss,
|
|
|
|
Sun,
|
|
|
|
Moon,
|
|
|
|
Compass,
|
|
|
|
X,
|
|
|
|
Clipboard,
|
|
|
|
Search,
|
|
|
|
ExternalLink,
|
|
|
|
Link,
|
|
|
|
ChevronRight,
|
|
|
|
ChevronLeft
|
2019-11-16 16:10:34 +01:00
|
|
|
}
|
2019-11-15 22:10:53 +01:00
|
|
|
|
2019-11-16 16:10:34 +01:00
|
|
|
const Icon = ({ name }: { name: string }) => {
|
2019-11-15 22:10:53 +01:00
|
|
|
const IconMapped = components[name]
|
2019-11-16 16:29:53 +01:00
|
|
|
// const IconFeather = (Feather as any)[name]
|
|
|
|
if (!IconMapped) return null
|
2019-11-15 22:10:53 +01:00
|
|
|
|
2019-11-16 16:29:53 +01:00
|
|
|
return <IconMapped className={styles.icon} />
|
2019-11-15 22:10:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export default Icon
|