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 DeployTimes = asyncRouter(function () {
  return import("./DeployTimes");
});
var DeployDuration = asyncRouter(function () {
  return import("./DeployDuration");
});

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: "deploy"
      });
    }
  }), /*#__PURE__*/React.createElement(PermissionRoute, {
    service: ['choerodon.code.project.operation.chart.ps.deploy.times'],
    path: "".concat(match.url, "/deploy-times"),
    component: DeployTimes
  }), /*#__PURE__*/React.createElement(PermissionRoute, {
    service: ['choerodon.code.project.operation.chart.ps.deploy.duration'],
    path: "".concat(match.url, "/deploy-duration"),
    component: DeployDuration
  }), /*#__PURE__*/React.createElement(Route, {
    path: "*",
    component: nomatch
  })));
};

export default ReportsIndex;