import * as React from 'react';
import { Subscription } from 'rxjs';
import { isDiscussionsEnabled } from '.';
import { ErrorNotSupportedPage } from '../components/ErrorNotSupportedPage';
import { PageTitle } from '../components/PageTitle';
import { DiscussionsList } from '../discussions/DiscussionsList';
import { eventLogger } from '../tracking/eventLogger';
/**
 * A page for viewing code discussions on this site.
 */
export class DiscussionsPage extends React.PureComponent {
    constructor() {
        super(...arguments);
        this.state = {};
        this.subscriptions = new Subscription();
    }
    componentDidMount() {
        eventLogger.logViewEvent('Discussions');
    }
    componentWillUnmount() {
        this.subscriptions.unsubscribe();
    }
    render() {
        if (!isDiscussionsEnabled(this.props.configurationCascade)) {
            return React.createElement(ErrorNotSupportedPage, null);
        }
        return (React.createElement("div", { className: "discussions-page area" },
            React.createElement("div", { className: "area__content" },
                React.createElement(PageTitle, { title: "Discussions" }),
                React.createElement("h2", null, "All discussions"),
                React.createElement(DiscussionsList, { repoID: undefined, rev: undefined, filePath: '/**', history: this.props.history, location: this.props.location, noun: "discussion", pluralNoun: "discussions", defaultFirst: 6 }))));
    }
}
//# sourceMappingURL=DiscussionsPage.js.map