"use strict";

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