import { lazy } from "react";
import { lazyRetry } from "../utils/lazyRetry";
import {
  ROUTE_ADMIN_REQUESTS,
  ROUTE_ADMIN_CREATE_NEW_REQUEST,
  ROUTE_ADMIN_HATCHING,
  ROUTE_ADMIN_NEW_REQUESTS,
  ROUTE_ADMIN_REJECTED_REQUESTS,
  ROUTE_ADMIN_AWAITING_PAYMENT_REQUESTS,
  ROUTE_ADMIN_AWAITING_INSPECTION_REQUESTS,
  ROUTE_ADMIN_ARCHIVED_REQUESTS,
  ROUTE_ADMIN_ACTIVE_REQUESTS,
  ROUTE_ADMIN_STATICS,
  ROUTE_ADMIN_VISOR_STATICS,
  ROUTE_ADMIN_VISOR_STATICS_CHARTS,
  ROUTE_ADMIN_VISOR_STATICS_PREDICTION,
} from "./routes";

const Requests = lazy(() => lazyRetry(() => import("../pages/AdminRequests")));

const Statics = lazy(() => lazyRetry(() => import("../pages/AdminStatics")));
const VisorStatics = lazy(() =>
  lazyRetry(() => import("../pages/VisorStatics"))
);

// const Requests = lazy(() => import("../pages/AdminRequests"));
// const Statics = lazy(() => import("../pages/AdminStatics"));

export const adminRouting = [
  {
    path: [
      ROUTE_ADMIN_REQUESTS,
      ROUTE_ADMIN_CREATE_NEW_REQUEST,
      ROUTE_ADMIN_HATCHING,
      ROUTE_ADMIN_NEW_REQUESTS,
      ROUTE_ADMIN_REJECTED_REQUESTS,
      ROUTE_ADMIN_AWAITING_PAYMENT_REQUESTS,
      ROUTE_ADMIN_AWAITING_INSPECTION_REQUESTS,
      ROUTE_ADMIN_ARCHIVED_REQUESTS,
      ROUTE_ADMIN_ACTIVE_REQUESTS,
    ],
    Page: Requests,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_ADMIN_STATICS],
    Page: Statics,
    exact: false,
    props: {},
  },
  {
    path: [
      ROUTE_ADMIN_VISOR_STATICS,
      ROUTE_ADMIN_VISOR_STATICS_PREDICTION,
      ROUTE_ADMIN_VISOR_STATICS_CHARTS,
    ],
    Page: VisorStatics,
    exact: false,
    props: {},
  },
];
