import { lazy } from "react";
import { lazyRetry } from "../utils/lazyRetry";
import {
  ROUTE_PROVINCE_SUPERVISOR_ROUTE_ALLOCATIONS,
  ROUTE_PROVINCE_SUPERVISOR_ROUTE_FILES_STATE,
  ROUTE_PROVINCE_SUPERVISOR_ROUTE_GUILDS,
  ROUTE_PROVINCE_SUPERVISOR_ROUTE_GUILDS_SETTINGS,
  ROUTE_PROVINCE_SUPERVISOR_ROUTE_MANAGE_GUILDS,
  ROUTE_PROVINCE_SUPERVISOR_ROUTE_STEWARDS,
  ROUTE_PROVINCE_SUPERVISOR_STATICS,
  ROUTE_PROVINCE_SUPERVISOR_REQUESTS,
  ROUTE_PROVINCE_SUPERVISOR_HATCHING,
  ROUTE_PROVINCE_SUPERVISOR_REPORTING,
  ROUTE_PROVINCE_SUPERVISORـHATCHINGS,
  ROUTE_PROVINCE_SUPERVISOR_STATICS_CHARTS,
  ROUTE_PROVINCE_SUPERVISOR_STATICS_PREDICTION,
  ROUTE_PROVINCE_SUPERVISOR_STATICS_PREDICTION_VIEW,
  ROUTE_PROVINCE_SUPERVISOR_DASHBOARD,
  ROUTE_PROVINCE_SUPERVISORـHATCHINGS_DETAILS,
  ROUTE_PROVINCE_SUPERVISOR_PRICING,
  ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_DETAILS,
  ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_FARM,
  ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_FARM_DETAILS,
  ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO,
  ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_HATCHING_DETAILS,
  ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_SLAUGHTER,
  ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_SLAUGHTER_DETAILS,
  ROUTE_PROVINCE_SUPERVISOR_DISPENSERS,
  ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_MANAGEMENT,
  ROUTE_PROVINCE_SUPERVISOR_DISPENSER_DETAILS_VIEW,
  ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STEWARDS,
  ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_KILLHOUSES,
  ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_SELL_CARCASS,
  ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_INVENTORY,
  ROUTE_PROVINCE_SUPERVISOR_SALE_DESTRIBUTION_DETAILS,
  ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STOCK_KILLHOUSE,
  ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STOCK_STEWARD,
  ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STOCK_GUILD,
  ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STOCK,
  ROUTE_PROVINCE_SUPERVISOR_REQUEST_DISTRIBUTION,
  ROUTE_PROVINCE_SUPERVISOR_REQUEST_TRANSACTIONS,
} from "./routes";

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

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 Reports = lazy(() => lazyRetry(() => import("../pages/ProvinceReports")));

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

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

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

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

const ProvinceDispensersStockSlug = lazy(() =>
  lazyRetry(() =>
    import(
      "../features/province/components/province-dispensers-stock-slug/ProvinceDispensersStockSlug"
    )
  )
);

const DispensersStock = lazy(() =>
  lazyRetry(() =>
    import(
      "../features/province/components/province-dispensers-stock/ProvinceDispensersStock"
    )
  )
);

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

export const provinceSupervisorRouting = [
  {
    path: [ROUTE_PROVINCE_SUPERVISOR_REQUESTS],
    Page: Commerce,
    exact: false,
    props: {},
  },
  {
    path: [
      ROUTE_PROVINCE_SUPERVISOR_ROUTE_MANAGE_GUILDS,
      ROUTE_PROVINCE_SUPERVISOR_ROUTE_GUILDS,
      ROUTE_PROVINCE_SUPERVISOR_ROUTE_STEWARDS,
      ROUTE_PROVINCE_SUPERVISOR_ROUTE_GUILDS_SETTINGS,
    ],
    Page: Guilds,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_PROVINCE_SUPERVISOR_PRICING],
    Page: ProvinceManagePricing,
    exact: false,
    props: {},
  },
  {
    path: [
      ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_DETAILS,
      ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_FARM,
      ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_FARM_DETAILS,
    ],
    Page: OperatorHatching,
    exact: false,
    props: {},
  },
  {
    path: [
      ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO,
      ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_HATCHING_DETAILS,
      ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_SLAUGHTER,
      ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_SLAUGHTER_DETAILS,
    ],
    Page: NationalInfo,
    exact: false,
    props: {},
  },

  {
    path: [ROUTE_PROVINCE_SUPERVISOR_ROUTE_FILES_STATE],
    Page: FilesState,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_PROVINCE_SUPERVISOR_ROUTE_ALLOCATIONS],
    Page: VetFarmAllocations,
    exact: false,
    props: {},
  },
  {
    path: [
      ROUTE_PROVINCE_SUPERVISOR_STATICS,
      ROUTE_PROVINCE_SUPERVISOR_STATICS_PREDICTION,
      ROUTE_PROVINCE_SUPERVISOR_STATICS_PREDICTION_VIEW,
      ROUTE_PROVINCE_SUPERVISOR_STATICS_CHARTS,
    ],
    Page: Statics,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_PROVINCE_SUPERVISOR_HATCHING],
    Page: Hatching,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_PROVINCE_SUPERVISOR_REPORTING],
    Page: Reports,
    exact: false,
    props: {},
  },
  {
    path: [
      ROUTE_PROVINCE_SUPERVISORـHATCHINGS,
      ROUTE_PROVINCE_SUPERVISORـHATCHINGS_DETAILS,
    ],
    Page: AllHatchings,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_PROVINCE_SUPERVISOR_DASHBOARD],
    Page: DashboardPage,
    exact: false,
    props: {},
  },
  {
    path: [
      ROUTE_PROVINCE_SUPERVISOR_DISPENSERS,
      ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_MANAGEMENT,
      ROUTE_PROVINCE_SUPERVISOR_DISPENSER_DETAILS_VIEW,
      ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STEWARDS,
      ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_KILLHOUSES,
      ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_SELL_CARCASS,
      ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_INVENTORY,
      ROUTE_PROVINCE_SUPERVISOR_SALE_DESTRIBUTION_DETAILS,
      ROUTE_PROVINCE_SUPERVISOR_REQUEST_DISTRIBUTION,
    ],
    Page: Dispensers,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STOCK],
    Page: DispensersStock,
    exact: false,
    props: {},
  },
  {
    path: [
      ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STOCK_KILLHOUSE,
      ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STOCK_STEWARD,
      ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STOCK_GUILD,
    ],
    Page: ProvinceDispensersStockSlug,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_PROVINCE_SUPERVISOR_REQUEST_TRANSACTIONS],
    Page: TransactionsPage,
    exact: false,
    props: {},
  },
  // {
  //   path: [ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_INVENTORY],
  //   Page: SlaughterHouseDispenserDashboard,
  //   exact: false,
  //   props: {},
  // },
];
