import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import React from 'react';

/**
 * Buttons come in various styles and inherit
 * all properties of a standard html button.
 */
var Button = function Button(props) {
  var primary = props.primary,
      secondary = props.secondary,
      highlight = props.highlight,
      standout = props.standout,
      isActive = props.isActive,
      text = props.text,
      type = props.type,
      className = props.className,
      component = props.component,
      rest = _objectWithoutProperties(props, ["primary", "secondary", "highlight", "standout", "isActive", "text", "type", "className", "component"]);

  var btnStyle = 'default';

  if (primary) {
    btnStyle = 'primary';
  } else if (secondary) {
    btnStyle = 'secondary';
  } else if (highlight) {
    btnStyle = 'highlight';
  } else if (standout) {
    btnStyle = 'standout';
  }

  var activeClass = isActive ? 'active' : '';
  var btnClass = "btn btn-".concat(btnStyle, " ").concat(className, " ").concat(activeClass);
  var C = component; // eslint-disable-next-line react/button-has-type

  return React.createElement(C, Object.assign({
    type: type,
    className: btnClass
  }, rest), text);
};

Button.defaultProps = {
  primary: false,
  secondary: false,
  highlight: false,
  standout: false,
  isActive: false,
  type: 'button',
  className: '',
  component: 'button'
};
export default Button;