import React, { CSSProperties } from 'react'; import { IconDefinition } from '@fortawesome/fontawesome-svg-core'; import tw from 'twin.macro'; interface Props { icon: IconDefinition; className?: string; style?: CSSProperties; } const Icon = ({ icon, className, style }: Props) => { let [ width, height, , , paths ] = icon.icon; paths = Array.isArray(paths) ? paths : [ paths ]; return ( {paths.map((path, index) => ( ))} ); }; export default Icon;