import React, { Component } from "react"; import DoneIcon from "@material-ui/icons/Done"; import DoneAllIcon from "@material-ui/icons/DoneAll"; import EditIcon from "@material-ui/icons/Edit"; import ExpandMoreIcon from "@material-ui/icons/ExpandMore"; import "./index.scss"; import Menu from "@material-ui/core/Menu"; import MenuItem from "@material-ui/core/MenuItem"; import ReplyIcon from "@material-ui/icons/Reply"; import ForwardIcon from "@material-ui/icons/Forward"; import DeleteIcon from "@material-ui/icons/Delete"; import ScheduleIcon from "@material-ui/icons/Schedule"; const menu = [ { text: window.t("پسند"), icon: FavoriteIcon, onClick: () => {} }, { text: window.t("تبادل نظر"), icon: TextsmsIcon, onClick: () => {} }, { text: window.t("پاسخ"), icon: ReplyIcon, onClick: () => {} }, { text: window.t("باز ارسال"), icon: ForwardIcon, onClick: () => {} }, ]; const selfMenu = [ { text: window.t("باز ارسال"), icon: ForwardIcon, onClick: () => {} }, { text: window.t("ویرایش"), icon: EditIcon, onClick: () => {} }, { text: window.t("حذف")), icon: DeleteIcon, onClick: () => {} }, ]; export default class Comment extends Component { state = { messageMenu: null }; handleClose = () => { this.setState({ messageMenu: null, }); }; handleClick = (event) => { this.setState({ messageMenu: event.currentTarget, }); }; render() { const { message, user, document, children, addcounter } = this.props; const { messageMenu } = this.state; const hasavatar = prevUserId != message.userId; return (
addcounter("nothing")}>
this.handleClose()} className="rtl fontLight" > {(isSelf ? selfMenu : menu).map((e) => ( { this.handleClose(); e.onClick(); addcounter("nothing"); }} > {e.text} ))}

{message.text}

); } }