import React from "react"; import { connect } from "react-redux"; // import { connectToParent } from "../../utils/comments"; import userImage from "./user.svg"; import positiveIcon from "./positive.svg"; import negativeIcon from "./negative.svg"; import Avatar from "../Avatar" import moment from "jalali-moment"; import Button from '../Button'; import StarRating from "../StarRating"; export const Comments = ({ comments }) => { // connectToParent(comments); const Comment = ({ comment }) => { return (
{comment.username}
{comment.product?.color} {comment.product?.name}
{moment(comment.data).locale("fa").format("YYYY/MM/DD")} {comment.date.getHours()} : {comment.date.getMinutes()}
{comment.status === true && ( <> برای خرید توصیه می‌کنم )} {comment.status === false && ( <> برای خرید توصیه نمی‌کنم )}

{comment.text}

{/*
); }; return (
{comments.map((comment, index) => ( ))}
); }; const mapStateToProps = (state) => ({}); const mapDispatchToProps = {}; export default connect(mapStateToProps, mapDispatchToProps)(Comments); Comments.defaultProps = { comments: [ { id: 0, pid: null, username: "آرش سامانی", date: new Date(), text: "خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ", userImage: userImage, rate: 4, product: { name: "مک بوک پرو 16 گیگ", color: "خاکستری", }, status: true, }, ], };