diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index ba4fbf9..91d8c48 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -1,11 +1,18 @@ import React, { Suspense, useMemo, lazy } from "react"; import { createTheme, ThemeProvider } from "@mui/material/styles"; import { CssBaseline } from "@mui/material"; -import { BrowserRouter, Routes, Route } from "react-router"; +import { BrowserRouter, Routes, Route, Navigate } from "react-router"; import Sidebar from "./components/Sidebar"; -const Baseline = lazy(() => import("./components/Baseline")); -const SecurityTools = lazy(() => import("./components/securitytools")); + +const HomePage = lazy(() => import("./pages/HomePage")); +const ApplicationsPage = lazy(() => import("./pages/ApplicationsPage")); +const BaselinePage = lazy(() => import("./pages/BaselinePage")); +const CSVProcessingPage = lazy(() => import("./pages/CSVProcessingPage")); +const NetworkingPage = lazy(() => import("./pages/NetworkingPage")); +const SecurityToolsPage = lazy(() => import("./pages/SecurityToolsPage")); +const SettingsConfigPage = lazy(() => import("./pages/SettingsConfigPage")); +const VirusTotalPage = lazy(() => import("./pages/VirusTotalPage")); function App() { @@ -22,19 +29,28 @@ function App() { return ( -
- -
- + + +
+ +
Loading...
}> - } /> - } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + + } /> - +
-
+
); } diff --git a/frontend/src/components/Sidebar.jsx b/frontend/src/components/Sidebar.jsx index 185871f..df47db3 100644 --- a/frontend/src/components/Sidebar.jsx +++ b/frontend/src/components/Sidebar.jsx @@ -1,4 +1,5 @@ import React, { useState } from 'react'; +import { useNavigate } from 'react-router'; import { ShieldCheck, Server, Bug, Lock, Globe, Settings, ChevronDown, ChevronRight, Folder @@ -8,15 +9,27 @@ import BugReportIcon from '@mui/icons-material/BugReport'; import EngineeringIcon from '@mui/icons-material/Engineering'; -const SidebarItem = ({ icon: Icon, label, children }) => { +const SidebarItem = ({ icon: Icon, label, href, children }) => { const [open, setOpen] = useState(false); const hasChildren = !!children; + const navigate = useNavigate(); + + const handleClick = () => { + if (hasChildren) { + setOpen(!open); + } + + if (href) { + navigate(href); + } + }; + return (
hasChildren && setOpen(!open)} + onClick={handleClick} >
@@ -38,18 +51,18 @@ const SidebarItem = ({ icon: Icon, label, children }) => { const Sidebar = () => (

Threat Hunt Dashboard

- - - - - + + + + +
Anti Virus
Endpoint Detection & Response
Virtual Private Networks
- - + +
); diff --git a/frontend/src/components/Applications.js b/frontend/src/pages/ApplicationsPage.jsx similarity index 54% rename from frontend/src/components/Applications.js rename to frontend/src/pages/ApplicationsPage.jsx index fe57f2e..9bb439e 100644 --- a/frontend/src/components/Applications.js +++ b/frontend/src/pages/ApplicationsPage.jsx @@ -1,7 +1,7 @@ import React from 'react'; -const Applications = () => { +const ApplicationsPage = () => { return
Applications Placeholder
; }; -export default Applications; +export default ApplicationsPage; diff --git a/frontend/src/components/Baseline.jsx b/frontend/src/pages/BaselinePage.jsx similarity index 98% rename from frontend/src/components/Baseline.jsx rename to frontend/src/pages/BaselinePage.jsx index e63a002..82e94a1 100644 --- a/frontend/src/components/Baseline.jsx +++ b/frontend/src/pages/BaselinePage.jsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from "react"; import axios from "axios"; -const Baseline = () => { +const BaselinePage = () => { const [data, setData] = useState([]); useEffect(() => { @@ -77,4 +77,4 @@ const Baseline = () => { ); }; -export default Baseline; +export default BaselinePage; diff --git a/frontend/src/components/CSVProcessing.js b/frontend/src/pages/CSVProcessingPage.jsx similarity index 54% rename from frontend/src/components/CSVProcessing.js rename to frontend/src/pages/CSVProcessingPage.jsx index 7c62e6d..6d554f5 100644 --- a/frontend/src/components/CSVProcessing.js +++ b/frontend/src/pages/CSVProcessingPage.jsx @@ -1,7 +1,7 @@ import React from 'react'; -const CSVProcessing = () => { +const CSVProcessingPage = () => { return
CSV Processing Placeholder
; }; -export default CSVProcessing; +export default CSVProcessingPage; diff --git a/frontend/src/components/HomePage.js b/frontend/src/pages/HomePage.jsx similarity index 100% rename from frontend/src/components/HomePage.js rename to frontend/src/pages/HomePage.jsx diff --git a/frontend/src/components/Networking.js b/frontend/src/pages/NetworkingPage.jsx similarity index 55% rename from frontend/src/components/Networking.js rename to frontend/src/pages/NetworkingPage.jsx index 0892a14..ed8441a 100644 --- a/frontend/src/components/Networking.js +++ b/frontend/src/pages/NetworkingPage.jsx @@ -1,7 +1,7 @@ import React from 'react'; -const Networking = () => { +const NetworkingPage = () => { return
Networking Placeholder
; }; -export default Networking; +export default NetworkingPage; diff --git a/frontend/src/components/securitytools.jsx b/frontend/src/pages/SecurityToolsPage.jsx similarity index 96% rename from frontend/src/components/securitytools.jsx rename to frontend/src/pages/SecurityToolsPage.jsx index 369a86d..8d15ee5 100644 --- a/frontend/src/components/securitytools.jsx +++ b/frontend/src/pages/SecurityToolsPage.jsx @@ -1,7 +1,7 @@ import React, { useState, useCallback } from "react"; import { useDropzone } from "react-dropzone"; -const SecurityTools = () => { +const SecurityToolsPage = () => { const [uploadStatus, setUploadStatus] = useState(null); const [analysisResult, setAnalysisResult] = useState(null); @@ -61,4 +61,4 @@ const SecurityTools = () => { ); }; -export default SecurityTools; +export default SecurityToolsPage; diff --git a/frontend/src/components/SettingsConfig.js b/frontend/src/pages/SettingsConfigPage.jsx similarity index 54% rename from frontend/src/components/SettingsConfig.js rename to frontend/src/pages/SettingsConfigPage.jsx index c699255..089b53c 100644 --- a/frontend/src/components/SettingsConfig.js +++ b/frontend/src/pages/SettingsConfigPage.jsx @@ -1,7 +1,7 @@ import React from 'react'; -const SettingsConfig = () => { +const SettingsConfigPage = () => { return
Settings & Config Placeholder
; }; -export default SettingsConfig; +export default SettingsConfigPage; diff --git a/frontend/src/components/VirusTotal.js b/frontend/src/pages/VirusTotalPage.jsx similarity index 56% rename from frontend/src/components/VirusTotal.js rename to frontend/src/pages/VirusTotalPage.jsx index 67f8ea4..0e50b97 100644 --- a/frontend/src/components/VirusTotal.js +++ b/frontend/src/pages/VirusTotalPage.jsx @@ -1,7 +1,7 @@ import React from 'react'; -const VirusTotal = () => { +const VirusTotalPage = () => { return
Virus Total Placeholder
; }; -export default VirusTotal; +export default VirusTotalPage;