/*
 * @Description:
 * @Author: jiass
 * @Date: 2022-01-25 13:29:21
 * @LastEditTime: 2022-04-08 16:12:23
 * @LastEditors: lanzhisheng
 */
import React, { FC } from "react";
import { View } from "@tarojs/components";
// import avatar_default from "./assets/icon_avatar.png";
// import iconPdfLogo from "./assets/icon_pdf_logo.svg";
import dayjs from "dayjs";
interface propType {
  /**
   * 数据
   */
  data: any;
  /**
   * 池子类型
   */
  poolType: any;
  /**
   * 状态类型
   */
  optTypeObj: any;
  /**
   * pdf点击事件
   */
  onPdfClick?: any;
}
const CommentList: FC<propType> = (props) => {
  const { data, poolType, optTypeObj, onPdfClick } = props;

  return (
    <View className="recomend_stockItem">
      {/* <Image className="avatar" src={avatar_default} /> */}
      <View className="content">
        <View className="usm">{data?.optName}</View>
        <View className="desc">
          <View>{dayjs(data?.optTime).format("YYYY-MM-DD")}</View>
          <View>
            状态:{" "}
            {data?.optType == "2"
              ? optTypeObj[data?.optType]
              : `${optTypeObj[data?.optType]}${poolType[data?.poolType]}`}
          </View>
        </View>
        <View className="detail">{data?.reason}</View>
        {Array.isArray(data?.fileList) && data?.fileList.length > 0 && (
          <View
            onClick={() => onPdfClick(data.fileList[0])}
            className="attachment_report"
            hoverStopPropagation
          >
            {/* <Image className="icon_pdf" style="" src={iconPdfLogo} /> */}
            <View className="pdf_title oneLine">
              {data?.fileList[0].fileName}
            </View>
          </View>
        )}
      </View>
    </View>
  );
};
export default CommentList;
