import * as React from 'react' ; import Icon from '../Icon' ; import styles from './IconButton.module.scss' ; interface Props { icon : string ; onClick ? : ( event : React . MouseEvent | Event ) => void ; size ? : 's' | 'm' | 'l' | 'xl' ; } const IconButton = props => { const { icon , onClick } = props ; const size = props . size ?? 'm' ; return ( < div className = { styles [ 'icon-button' ] } onClick = { onClick } > < Icon name = { icon } size = { size } / > < /div>); } ; export default IconButton ;