2021-05-23 13:00:15 +02:00
|
|
|
import React, { FunctionComponent, ReactElement } from 'react'
|
2019-11-15 22:10:53 +01:00
|
|
|
// https://featherstyles.com
|
2022-05-08 14:49:18 +02:00
|
|
|
// import * as Feather from '@kremalicious/react-feather'
|
2019-11-16 16:29:53 +01:00
|
|
|
import {
|
2023-01-29 22:58:19 +01:00
|
|
|
Aperture,
|
2019-11-16 16:29:53 +01:00
|
|
|
ArrowDownCircle,
|
2023-01-29 22:58:19 +01:00
|
|
|
Camera,
|
|
|
|
ChevronLeft,
|
|
|
|
ChevronRight,
|
2019-11-16 16:29:53 +01:00
|
|
|
Compass,
|
2019-11-17 14:18:49 +01:00
|
|
|
Copy,
|
2023-01-29 22:58:19 +01:00
|
|
|
Crosshair,
|
|
|
|
Edit,
|
2019-11-16 16:29:53 +01:00
|
|
|
ExternalLink,
|
2023-01-29 22:58:19 +01:00
|
|
|
GitHub,
|
2019-11-16 16:29:53 +01:00
|
|
|
Link,
|
2019-11-17 14:18:49 +01:00
|
|
|
Maximize,
|
2023-01-29 22:58:19 +01:00
|
|
|
Moon,
|
|
|
|
Rss,
|
|
|
|
Search,
|
|
|
|
Sun,
|
|
|
|
Twitter,
|
|
|
|
X
|
2022-12-25 16:16:25 +01:00
|
|
|
} from 'react-feather'
|
2023-01-29 22:58:19 +01:00
|
|
|
import { ReactComponent as Bitcoin } from '../../images/bitcoin.svg'
|
2019-11-15 22:10:53 +01:00
|
|
|
// custom icons
|
|
|
|
import { ReactComponent as Jsonfeed } from '../../images/jsonfeed.svg'
|
2023-01-26 19:36:45 +01:00
|
|
|
import { ReactComponent as Mastodon } from '../../images/mastodon.svg'
|
2023-01-29 22:58:19 +01:00
|
|
|
import { ReactComponent as Stopwatch } from '../../images/stopwatch.svg'
|
2022-11-11 03:31:54 +01:00
|
|
|
import * as styles from './Icon.module.css'
|
2019-11-15 22:10:53 +01:00
|
|
|
|
2021-05-23 13:00:15 +02:00
|
|
|
const components: {
|
|
|
|
[key: string]: FunctionComponent<React.SVGProps<SVGSVGElement>>
|
|
|
|
} = {
|
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,
|
2019-11-17 14:18:49 +01:00
|
|
|
Stopwatch,
|
2019-11-16 16:29:53 +01:00
|
|
|
ArrowDownCircle,
|
|
|
|
Edit,
|
|
|
|
GitHub,
|
|
|
|
Twitter,
|
|
|
|
Rss,
|
|
|
|
Sun,
|
|
|
|
Moon,
|
|
|
|
Compass,
|
|
|
|
X,
|
2019-11-17 14:18:49 +01:00
|
|
|
Copy,
|
2019-11-16 16:29:53 +01:00
|
|
|
Search,
|
|
|
|
ExternalLink,
|
|
|
|
Link,
|
|
|
|
ChevronRight,
|
2019-11-17 14:18:49 +01:00
|
|
|
ChevronLeft,
|
|
|
|
Camera,
|
|
|
|
Aperture,
|
|
|
|
Maximize,
|
2023-01-26 19:36:45 +01:00
|
|
|
Crosshair,
|
|
|
|
Mastodon
|
2019-11-16 16:10:34 +01:00
|
|
|
}
|
2019-11-15 22:10:53 +01:00
|
|
|
|
2021-03-14 01:34:04 +01:00
|
|
|
const Icon = ({ name, ...props }: { name: string }): ReactElement => {
|
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
|
|
|
|
2022-11-11 03:31:54 +01:00
|
|
|
return <IconMapped className={styles.icon} {...props} />
|
2019-11-15 22:10:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export default Icon
|