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