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

const ActivityLog = lazy(() => import("./ActivityLog"));

export const activityLogRoutes = [
  <Route
    key="activity-log-redirect"
    path="/activity-log"
    element={<Navigate to="/activity-log/user-logs" replace />}
  />,
  <Route
    key="activity-log-section"
    path="/activity-log/:section"
    element={
      <ProtectedRoute>
        <LazyRoute>
          <ActivityLog />
        </LazyRoute>
      </ProtectedRoute>
    }
  />,
];
