mirror of
https://github.com/wassname/talk.git
synced 2026-06-30 03:13:58 +08:00
24 lines
563 B
JavaScript
24 lines
563 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { PLUGIN_NAME } from '../constants';
|
|
|
|
class CommentContent extends React.Component {
|
|
render() {
|
|
const { comment } = this.props;
|
|
return comment.richTextBody ? (
|
|
<div
|
|
className={`${PLUGIN_NAME}-text`}
|
|
dangerouslySetInnerHTML={{ __html: comment.richTextBody }}
|
|
/>
|
|
) : (
|
|
<div className={`${PLUGIN_NAME}-text`}>{comment.body}</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
CommentContent.propTypes = {
|
|
comment: PropTypes.object.isRequired,
|
|
};
|
|
|
|
export default CommentContent;
|