import React from 'react'; import { IconWrapper, ClickZone } from './styled'; import data from './data'; type Props = { id?: string; glyph: string; onClick?: (e: any) => void; onBlur?: () => void; style?: {}; isActive?: boolean; isDisabled?: boolean; }; const Icon: React.FC = ({ glyph, id = '', onClick, onBlur, style, isActive = false, isDisabled = false, }: Props) => { const { Normal, Hover } = data[glyph]; return ( {Normal && } {Hover && } {isActive && Hover ? : null} { // do something } : onClick } onBlur={onBlur} /> ); }; export default Icon;