import React from 'react';
import usePrefix from "../../../../hooks/usePrefix";
import { StatusEnum } from "../../const";
import "./index.less";
var Icon = function Icon(_ref) {
  var status = _ref.status;
  var prefix = usePrefix();
  if (status === StatusEnum.Loading) {
    return /*#__PURE__*/React.createElement("div", {
      style: {
        backgroundImage: "url(".concat(prefix, "/loading.png)")
      },
      className: "pisell-lowcode__eft-pay-img pisell-lowcode__eft-pay-load"
    });
  }
  if (status === StatusEnum.Success) {
    return /*#__PURE__*/React.createElement("div", {
      style: {
        backgroundImage: "url(".concat(prefix, "/success.png)")
      },
      className: "pisell-lowcode__eft-pay-img " // pisell-lowcode__eft-pay-success
    });
  }
  if (status === StatusEnum.Fail) {
    return /*#__PURE__*/React.createElement("div", {
      style: {
        backgroundImage: "url(".concat(prefix, "/error.png)")
      },
      className: "pisell-lowcode__eft-pay-img " // pisell-lowcode__eft-pay-fail
    });
  }
  if (status === StatusEnum.Warn) {
    return /*#__PURE__*/React.createElement("div", {
      style: {
        backgroundImage: "url(".concat(prefix, "/warn.png)")
      },
      className: "pisell-lowcode__eft-pay-img " // pisell-lowcode__eft-pay-warn
    });
  }
  if (status === StatusEnum.Question) {
    return /*#__PURE__*/React.createElement("div", {
      style: {
        backgroundImage: "url(".concat(prefix, "/question.png)")
      },
      className: "pisell-lowcode__eft-pay-img " // pisell-lowcode__eft-pay-warn
    });
  }
  return null;
};
export default (function (_ref2) {
  var status = _ref2.status,
    _ref2$title = _ref2.title,
    title = _ref2$title === void 0 ? '' : _ref2$title,
    subTitle = _ref2.subTitle,
    children = _ref2.children;
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
    className: "pisell-lowcode__eft-pay-icon"
  }, /*#__PURE__*/React.createElement(Icon, {
    status: status
  }), children), title ? /*#__PURE__*/React.createElement("div", {
    className: "pisell-lowcode__eft-pay-title"
  }, title) : null, subTitle ? /*#__PURE__*/React.createElement("div", {
    className: "pisell-lowcode__eft-pay-sub-title"
  }, subTitle) : null);
});