summaryrefslogtreecommitdiff
path: root/web/src/components/message.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/components/message.js')
-rw-r--r--web/src/components/message.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/web/src/components/message.js b/web/src/components/message.js
new file mode 100644
index 0000000..92c15be
--- /dev/null
+++ b/web/src/components/message.js
@@ -0,0 +1,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; \ No newline at end of file