import _extends from "@babel/runtime/helpers/extends";
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import React, { Component } from 'react';
import styles from "./index.module.scss";
var bannerPsd = /*#__PURE__*/function (_Component) {
  _inheritsLoose(bannerPsd, _Component);
  function bannerPsd() {
    return _Component.apply(this, arguments) || this;
  }
  var _proto = bannerPsd.prototype;
  _proto.render = function render() {
    var _curPsdParse$layers;
    var psdParse = this.props.psdParse;
    var _ref = psdParse || {},
      selectIdx = _ref.selectIdx,
      psdList = _ref.psdList;
    var curPsdParse = !(selectIdx === undefined || psdList === undefined) ? psdList[selectIdx] : {
      bgImg: '',
      layers: [],
      source: ''
    };
    var imgStyle = curPsdParse !== null && curPsdParse !== void 0 && curPsdParse.bgImg ? {
      style: {
        backgroundImage: "url(" + (curPsdParse === null || curPsdParse === void 0 ? void 0 : curPsdParse.bgImg) + ")"
      }
    } : {};
    return /*#__PURE__*/React.createElement("div", {
      className: styles['banner-wrap']
    }, /*#__PURE__*/React.createElement("div", _extends({
      className: styles.banner + " " + (!(curPsdParse !== null && curPsdParse !== void 0 && curPsdParse.bgImg) ? styles['banner-none'] : '')
    }, imgStyle), curPsdParse === null || curPsdParse === void 0 ? void 0 : (_curPsdParse$layers = curPsdParse.layers) === null || _curPsdParse$layers === void 0 ? void 0 : _curPsdParse$layers.map(function (res, idx) {
      return /*#__PURE__*/React.createElement("div", {
        className: styles['banner-fonts'],
        key: idx,
        style: res.style
      }, res.text);
    })));
  };
  return bannerPsd;
}(Component);
export { bannerPsd as default };