import { lazy } from "react";
import { lazyRetry } from "../utils/lazyRetry";
import {
  ROUTE_COMMERCE_ROUTE_ALLOCATIONS,
  ROUTE_COMMERCE_ROUTE_FILES_STATE,
  ROUTE_COMMERCE_ROUTE_GUILDS,
  ROUTE_COMMERCE_ROUTE_GUILDS_SETTINGS,
  ROUTE_COMMERCE_ROUTE_MANAGE_GUILDS,
  ROUTE_COMMERCE_ROUTE_STEWARDS,
  ROUTE_COMMERCE_STATICS,
  ROUTE_COMMERCE_REQUESTS,
  ROUTE_COMMERCE_HATCHING,
  ROUTE_COMMERCE_VISOR_STATICS,
  ROUTE_COMMERCE_VISOR_STATICS_CHARTS,
  ROUTE_COMMERCE_VISOR_STATICS_PREDICTION,
  ROUTE_COMMERCE_VISOR_STATICS_PREDICTION_VIEW,
} from "./routes";

const Guilds = lazy(() => lazyRetry(() => import("../pages/Guilds")));
const FilesState = lazy(() => lazyRetry(() => import("../pages/FilesState")));
const VetFarmAllocations = lazy(() =>
  lazyRetry(() => import("../pages/VetFarmAllocations"))
);
const Statics = lazy(() => lazyRetry(() => import("../pages/AdminStatics")));

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

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

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

export const commerceRouting = [
  {
    path: [ROUTE_COMMERCE_REQUESTS],
    Page: Commerce,
    exact: false,
    props: {},
  },
  {
    path: [
      ROUTE_COMMERCE_ROUTE_MANAGE_GUILDS,
      ROUTE_COMMERCE_ROUTE_GUILDS,
      ROUTE_COMMERCE_ROUTE_STEWARDS,
      ROUTE_COMMERCE_ROUTE_GUILDS_SETTINGS,
    ],
    Page: Guilds,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_COMMERCE_ROUTE_FILES_STATE],
    Page: FilesState,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_COMMERCE_ROUTE_ALLOCATIONS],
    Page: VetFarmAllocations,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_COMMERCE_STATICS],
    Page: Statics,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_COMMERCE_HATCHING],
    Page: Hatching,
    exact: false,
    props: {},
  },
  {
    path: [
      ROUTE_COMMERCE_VISOR_STATICS,
      ROUTE_COMMERCE_VISOR_STATICS_PREDICTION,
      ROUTE_COMMERCE_VISOR_STATICS_PREDICTION_VIEW,
      ROUTE_COMMERCE_VISOR_STATICS_CHARTS,
    ],
    Page: VisorStatics,
    exact: false,
    props: {},
  },
];
