-
Notifications
You must be signed in to change notification settings - Fork 0
/
Comment.js
26 lines (24 loc) · 949 Bytes
/
Comment.js
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
import ReactMarkdown from "react-markdown";
import { MdArrowUpward, MdPersonOutline } from "react-icons/md";
import MarkdownLinkRenderer from "./MarkdownLinkRenderer";
import utilStyles from "../../App/utils.module.css";
import styles from "./Comment.module.css";
export default function Comment({ comment }) {
return (
<article className={styles.comment}>
<div className={`${utilStyles.flexRow} ${utilStyles.darkGrey}`}>
<MdArrowUpward className={utilStyles.upvoteIcon} size={24} />
<div className={styles.marginRight}>
{comment.scoreHidden ? <span>???</span> : comment.score}
</div>
<div className={styles.username}>
<MdPersonOutline className={styles.userIcon} size={24} />
<div>{comment.author}</div>
</div>
</div>
<div>
<ReactMarkdown components={{a: MarkdownLinkRenderer}}>{comment.body}</ReactMarkdown>
</div>
</article>
);
}