2019-10-14 18:21:40 -04:00
|
|
|
// @flow
|
|
|
|
import React from 'react';
|
|
|
|
import CommentsList from 'component/commentsList';
|
2021-02-04 00:45:49 -05:00
|
|
|
import Empty from 'component/common/empty';
|
2019-10-14 18:21:40 -04:00
|
|
|
|
|
|
|
type Props = {
|
|
|
|
uri: string,
|
2021-07-15 22:43:28 +08:00
|
|
|
linkedCommentId?: string,
|
2021-02-04 18:00:07 -05:00
|
|
|
commentsDisabled: boolean,
|
2019-10-14 18:21:40 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
function ChannelDiscussion(props: Props) {
|
2021-07-15 22:43:28 +08:00
|
|
|
const { uri, linkedCommentId, commentsDisabled } = props;
|
2020-08-31 13:12:34 -04:00
|
|
|
|
2021-02-04 18:00:07 -05:00
|
|
|
if (commentsDisabled) {
|
|
|
|
return <Empty text={__('This channel has disabled comments on their page.')} />;
|
2021-02-04 00:45:49 -05:00
|
|
|
}
|
2019-10-14 18:21:40 -04:00
|
|
|
return (
|
2020-08-25 15:25:33 -04:00
|
|
|
<section className="section">
|
2021-07-15 22:43:28 +08:00
|
|
|
<CommentsList uri={uri} linkedCommentId={linkedCommentId} />
|
2020-08-25 15:25:33 -04:00
|
|
|
</section>
|
2019-10-14 18:21:40 -04:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ChannelDiscussion;
|