import React, { Component } from 'react'; import ReactAudioPlayer from 'react-audio-player'; import ReactPlayer from 'react-player'; import CloudDownloadIcon from '@material-ui/icons/CloudDownload'; import Avatar from '@material-ui/core/Avatar'; import moment from 'jalali-moment'; 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 FavoriteIcon from '@material-ui/icons/Favorite'; import TextsmsIcon from '@material-ui/icons/Textsms'; import ScheduleIcon from '@material-ui/icons/Schedule'; const file = (fileId) => `${window.baseURL}/file/download/${fileId}`; const menu = [ { text: 'پسند', icon: FavoriteIcon, onClick: () => {} }, { text: 'تبادل نظر', icon: TextsmsIcon, onClick: () => {} }, { text: 'پاسخ', icon: ReplyIcon, onClick: () => {} }, { text: 'باز ارسال', icon: ForwardIcon, onClick: () => {} }, ]; const selfMenu = [ { text: 'باز ارسال', icon: ForwardIcon, onClick: () => {} }, { text: 'ویرایش', icon: EditIcon, onClick: () => {} }, { text: 'حذف', icon: DeleteIcon, onClick: () => {} }, ]; export default class NormalMessage extends Component { state = { messageMenu: null }; handleClose = () => { this.setState({ messageMenu: null, }); }; handleClick = (event) => { this.setState({ messageMenu: event.currentTarget, }); }; render() { const { message, user, document, isSelf, prevUserId, children } = this.props; const { messageMenu } = this.state; const hasavatar = prevUserId != message.userId; return (
{message.text}
) : null} {message.type == 'voice' ? ({message.text}