import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import React, { Component } from 'react';
import style from "./index.module.scss";
import Placeholder from "./FormPlaceholder";
import FormView from "./FormView";
var TabForm = /*#__PURE__*/function (_Component) {
  _inheritsLoose(TabForm, _Component);
  function TabForm() {
    var _this;
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _Component.call.apply(_Component, [this].concat(args)) || this;
    _this.state = {
      formData: []
    };
    return _this;
  }
  var _proto = TabForm.prototype;
  _proto.render = function render() {
    var _this$props = this.props,
      xtForm = _this$props.xtForm,
      triggerWXLogin = _this$props.triggerWXLogin,
      submitSuccess = _this$props.submitSuccess,
      _this$props$formBtnTe = _this$props.formBtnText,
      formBtnText = _this$props$formBtnTe === void 0 ? null : _this$props$formBtnTe;
    var _ref = xtForm || this.state,
      formData = _ref.formData;
    return /*#__PURE__*/React.createElement("div", {
      className: style['xt-form']
    }, Array.isArray(formData) && formData.length > 0 ? /*#__PURE__*/React.createElement(FormView, {
      formData: formData,
      triggerWXLogin: triggerWXLogin,
      submitSuccess: submitSuccess,
      formBtnText: formBtnText
    }) : /*#__PURE__*/React.createElement(Placeholder, null));
  };
  return TabForm;
}(Component);
export { TabForm as default };