function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
// error module
// @author Pluto <huarse@gmail.com>
// @create 2018/05/22

import React from 'react';
import classNames from 'classnames';
import styles from "./index.less";
export default function ErrorMod(_ref) {
  var _ref$horizontal = _ref.horizontal,
    horizontal = _ref$horizontal === void 0 ? false : _ref$horizontal,
    _ref$imgSrc = _ref.imgSrc,
    imgSrc = _ref$imgSrc === void 0 ? 'https://img.alicdn.com/tps/TB1UmrVPXXXXXXFapXXXXXXXXXX-75-76.png' : _ref$imgSrc,
    _ref$showImg = _ref.showImg,
    showImg = _ref$showImg === void 0 ? true : _ref$showImg,
    _ref$showBtn = _ref.showBtn,
    showBtn = _ref$showBtn === void 0 ? true : _ref$showBtn,
    _ref$btnText = _ref.btnText,
    btnText = _ref$btnText === void 0 ? '刷新一下' : _ref$btnText,
    _ref$height = _ref.height,
    height = _ref$height === void 0 ? '240px' : _ref$height,
    _ref$onClick = _ref.onClick,
    onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
    className = _ref.className,
    noborder = _ref.noborder,
    children = _ref.children;
  var clazz = classNames(styles.container, styles.error, className, _defineProperty(_defineProperty({}, styles.horizontal, horizontal), styles.bordered, !noborder));
  return /*#__PURE__*/React.createElement("div", {
    className: clazz,
    style: {
      height: height
    }
  }, showImg ? /*#__PURE__*/React.createElement("div", {
    className: styles.imgbox
  }, /*#__PURE__*/React.createElement("img", {
    src: imgSrc,
    alt: ""
  })) : null, /*#__PURE__*/React.createElement("div", {
    className: styles.desc
  }, children || '抱歉，程序开小差了~'), showBtn ? /*#__PURE__*/React.createElement("div", {
    className: styles.action
  }, !horizontal ? /*#__PURE__*/React.createElement("button", {
    onClick: onClick,
    type: "button"
  }, btnText) : /*#__PURE__*/React.createElement("a", {
    href: "",
    onClick: onClick,
    "data-prevent": true
  }, btnText)) : null);
}