function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import NotFound404Light from './assets/images/light/404.png';
import ApiErrorLight from './assets/images/light/api_error.png';
import ComingSoonLight from './assets/images/light/coming_soon.png';
import DeletedDefaultLight from './assets/images/light/deleted_default.png';
import EmptyDefaultLight from './assets/images/light/empty_default.png';
import NetworkErrorLight from './assets/images/light/network_error.png';
import NoPermissionDefaultLight from './assets/images/light/no_permission_default.png';
import UpdateLight from './assets/images/light/update.png';
import NotFound404Dark from './assets/images/dark/404.png';
import ApiErrorDark from './assets/images/dark/api_error.png';
import ComingSoonDark from './assets/images/dark/coming_soon.png';
import DeletedDefaultDark from './assets/images/dark/deleted_default.png';
import EmptyDefaultDark from './assets/images/dark/empty_default.png';
import NetworkErrorDark from './assets/images/dark/network_error.png';
import NoPermissionDefaultDark from './assets/images/dark/no_permission_default.png';
import UpdateDark from './assets/images/dark/update.png';
var ImageSrcList = {
  no_permission_default_light: NoPermissionDefaultLight,
  no_permission_default_dark: NoPermissionDefaultDark,
  '404_light': NotFound404Light,
  '404_dark': NotFound404Dark,
  coming_soon_light: ComingSoonLight,
  coming_soon_dark: ComingSoonDark,
  deleted_default_light: DeletedDefaultLight,
  deleted_default_dark: DeletedDefaultDark,
  empty_default_light: EmptyDefaultLight,
  empty_default_dark: EmptyDefaultDark,
  network_error_light: NetworkErrorLight,
  network_error_dark: NetworkErrorDark,
  update_light: UpdateLight,
  update_dark: UpdateDark,
  api_error_light: ApiErrorLight,
  api_error_dark: ApiErrorDark
};
var bgThemeList = {
  white: {
    backgroundColor: '#ffffff',
    color: '#7f7f7f'
  },
  light: {
    backgroundColor: '#F5F5F5',
    color: '#7f7f7f'
  },
  dark: {
    backgroundColor: '#32353E',
    color: 'rgba(255,255,255,0.40)'
  }
};
/**
 * 空白页
 */

var Blank =
/*#__PURE__*/
function (_Component) {
  _inherits(Blank, _Component);

  function Blank(props) {
    var _this;

    _classCallCheck(this, Blank);

    _this = _possibleConstructorReturn(this, _getPrototypeOf(Blank).call(this, props));

    _defineProperty(_assertThisInitialized(_this), "onClickBtn", function () {
      var clickBtn = _this.props.clickBtn;

      if (clickBtn) {
        clickBtn();
      }
    });

    _this.state = {};
    return _this;
  }

  _createClass(Blank, [{
    key: "render",
    value: function render() {
      var prefixCls = 'eh-blank';
      var _this$props = this.props,
          height = _this$props.height,
          _this$props$theme = _this$props.theme,
          theme = _this$props$theme === void 0 ? 'light' : _this$props$theme,
          _this$props$btnColor = _this$props.btnColor,
          btnColor = _this$props$btnColor === void 0 ? '#07A6F0' : _this$props$btnColor,
          title = _this$props.title,
          content = _this$props.content,
          btnText = _this$props.btnText,
          image = _this$props.image,
          imageType = _this$props.imageType;
      var bgTheme = bgThemeList[theme];
      return React.createElement("div", {
        className: prefixCls,
        style: _objectSpread({}, bgTheme, {
          height: height
        })
      }, React.createElement("div", {
        className: "".concat(prefixCls, "-container")
      }, React.createElement("div", {
        className: "".concat(prefixCls, "-container-image")
      }, React.createElement("img", {
        src: image || ImageSrcList["".concat(imageType, "_").concat(theme)] || ImageSrcList["".concat(imageType, "_light")],
        alt: "blankPage-icon"
      })), title && React.createElement("div", {
        className: "".concat(prefixCls, "-container-title")
      }, title), content && React.createElement("div", {
        className: "".concat(prefixCls, "-container-txt")
      }, content), btnText && React.createElement("div", {
        className: "".concat(prefixCls, "-container-btn")
      }, React.createElement("a", {
        style: {
          border: 'none',
          backgroundColor: "".concat(btnColor)
        },
        className: "".concat(prefixCls, "-button ").concat(prefixCls, "-button-primary"),
        onClick: this.onClickBtn
      }, React.createElement("span", null, btnText)))));
    }
  }]);

  return Blank;
}(Component);

_defineProperty(Blank, "propTypes", {
  height: PropTypes.string,
  theme: PropTypes.oneOf(['dark', 'light', 'white']),
  btnColor: PropTypes.string,
  title: PropTypes.string,
  content: PropTypes.string,
  btnText: PropTypes.string,
  image: PropTypes.string,
  clickBtn: PropTypes.func,
  imageType: PropTypes.oneOf(['404', 'api_error', 'coming_soon', 'deleted_default', 'empty_default', 'network_error', 'no_permission_default', 'update'])
});

_defineProperty(Blank, "defaultProps", {
  height: "".concat(window.innerHeight, "px"),
  theme: 'light',
  btnColor: '#07A6F0',
  title: '',
  content: '',
  btnText: '',
  image: '',
  imageType: 'empty_default'
});

export default Blank;