import { lazy } from "react";
import { lazyRetry } from "../utils/lazyRetry";
import {
  ROUTE_STEWARD_INVENTORY,
  ROUTE_STEWARD_SALE_IN_PROVINCE,
  ROUTE_STEWARD_INVENTORY_STOCK,
  ROUTE_JAHAD_FILES_STATE,
  ROUTE_STEWARD_MANAGE_GUILDS,
  ROUTE_STEWARD_DAILY_LIST,
  ROUTE_STEWARD_PURCHASE_OUT_PROVINCE,
  ROUTE_STEWARD_SALE_OUT_PROVINCE,
  ROUTE_STEWARD_SEGMENT,
  ROUTE_STEWARD_ROUTE_MANAGE_DISPENSERS,
  ROUTE_STEWARD_ROUTE_MANAGE_DELEGATES,
  ROUTE_STEWARD_ROUTE_DEVICES,
  ROUTE_STEWARD_ROUTE_SUB_UNITS,
} from "./routes";
const FilesState = lazy(() => lazyRetry(() => import("../pages/FilesState")));

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

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

const ManageDispensers = lazy(() =>
  lazyRetry(() =>
    import(
      "../features/slaughter-house/components/slaughter-manage-dispensers/SlaughterManageDispensers"
    )
  )
);

const ManageDelegates = lazy(() =>
  lazyRetry(() =>
    import(
      "../features/slaughter-house/components/slaughter-manage-delegates/SlaughterManageDelegates"
    )
  )
);

const PspDevices = lazy(() =>
  lazyRetry(() =>
    import("../features/guild/components/guild-psp-devices/GuildPspDevices")
  )
);

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

export const stewardRouting = [
  {
    path: [ROUTE_JAHAD_FILES_STATE],
    Page: FilesState,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_STEWARD_MANAGE_GUILDS],
    Page: ManageGuilds,
    exact: false,
    props: {},
  },
  {
    path: [
      ROUTE_STEWARD_INVENTORY,
      ROUTE_STEWARD_SALE_IN_PROVINCE,
      ROUTE_STEWARD_INVENTORY_STOCK,
      ROUTE_STEWARD_PURCHASE_OUT_PROVINCE,
      ROUTE_STEWARD_SALE_OUT_PROVINCE,
      ROUTE_STEWARD_DAILY_LIST,
      ROUTE_STEWARD_SEGMENT,
    ],
    Page: StewardInventoryPage,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_STEWARD_ROUTE_SUB_UNITS],
    Page: SubUnits,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_STEWARD_ROUTE_MANAGE_DISPENSERS],
    Page: ManageDispensers,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_STEWARD_ROUTE_MANAGE_DELEGATES],
    Page: ManageDelegates,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_STEWARD_ROUTE_DEVICES],
    Page: PspDevices,
    exact: false,
    props: {},
  },
];
