import React from 'react' ; import classnames from 'classnames' ; import { cssClasses } from './constants' ; export interface IconProps < T > extends React . HTMLProps < T > { actionItem ? : boolean ; className ? : string ; children : React . ReactElement < any > ; navIcon ? : boolean ; } const Icon = ( { actionItem = false , navIcon = false , className , children , ... otherProps } ) => React . cloneElement ( children , { ... otherProps , className : classnames ( className , children . props . className , { [ cssClasses . ACTION_ITEM ] : actionItem , [ cssClasses . NAV_ICON ] : navIcon , } ) , } ) ; export default Icon ;