2020-01-31 18:20:33 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { cloneElement, isValidElement } from '@wordpress/element';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
function Icon( { srcElement, size = 24, ...props } ) {
|
|
|
|
return (
|
|
|
|
isValidElement( srcElement ) &&
|
|
|
|
cloneElement( srcElement, {
|
|
|
|
width: size,
|
|
|
|
height: size,
|
|
|
|
...props,
|
|
|
|
} )
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-02-10 13:24:02 +00:00
|
|
|
Icon.propTypes = {
|
2020-02-17 16:45:27 +00:00
|
|
|
srcElement: PropTypes.element,
|
2020-01-31 18:20:33 +00:00
|
|
|
size: PropTypes.number,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Icon;
|