import { lazy } from "react";
import { lazyRetry } from "../utils/lazyRetry";
import {
  ROUTE_CITY_DISPENSERS,
  ROUTE_CITY_DISPENSERS_INVENTORY,
  ROUTE_CITY_POULTRY_HATCHING,
  ROUTE_CITY_POULTRY_ROUTE_ALLOCATIONS,
  ROUTE_CITY_POULTRY_ROUTE_FILES_STATE,
  ROUTE_CITY_POULTRY_ROUTE_GUILDS,
  ROUTE_CITY_POULTRY_ROUTE_GUILDS_SETTINGS,
  ROUTE_CITY_POULTRY_ROUTE_MANAGE_GUILDS,
  ROUTE_CITY_POULTRY_ROUTE_STEWARDS,
  ROUTE_CITY_POULTRY_STATICS,
  ROUTE_CITY_POULTRYـHATCHINGS,
  ROUTE_CITY_POULTRYـHATCHINGS_DETAILS,
  ROUTE_CITY_REQUEST_DISTRIBUTION,
  ROUTE_CITY_REQUEST_TRANSACTION_DETAILS,
  ROUTE_CITY_REQUEST_TRANSACTIONS,
} from "./routes";

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

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

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

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

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

export const cityPoultryRouting = [
  {
    path: [ROUTE_CITY_POULTRY_STATICS],
    Page: Statics,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_CITY_POULTRY_ROUTE_FILES_STATE],
    Page: FilesState,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_CITY_POULTRY_ROUTE_ALLOCATIONS],
    Page: VetFarmAllocations,
    exact: false,
    props: {},
  },
  {
    path: [
      ROUTE_CITY_POULTRY_ROUTE_MANAGE_GUILDS,
      ROUTE_CITY_POULTRY_ROUTE_GUILDS,
      ROUTE_CITY_POULTRY_ROUTE_STEWARDS,
      ROUTE_CITY_POULTRY_ROUTE_GUILDS_SETTINGS,
    ],
    Page: Guilds,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_CITY_POULTRY_HATCHING],
    Page: Hatching,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_CITY_POULTRYـHATCHINGS, ROUTE_CITY_POULTRYـHATCHINGS_DETAILS],
    Page: AllHatchings,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_CITY_REQUEST_TRANSACTIONS],
    Page: TransactionsPage,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_CITY_DISPENSERS_INVENTORY],
    Page: SlaughterHouseDispenserDashboard,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_CITY_REQUEST_DISTRIBUTION],
    Page: SlaughterHouseDispenserDashboard,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_CITY_DISPENSERS],
    Page: SlaughterHouseDispenserDashboard,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_CITY_REQUEST_TRANSACTION_DETAILS],
    Page: TransactionsPage,
    exact: false,
    props: {},
  },
];
