Implement AdminCommentContent for text and html

This commit is contained in:
Chi Vinh Le
2018-03-22 23:15:21 +01:00
parent a1a867ec55
commit 292e33c105
13 changed files with 321 additions and 63 deletions
@@ -0,0 +1,27 @@
import React from 'react';
import PropTypes from 'prop-types';
import styles from './AdminCommentContent.css';
import { AdminCommentContent as Content } from 'plugin-api/beta/client/components';
class AdminCommentContent extends React.Component {
render() {
const { comment, suspectWords, bannedWords } = this.props;
return (
<Content
className={styles.content}
body={comment.richTextBody ? comment.richTextBody : comment.body}
suspectWords={suspectWords}
bannedWords={bannedWords}
html={!!comment.richTextBody}
/>
);
}
}
AdminCommentContent.propTypes = {
comment: PropTypes.object.isRequired,
suspectWords: PropTypes.array.isRequired,
bannedWords: PropTypes.array.isRequired,
};
export default AdminCommentContent;