import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
var _excluded = ["content", "dataList"];
import React from 'react';
import "./index.scss";
// 富文本

// 用于处理富文本内容的函数
var processContent = function processContent(content) {
  // 检查内容是否为字符串
  if (typeof content !== 'string') {
    return '';
  }
  // 替换转义符号（这里可以根据需要添加更多处理逻辑）
  return content.replace(/\\/g, '');
};
var RichText = function RichText(props) {
  var content = props.content,
    dataList = props.dataList,
    otherProps = _objectWithoutPropertiesLoose(props, _excluded);
  return /*#__PURE__*/React.createElement("div", _extends({
    className: "rich-text"
  }, otherProps), dataList && dataList.length > 0 ? dataList.map(function (item, index) {
    return /*#__PURE__*/React.createElement("div", {
      key: index,
      dangerouslySetInnerHTML: {
        __html: processContent(item.content)
      }
    });
  }) : /*#__PURE__*/React.createElement("div", {
    dangerouslySetInnerHTML: {
      __html: processContent(content)
    }
  }));
};
RichText.displayName = 'RichText';
export default RichText;