import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import React, { Component } from 'react';
import style from "./index.module.scss";
var xtFormPlaceholder = /*#__PURE__*/function (_Component) {
  _inheritsLoose(xtFormPlaceholder, _Component);
  function xtFormPlaceholder() {
    return _Component.apply(this, arguments) || this;
  }
  var _proto = xtFormPlaceholder.prototype;
  _proto.render = function render() {
    var _this$props = this.props,
      formItem = _this$props.formItem,
      changeForm = _this$props.changeForm,
      formData = _this$props.formData;
    var itemIdx = formData.findIndex(function (res) {
      return res.key === formItem.key;
    });
    var dsbStyle = {
      // 按钮禁用样式判断
      top: itemIdx === 0,
      prev: itemIdx === 0,
      next: itemIdx >= formData.length - 1,
      bottom: itemIdx >= formData.length - 1
    };
    return /*#__PURE__*/React.createElement("div", {
      className: "editor-fixed " + style['editor-fix']
    }, /*#__PURE__*/React.createElement("div", {
      className: style['editor-fix-content']
    }, /*#__PURE__*/React.createElement("div", {
      className: "xiatu-rich xt-gongjulan-shangyiceng " + style['editor-fix-item'] + " " + (dsbStyle.prev ? style['editor-fix-item-disabled'] : ''),
      onClick: function onClick() {
        return changeForm(formItem, 'prev');
      }
    }), /*#__PURE__*/React.createElement("div", {
      className: "xiatu-rich xt-gongjulan-xiayiceng " + style['editor-fix-item'] + " " + (dsbStyle.next ? style['editor-fix-item-disabled'] : ''),
      onClick: function onClick() {
        return changeForm(formItem, 'next');
      }
    }), /*#__PURE__*/React.createElement("div", {
      className: "xiatu-rich xt-icon-zhiding " + style['editor-fix-item'] + " " + (dsbStyle.top ? style['editor-fix-item-disabled'] : ''),
      onClick: function onClick() {
        return changeForm(formItem, 'top');
      }
    }), /*#__PURE__*/React.createElement("div", {
      className: "xiatu-rich xt-icon-lajitong " + style['editor-fix-item'],
      onClick: function onClick() {
        return changeForm(formItem, 'delete');
      }
    })));
  };
  return xtFormPlaceholder;
}(Component);
export { xtFormPlaceholder as default };