import React from 'react';
import { locales } from '@pisell/utils';
import { Button } from 'antd';
import GoLogin from "./GoLogin";
import { SRStepStatus } from "../types";
import "../index.less";
var VerifyErrorContent = function VerifyErrorContent(props) {
  return /*#__PURE__*/React.createElement("div", {
    className: "pisell-saas-register-form"
  }, /*#__PURE__*/React.createElement("div", {
    className: "pisell-saas-register-form-main"
  }, /*#__PURE__*/React.createElement("div", {
    className: "pisell-saas-register-form-title"
  }, props.title), props.subtitle ? /*#__PURE__*/React.createElement("div", {
    className: "pisell-saas-register-form-subtitle"
  }, props.subtitle) : null), /*#__PURE__*/React.createElement(Button, {
    type: "primary",
    block: true,
    size: "large",
    className: "pisell-saas-register-button margin-top-32",
    onClick: props.onClick
  }, props.buttonText), props.showGoLogin ? /*#__PURE__*/React.createElement(GoLogin, {
    onGoLogin: props.onGoLogin
  }) : null);
};
var VerifyError = function VerifyError(props) {
  var status = props.status,
    onBackToRegister = props.onBackToRegister;
  if (status === SRStepStatus.FAILED_EMAIL_REGISTERED) {
    return /*#__PURE__*/React.createElement(VerifyErrorContent, {
      title: locales.getText('pisell-saas-register-failed-email-registered-title'),
      buttonText: locales.getText('pisell-saas-register-failed-button-text'),
      onClick: onBackToRegister,
      showGoLogin: true,
      onGoLogin: props.onGoLogin
    });
  }
  if (status === SRStepStatus.FAILED_LINK_EXPIRED) {
    return /*#__PURE__*/React.createElement(VerifyErrorContent, {
      title: locales.getText('pisell-saas-register-failed-link-expired-title'),
      subtitle: locales.getText('pisell-saas-register-failed-link-expired-subtitle'),
      buttonText: locales.getText('pisell-saas-register-failed-button-text'),
      onClick: onBackToRegister,
      showGoLogin: true,
      onGoLogin: props.onGoLogin
    });
  }
  if (status === SRStepStatus.FAILED_LINK_EMAIL_REGISTERED) {
    return /*#__PURE__*/React.createElement(VerifyErrorContent, {
      title: locales.getText('pisell-saas-register-failed-link-email-registered-title'),
      subtitle: locales.getText('pisell-saas-register-failed-link-email-registered-subtitle'),
      buttonText: locales.getText('pisell-saas-register-failed-link-email-registered-button-text'),
      onClick: props.onGoLogin
    });
  }
  if (status === SRStepStatus.FAILED_LINK_INVALID) {
    return /*#__PURE__*/React.createElement(VerifyErrorContent, {
      title: locales.getText('pisell-saas-register-failed-link-invalid-title'),
      subtitle: locales.getText('pisell-saas-register-failed-link-invalid-subtitle'),
      buttonText: locales.getText('pisell-saas-register-failed-button-text'),
      onClick: onBackToRegister,
      showGoLogin: true,
      onGoLogin: props.onGoLogin
    });
  }
  return null;
};
export default VerifyError;