import { lazy, LazyExoticComponent } from "react";

interface RouteProps {
  path: string;
  ComponentElement: LazyExoticComponent<React.FC<any>>;
  LayoutClassName?: string;
  isLayoutExist?: boolean;
}

const createRoute = (
    path: string,
    ComponentElement: LazyExoticComponent<React.FC<any>>,
    LayoutClassName?: string,
    isLayoutExist: boolean = true
  ): RouteProps => ({
    path,
    ComponentElement,
    LayoutClassName,
    isLayoutExist
  });
  
  export const routesArray: RouteProps[] = [
    createRoute("*", lazy(() => import("../Layout/NotFound"))),

    createRoute("", lazy(() => import("../Pages/Home/Page"))),
    createRoute("contact", lazy(() => import("../Pages/Contact/Page"))),
    createRoute("about", lazy(() => import("../Pages/About/Page"))),
    createRoute("services", lazy(() => import("../Pages/Services/Page"))), 
    createRoute("Distributors", lazy(() => import("../Pages/Distributors/Page"))), 
    createRoute("document", lazy(() => import("../Pages/Document/Page"))), 
    createRoute("products", lazy(() => import("../Pages/Products/Page"))), 
    createRoute("product/:id", lazy(() => import("../Pages/SingleProduct/Page"))),    
    
    createRoute("privacy", lazy(() => import("../Pages/Privacy/Page"))),    
    createRoute("terms", lazy(() => import("../Pages/Terms/Page"))), 
  ];
  