import React from 'react';
import { Route, Switch } from 'react-router-dom';
import { asyncRouter, nomatch } from '@choerodon/boot';
import { Charts, PermissionRoute } from '@choerodon/master';
import { StoreProvider } from "./stores";
var SUBMISSION = asyncRouter(function () {
  return import("./Submission");
});
var BUILDNUMBER = asyncRouter(function () {
  return import("./BuildNumber");
});
var BUILDDURATION = asyncRouter(function () {
  return import("./BuildDuration");
});
var PipelineTriggerNumber = asyncRouter(function () {
  return import("./PipelineTriggerNumberChart");
});
var PipelineDuration = asyncRouter(function () {
  return import("./pipeline-duration");
});

var ReportsIndex = function ReportsIndex(props) {
  var match = props.match;
  return /*#__PURE__*/React.createElement(StoreProvider, props, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
    exact: true,
    path: match.url,
    component: function component() {
      return /*#__PURE__*/React.createElement(Charts, {
        reportType: "develop"
      });
    }
  }), /*#__PURE__*/React.createElement(PermissionRoute, {
    service: ['choerodon.code.project.operation.chart.ps.commit'],
    path: "".concat(match.url, "/submission"),
    component: SUBMISSION
  }), /*#__PURE__*/React.createElement(PermissionRoute, {
    service: ['choerodon.code.project.operation.chart.ps.build.times'],
    path: "".concat(match.url, "/build-number"),
    component: BUILDNUMBER
  }), /*#__PURE__*/React.createElement(PermissionRoute, {
    service: ['choerodon.code.project.operation.chart.ps.build.duration'],
    path: "".concat(match.url, "/build-duration"),
    component: BUILDDURATION
  }), /*#__PURE__*/React.createElement(PermissionRoute, {
    service: ['choerodon.code.project.operation.chart.ps.pipeline.times'],
    path: "".concat(match.url, "/pipelineTrigger-number"),
    component: PipelineTriggerNumber
  }), /*#__PURE__*/React.createElement(PermissionRoute, {
    service: ['choerodon.code.project.operation.chart.ps.pipeline.duration'],
    path: "".concat(match.url, "/pipeline-duration"),
    component: PipelineDuration
  }), /*#__PURE__*/React.createElement(Route, {
    path: "*",
    component: nomatch
  })));
};

export default ReportsIndex;