import _extends from "@babel/runtime/helpers/extends";
import "./index.scss";
import * as React from 'react';
var rules02 = function rules02(rules02Props) {
  var isBgColor = rules02Props.isBgColor,
    bgColor = rules02Props.bgColor,
    lineHeight = rules02Props.lineHeight,
    textColor = rules02Props.textColor,
    textFontFamily = rules02Props.textFontFamily,
    textFontSize = rules02Props.textFontSize,
    titleBold = rules02Props.titleBold,
    titleTextAlign = rules02Props.titleTextAlign,
    titleFontSize = rules02Props.titleFontSize,
    titleFontFamily = rules02Props.titleFontFamily,
    titleColor = rules02Props.titleColor,
    arrayRules = rules02Props.arrayRules;
  var getContent = function getContent(item) {
    var result = item && item.toString().split(/\n/g).filter(function (e) {
      return !!e;
    });
    return result;
  };
  var mainStyle = {
    style: {
      backgroundColor: isBgColor ? bgColor : '',
      lineHeight: lineHeight + "px"
    }
  };
  var titleStyle = {
    style: {
      fontWeight: titleBold ? 'bolder' : 'normal',
      textAlign: titleTextAlign,
      fontSize: titleFontSize,
      fontFamily: titleFontFamily,
      color: titleColor,
      paddingBottom: '2vw'
    }
  };
  var textStyle = {
    style: {
      color: textColor,
      fontSize: textFontSize + "px",
      fontFamily: textFontFamily
    }
  };
  var otherStyle = {
    style: {
      // background: isContentBgColor ? contentBgColor : '',
    }
  };
  return /*#__PURE__*/React.createElement("div", _extends({
    className: "rules"
  }, mainStyle), /*#__PURE__*/React.createElement("div", otherStyle, arrayRules && arrayRules.length > 0 && arrayRules.map(function (item, index) {
    return /*#__PURE__*/React.createElement("div", {
      key: index
    }, /*#__PURE__*/React.createElement("div", titleStyle, item.title), /*#__PURE__*/React.createElement("ul", textStyle, getContent(item.content).map(function (item2, index2) {
      return /*#__PURE__*/React.createElement("li", {
        key: index2
      }, item2);
    })));
  })));
};
export default rules02;