/** * Icon: abstract icon class that can render icons from multiple sets. * @module soapbox/components/icon * @see soapbox/components/fork_awesome_icon * @see soapbox/components/svg_icon */ import React from 'react'; import ForkAwesomeIcon, { IForkAwesomeIcon } from './fork-awesome-icon'; import SvgIcon, { ISvgIcon } from './svg-icon'; export type IIcon = IForkAwesomeIcon | ISvgIcon; const Icon: React.FC = (props) => { if ((props as ISvgIcon).src) { const { src, ...rest } = (props as ISvgIcon); return ; } else { const { id, fixedWidth, ...rest } = (props as IForkAwesomeIcon); return ; } }; export default Icon;