import { lazy } from "react";
import { lazyRetry } from "../utils/lazyRetry";
import {
  ROUTE_CHAIN_COMPANY_MANAGE_BARS,
  ROUTE_CHAIN_COMPANY_MANAGE_FEES,
  ROUTE_CHAIN_COMPANY_POULTRIES,
  ROUTE_CHAIN_COMPANY_POULTRIES_DETAILS,
} from "./routes";

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

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

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

export const chainCompanyRouting = [
  {
    path: [ROUTE_CHAIN_COMPANY_POULTRIES, ROUTE_CHAIN_COMPANY_MANAGE_BARS],
    Page: Poultries,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_CHAIN_COMPANY_MANAGE_FEES],
    Page: Fees,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_CHAIN_COMPANY_POULTRIES_DETAILS],
    Page: PoultriesDetails,
    exact: false,
    props: {},
  },
];
