render()

in src/components/Chat/ChatTranscriptor/ChatTranscriptor.js [146:174]


  render() {
    const lastSentMessage = this.props.transcript
        .filter(({ type, transportDetails }) => (
            (type === PARTICIPANT_MESSAGE || type === ATTACHMENT_MESSAGE) &&
            transportDetails.direction === Direction.Outgoing
        )).pop();

    const lastMessageIndex = this.props.transcript.length - 1;

    return (
        <TranscriptWrapper
            contactId={this.props.contactId}
            type={this.props.contactStatus}
            loadPreviousTranscript={this.loadTranscript}
            lastSentMessageId={lastSentMessage ? lastSentMessage.id : null}
        >
          {(this.props.contactStatus === CONTACT_STATUS.CONNECTED ||
              this.props.contactStatus === CONTACT_STATUS.ACW ||
              this.props.contactStatus === CONTACT_STATUS.ENDED) && (
              <TranscriptBody>
                {this.props.transcript.map((item, idx) => this.renderMessage(item, idx === lastMessageIndex))}
                {this.props.typingParticipants.map(typing =>
                    this.renderTyping(typing)
                )}
              </TranscriptBody>
          )}
        </TranscriptWrapper>
    );
  }