import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _inherits from "@babel/runtime/helpers/inherits";
import _createSuper from "@babel/runtime/helpers/createSuper";
import React, { PureComponent } from 'react';
import Button from '../button/Button';
import { ButtonColor, FuncType } from '../button/enum';

var Pager = /*#__PURE__*/function (_PureComponent) {
  _inherits(Pager, _PureComponent);

  var _super = _createSuper(Pager);

  function Pager() {
    var _this;

    _classCallCheck(this, Pager);

    _this = _super.apply(this, arguments);

    _this.handleClick = function () {
      var _this$props = _this.props,
          page = _this$props.page,
          onClick = _this$props.onClick;

      if (onClick) {
        onClick(page);
      }
    };

    return _this;
  }

  _createClass(Pager, [{
    key: "render",
    value: function render() {
      var _this$props2 = this.props,
          active = _this$props2.active,
          renderer = _this$props2.renderer,
          page = _this$props2.page,
          type = _this$props2.type,
          disabled = _this$props2.disabled,
          className = _this$props2.className;
      return /*#__PURE__*/React.createElement(Button, {
        className: className,
        funcType: active ? FuncType.raised : FuncType.flat,
        onClick: this.handleClick,
        color: active ? ButtonColor.primary : undefined,
        disabled: disabled
      }, renderer(page, type));
    }
  }]);

  return Pager;
}(PureComponent);

export { Pager as default };
Pager.displayName = 'Pager';
//# sourceMappingURL=Pager.js.map
