import * as React from 'react' ; import classnames from 'classnames' ; import * as styles from './withIconSvg.scss' ; /**
 * Note: need to export to avoid error in Icons namespace.
 */ export interface IconSvgProps { className ? : string ; key ? : string | number ; height ? : number ; id ? : string ; style ? : object ; width ? : number ; } export interface IconSvgStoryMetaAdditionalProps { propName : string ; type : 'select' ; options : any [ ] ; default : any ; } /**
 * Typing for icon meta data used for Storybook.
 */ export interface IconSvgStoryMeta { additionalProps ? : IconSvgStoryMetaAdditionalProps [ ] ; tags : string [ ] ; } param IconComponent param neutralFill const _withIconSvg = < P extends object > ( IconComponent , neutralFill ) : React . FC < P & IconSvgProps > => ( { ... props } ) => { const { className , id , key , style , ... otherProps } = props ; const render = ( < IconComponent className = { classnames ( styles . IconSvg , 'IconSvg' , className , { [ styles . IconSvg__neutralizeFill ] : neutralFill , } ) } id = { id } key = { key } style = { style } { ... otherProps as P } />); return render ; } ; param IconComponent param neutralFill param meta const withIconSvg = < P extends object > ( IconComponent , neutralFill , meta ) : React . FC < P & IconSvgProps > => { const HocComponent = _withIconSvg ( IconComponent , neutralFill ) ; HocComponent . meta = meta ; return HocComponent as any ; } ; export default withIconSvg ;