import React, { lazy } from "react";
import { Route } from "react-router-dom";
import ProtectedRoute from "../components/auth/ProtectedRoute";
import { LazyRoute } from "../components/common/LazyRoute";

const AddSite = lazy(() => import("./AddSite"));
const AddWorkarea = lazy(() => import("./AddWorkarea"));

export const siteAndWorkareaRoutes = [
  <Route
    key="add-site"
    path="/add-site"
    element={
      <ProtectedRoute>
        <LazyRoute>
          <AddSite />
        </LazyRoute>
      </ProtectedRoute>
    }
  />,
  <Route
    key="add-workarea"
    path="/add-workarea"
    element={
      <ProtectedRoute>
        <LazyRoute>
          <AddWorkarea />
        </LazyRoute>
      </ProtectedRoute>
    }
  />,
];
