import MapSearchIcon from 'mdi-react/MapSearchIcon';
import * as React from 'react';
import { Route, Switch } from 'react-router';
import { Subscription } from 'rxjs';
import { HeroPage } from '../../components/HeroPage';
import { RepoHeaderBreadcrumbNavItem } from '../RepoHeaderBreadcrumbNavItem';
import { RepoHeaderContributionPortal } from '../RepoHeaderContributionPortal';
import { RepositoryStatsContributorsPage } from './RepositoryStatsContributorsPage';
import { RepositoryStatsNavbar } from './RepositoryStatsNavbar';
const NotFoundPage = () => (React.createElement(HeroPage, { icon: MapSearchIcon, title: "404: Not Found", subtitle: "Sorry, the requested repository stats page was not found." }));
const showNavbar = false;
/**
 * Renders pages related to repository stats.
 */
export class RepositoryStatsArea extends React.Component {
    constructor() {
        super(...arguments);
        this.subscriptions = new Subscription();
    }
    componentWillUnmount() {
        this.subscriptions.unsubscribe();
    }
    render() {
        const transferProps = {
            repo: this.props.repo,
        };
        return (React.createElement("div", { className: "repository-stats-area area--vertical" },
            React.createElement(RepoHeaderContributionPortal, { position: "nav", element: React.createElement(RepoHeaderBreadcrumbNavItem, { key: "stats" }, "Contributors"), repoHeaderContributionsLifecycleProps: this.props.repoHeaderContributionsLifecycleProps }),
            showNavbar && (React.createElement("div", { className: "area--vertical__navbar" },
                React.createElement(RepositoryStatsNavbar, { className: "area--vertical__navbar-inner", repo: this.props.repo.name }))),
            React.createElement("div", { className: "area--vertical__content" },
                React.createElement("div", { className: "area--vertical__content-inner" },
                    React.createElement(Switch, null,
                        React.createElement(Route, { path: `${this.props.match.url}/contributors`, key: "hardcoded-key" // see https://github.com/ReactTraining/react-router/issues/4578#issuecomment-334489490
                            , exact: true, 
                            // tslint:disable-next-line:jsx-no-lambda
                            render: routeComponentProps => (React.createElement(RepositoryStatsContributorsPage, Object.assign({}, routeComponentProps, transferProps))) }),
                        React.createElement(Route, { key: "hardcoded-key", component: NotFoundPage }))))));
    }
}
//# sourceMappingURL=RepositoryStatsArea.js.map