import { lazy } from "react";
import { lazyRetry } from "../utils/lazyRetry";
import {
  ROUTE_LIVE_STOCK_COLD_HOUSE,
  ROUTE_LIVE_STOCK_FREEZING_REQUESTS,
  ROUTE_LIVE_STOCK_SUPPORT_MANAGE_BARS,
  ROUTE_LIVE_STOCK_SUPPORT_ROUTE_FILES_STATE,
} from "./routes";

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

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

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

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

export const liveStockSupportRouting = [
  {
    path: [ROUTE_LIVE_STOCK_SUPPORT_MANAGE_BARS],
    Page: Bars,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_LIVE_STOCK_SUPPORT_ROUTE_FILES_STATE],
    Page: Cases,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_LIVE_STOCK_FREEZING_REQUESTS],
    Page: Freezing,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_LIVE_STOCK_COLD_HOUSE],
    Page: ColdHouse,
    exact: false,
    props: {},
  },
];
