/* eslint-disable react/button-has-type */
import React from 'react';
import { ButtonProps } from '../../model/interactive';

const IconButton: React.FC<ButtonProps> = ({
  title,
  altTitle,
  onClick,
  type,
  size,
  className,
  isDisabled,
  id,
  children,
}) => {
  return (
    <button
      onClick={onClick}
      id={id}
      data-testid={id}
      type={type || 'button'}
      title={altTitle || title}
      className={`iconClick ${size || 'big'} ${
        isDisabled ? ' isDisabled' : ''
      }${className || ''}`}
      disabled={isDisabled}
    >
      {children}
    </button>
  );
};

export default IconButton;
