import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import React from 'react';
import { AddComponent } from './component';
export var AddContainer =
/*#__PURE__*/
function (_React$Component) {
  _inherits(AddContainer, _React$Component);

  function AddContainer() {
    var _getPrototypeOf2;

    var _this;

    _classCallCheck(this, AddContainer);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(AddContainer)).call.apply(_getPrototypeOf2, [this].concat(args)));
    _this.count = void 0;

    _this.handleCount = function (count) {
      _this.count = count;
    };

    _this.handleAdd = function (e) {
      _this.props.onAdd(e, _this.count);
    };

    return _this;
  }

  _createClass(AddContainer, [{
    key: "render",
    value: function render() {
      return React.createElement(AddComponent, {
        title: this.props.title,
        onAdd: this.handleAdd,
        onCount: this.handleCount
      });
    }
  }]);

  return AddContainer;
}(React.Component);