import React from "react";

import { Route, Switch } from "react-router-dom";
import Loadable from "react-loadable";
import Loading from "../../Loading";
import AdminRouter from "./components/adminRouter";


const TaskManage = Loadable({
  loader: () => import("./taskManage"),
  loading: Loading,
});

const PaperManage = Loadable({
  loader: () => import("./paperManage"),
  loading: Loading,
});

const PaperComplain = Loadable({
  loader: () => import("./paperComplain"),
  loading: Loading,
});

const ProofManage = Loadable({
  loader: () => import("./proofManage"),
  loading: Loading,
});

const PublicityComplain = Loadable({
  loader: () => import("./publicityComplain"),
  loading: Loading,
});

const AgreementManage = Loadable({
  loader: () => import("./agreementManage"),
  loading: Loading,
});

const PayProof = Loadable({
  loader: () => import("./payProof"),
  loading: Loading,
});

const TaskAdmin = Loadable({
  loader: () => import("./taskAdmin"),
  loading: Loading,
});

const DelayManage = Loadable({
  loader: () => import("./delayManage"),
  loading: Loading,
});

const AdminPage = (propsF) => {

  return (
    <React.Fragment>
      <AdminRouter {...propsF} />
      <Switch {...propsF}>
        {/* 任务管理审核 */}
        <Route
          path="/task/taskManage/:publishMode"
          render={(props) => (
            <TaskManage {...propsF} {...props} />
          )}
        ></Route>

        {/* 成果管理审核 */}
        <Route
          path="/task/paperManage"
          render={(props) => (
            <PaperManage {...propsF} {...props} />
          )}
        ></Route>

        {/* 成果申诉管理审核 */}
        <Route
          path="/task/paperComplain"
          render={(props) => (
            <PaperComplain {...propsF} {...props} />
          )}
        ></Route>

        {/* 公示期成果申诉管理审核 */}
        <Route
          path="/task/publicityComplain"
          render={(props) => (
            <PublicityComplain {...propsF} {...props} />
          )}
        ></Route>

        {/* 佐证管理审核 */}
        <Route
          path="/task/proofManage"
          render={(props) => (
            <ProofManage {...propsF} {...props} />
          )}
        ></Route>

        {/* 管理员协议审核 */}
        <Route
          path="/task/agreementManage"
          render={(props) => (
            <AgreementManage {...propsF} {...props} />
          )}
        ></Route>

        {/* 管理员上传支付凭证 */}
        <Route
          path="/task/payProof"
          render={(props) => (
            <PayProof {...propsF} {...props} />
          )}
        ></Route>

        {/* 管理员任务列表 */}
        <Route
          path="/task/taskAdmin"
          render={(props) => (
            <TaskAdmin {...propsF} {...props} />
          )}
        ></Route>

        {/* 延期管理 */}
        <Route
          path="/task/delayManage"
          render={(props) => (
            <DelayManage {...propsF} {...props} />
          )}
        ></Route>
      </Switch>
    </React.Fragment>
  );
}
// }
export default AdminPage;
