import React from 'react';
import PropTypes from 'prop-types';

import '../styles/button.css'

export const IconButton = ({ icon, ...props}) => {

    return (
        <button
            type="button"
            className='minimal icon-button'
            {...props}
        >
            {icon}
        </button>
    );
}

IconButton.propTypes = {
    icon: PropTypes.node,
    /**
     * Optional click handler
     */
    onClick: PropTypes.func,
};

IconButton.defaultProps = {
    icon: <div></div>,
    onClick: undefined,
};