import React from 'react'; import timeago from 'timeago.js'; import Linkify from 'react-linkify'; import styles from './ModerationList.css'; import I18n from 'coral-framework/modules/i18n/i18n'; import translations from '../translations.json'; import Highlighter from 'react-highlight-words'; import {Icon} from 'coral-ui'; import ActionButton from './ActionButton'; const linkify = new Linkify(); // Render a single comment for the list const Comment = props => { const {comment, author} = props; let authorStatus = author.status; const links = linkify.getMatches(comment.body); return (
  • {author.username || lang.t('comment.anon')} {timeago().format(comment.createdAt || (Date.now() - props.index * 60 * 1000), lang.getLocale().replace('-', '_'))} {comment.flagged ?

    {lang.t('comment.flagged')}

    : null}
    {links ? Contains Link : null}
    {props.modActions.map( (action, i) => )}
    {authorStatus === 'banned' ? {lang.t('comment.banned_user')} : null}
  • ); }; export default Comment; const linkStyles = { backgroundColor: 'rgb(255, 219, 135)', padding: '1px 2px' }; const lang = new I18n(translations);