summaryrefslogtreecommitdiff
path: root/web/src/components/message.js
blob: 92c15be3f316d9052d4aa542a8469cbe3b198718 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import React from "react";
import Markdown from "react-markdown";
import remarkBreaks from "remark-breaks";

const Message = ({message}) => {
    return (
        <article name={message.id}>
            <header className="msg-header">
                <span>{message.subject}</span>
                <span>{(new Date(message.date)).toLocaleDateString()}</span>
            </header>
            <Markdown remarkPlugins={[remarkBreaks]}>{message.message}</Markdown>
            <pre>
                {JSON.stringify(message, null, 4)}
            </pre>
        </article>
    );
}

export default Message;