Message.js
1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import React from 'react';
import PropTypes from 'prop-types';
import Widget from '../../../../../components/Widget';
import MessageHeader from '../MessageHeader/MessageHeader';
import MessageAttachments from '../MessageAttachments/MessageAttachments';
const Message = ({ message, compose }) => (
<Widget>
<MessageHeader
title={message.theme}
name={message.from}
email={message.fromEmail}
to={message.to}
date={message.date}
compose={compose}
/>
{/* eslint-disable */}
<div
dangerouslySetInnerHTML={{ __html: message.content }}
/>
{/* eslint-enable */}
{message.attachments && <MessageAttachments attachments={message.attachments} />}
</Widget>
);
Message.propTypes = {
message: PropTypes.shape({
theme: PropTypes.string,
from: PropTypes.string,
fromEmail: PropTypes.string,
to: PropTypes.string,
date: PropTypes.string,
}).isRequired,
compose: PropTypes.func.isRequired,
};
export default Message;