// Received/read indicator.
import React from 'react';
import Tinode from 'tinode-sdk';
export default class ReceivedMarker extends React.PureComponent {
render() {
let timestamp;
if (this.props.received <= Tinode.MESSAGE_STATUS_SENDING) {
timestamp = "sending ...";
} else if (this.props.received == Tinode.MESSAGE_STATUS_FAILED) {
timestamp = "failed";
} else {
timestamp = shortDateFormat(this.props.timestamp);
}
let marker = null;
if (this.props.received <= Tinode.MESSAGE_STATUS_SENDING) {
marker = (access_time); // watch face
} else if (this.props.received == Tinode.MESSAGE_STATUS_FAILED) {
marker = (error_outline); // icon (!)
} else if (this.props.received == Tinode.MESSAGE_STATUS_SENT) {
marker = (done); // checkmark
} else if (this.props.received == Tinode.MESSAGE_STATUS_RECEIVED) {
marker = (done_all); // double checkmark
} else if (this.props.received == Tinode.MESSAGE_STATUS_READ) {
marker = (done_all); // blue double checkmark
}
return (
{timestamp}{'\u00a0'}{marker}
);
}
};