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,
} 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"
    )
  )
);

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_MANAGE_DISPENSERS],
    Page: ManageDispensers,
    exact: false,
    props: {},
  },
];
