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