import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
var _excluded = ["dataList", "children"];
import React from 'react';
// import { Avatar, Rate, Space } from 'antd'
import { convertChildren } from "../../utils/children-node-handle";
import "./index.scss";
import likePng from "../../assets/icon/review-list/like.png";
import unlikePng from "../../assets/icon/review-list/unlike.png";
var ReviewList = function ReviewList(_ref) {
  var _ref$dataList = _ref.dataList,
    dataList = _ref$dataList === void 0 ? [] : _ref$dataList,
    children = _ref.children,
    otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
  var _otherProps = otherProps || {};
  console.log('评价列表数据：', dataList);
  return /*#__PURE__*/React.createElement("div", _extends({
    className: "reviewList"
  }, _otherProps), /*#__PURE__*/React.createElement("div", {
    className: "header"
  }, /*#__PURE__*/React.createElement("div", {
    "class": "header-title"
  }, "Customer Reviews"), /*#__PURE__*/React.createElement("div", {
    "class": "header-right"
  }, "All Reviews")), /*#__PURE__*/React.createElement("div", {
    className: "list"
  }, dataList ? dataList.map(function (item, index) {
    return /*#__PURE__*/React.createElement("div", {
      key: index,
      className: "review-item"
    }, /*#__PURE__*/React.createElement("div", {
      className: "userInfo"
    }, convertChildren(children, 'avatar', {
      imgSrc: item.avatar[0],
      style: {
        width: '45px',
        height: '45px'
      }
    }), /*#__PURE__*/React.createElement("div", {
      className: "userDetail"
    }, /*#__PURE__*/React.createElement("div", {
      className: "topLine"
    }, convertChildren(children, 'userName', {
      children: item.userName,
      className: 'userDetail-username'
    }), convertChildren(children, 'time', {
      children: item.time,
      className: 'userDetail-username'
    })), convertChildren(children, 'rating', {
      children: item.rating
    }))), convertChildren(children, 'content', {
      children: item.content,
      className: 'content'
    }), /*#__PURE__*/React.createElement("div", {
      className: "actions"
    }, /*#__PURE__*/React.createElement("span", {
      className: "action"
    }, /*#__PURE__*/React.createElement("img", {
      className: "action-img",
      src: likePng,
      alt: ""
    }), /*#__PURE__*/React.createElement("span", null, item.likeCount)), /*#__PURE__*/React.createElement("span", {
      className: "action"
    }, /*#__PURE__*/React.createElement("img", {
      className: "action-img",
      src: unlikePng,
      alt: ""
    }), /*#__PURE__*/React.createElement("span", null, item.unlikeCount))));
  }) : /*#__PURE__*/React.createElement("div", null, "\u6682\u65E0\u6570\u636E")));
};
export default ReviewList;