"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _react = _interopRequireDefault(require("react"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const AddPlaceButton = ({
  from,
  intermediatePlaces,
  onClick,
  to
}) => {
  // Only permit adding intermediate place if from/to is defined.
  const maxPlacesDefined = intermediatePlaces.length >= 3;
  const disabled = !from || !to || maxPlacesDefined;
  return /*#__PURE__*/_react.default.createElement("button", {
    className: "clear-button-formatting",
    disabled: disabled,
    onClick: onClick,
    style: {
      marginBottom: '5px',
      marginLeft: '10px'
    }
  }, /*#__PURE__*/_react.default.createElement("i", {
    className: "fa fa-plus-circle"
  }), ' ', maxPlacesDefined ? 'Maximum intermediate places reached' : disabled ? 'Define origin/destination to add intermediate places' : 'Add place');
};

var _default = AddPlaceButton;
exports.default = _default;
module.exports = exports.default;

//# sourceMappingURL=add-place-button.js