From be74399bcca6ed813323968c16af679e5311ffdd Mon Sep 17 00:00:00 2001 From: Gopichand Dandimeni Date: Tue, 6 Jan 2026 13:50:28 +0530 Subject: [PATCH] feat: add enhanced navigation system with active route indicators --- .../src/app/routes/AppRoutes.tsx | 18 +++-- .../Dashboard/V1/Component/Pages/APIPage.tsx | 53 +++++++++++++ .../Dashboard/V1/Component/Pages/ChatPage.tsx | 25 +++++++ .../V1/Component/Pages/DocumentsPage.tsx | 35 +++++++++ .../V1/Component/Pages/SettingsPage.tsx | 48 ++++++++++++ .../src/shared/component/v1/Breadcrumb.tsx | 60 +++++++++++++++ .../src/shared/component/v1/Navbar.tsx | 75 ++++++++++++++----- 7 files changed, 287 insertions(+), 27 deletions(-) create mode 100644 LocalMind-Frontend/src/features/Dashboard/V1/Component/Pages/APIPage.tsx create mode 100644 LocalMind-Frontend/src/features/Dashboard/V1/Component/Pages/ChatPage.tsx create mode 100644 LocalMind-Frontend/src/features/Dashboard/V1/Component/Pages/DocumentsPage.tsx create mode 100644 LocalMind-Frontend/src/features/Dashboard/V1/Component/Pages/SettingsPage.tsx create mode 100644 LocalMind-Frontend/src/shared/component/v1/Breadcrumb.tsx diff --git a/LocalMind-Frontend/src/app/routes/AppRoutes.tsx b/LocalMind-Frontend/src/app/routes/AppRoutes.tsx index af480f1..7970da0 100644 --- a/LocalMind-Frontend/src/app/routes/AppRoutes.tsx +++ b/LocalMind-Frontend/src/app/routes/AppRoutes.tsx @@ -2,6 +2,10 @@ import React from 'react' import { Route, Routes } from 'react-router-dom' import HomePage from '../../features/Dashboard/V1/Component/Pages/HomePage' import LoginPage from '../../shared/component/v1/LoginPage' +import ChatPage from '../../features/Dashboard/V1/Component/Pages/ChatPage' +import DocumentsPage from '../../features/Dashboard/V1/Component/Pages/DocumentsPage' +import SettingsPage from '../../features/Dashboard/V1/Component/Pages/SettingsPage' +import APIPage from '../../features/Dashboard/V1/Component/Pages/APIPage' const AppRoutes: React.FC = () => { return ( @@ -9,16 +13,16 @@ const AppRoutes: React.FC = () => { {/* Homepage */} } /> - {/* Sign Up / Login Page */} - } /> + {/* Main Application Pages */} + } /> + } /> + } /> + } /> - {/* Register Page - TODO: Create dedicated RegisterPage component */} + {/* Authentication Pages */} + } /> } /> - - {/* Forgot Password Page - TODO: Create ForgotPasswordPage component */} } /> - - {/* Chat Page */} ) } diff --git a/LocalMind-Frontend/src/features/Dashboard/V1/Component/Pages/APIPage.tsx b/LocalMind-Frontend/src/features/Dashboard/V1/Component/Pages/APIPage.tsx new file mode 100644 index 0000000..9c09dc4 --- /dev/null +++ b/LocalMind-Frontend/src/features/Dashboard/V1/Component/Pages/APIPage.tsx @@ -0,0 +1,53 @@ +import React from 'react' +import Breadcrumb from '../../../../../shared/component/v1/Breadcrumb' + +const APIPage: React.FC = () => { + return ( +
+
+ +
+

API Information

+

Manage API keys and view documentation

+
+ +
+
+

API Keys

+
+
+
+

Production Key

+

lm_****************************

+
+ +
+
+ +
+ +
+

API Endpoints

+
+
+ POST /api/v1/chat/send-message +
+
+ GET /api/v1/upload/files +
+
+ PUT /api/v1/user/ai-config +
+
+
+
+
+
+ ) +} + +export default APIPage \ No newline at end of file diff --git a/LocalMind-Frontend/src/features/Dashboard/V1/Component/Pages/ChatPage.tsx b/LocalMind-Frontend/src/features/Dashboard/V1/Component/Pages/ChatPage.tsx new file mode 100644 index 0000000..2a8d295 --- /dev/null +++ b/LocalMind-Frontend/src/features/Dashboard/V1/Component/Pages/ChatPage.tsx @@ -0,0 +1,25 @@ +import React from 'react' +import Breadcrumb from '../../../../../shared/component/v1/Breadcrumb' + +const ChatPage: React.FC = () => { + return ( +
+
+ +
+

Chat Interface

+

Interact with AI models in real-time

+
+ +
+
+

Chat Interface Coming Soon

+

Real-time AI chat system will be available here

+
+
+
+
+ ) +} + +export default ChatPage \ No newline at end of file diff --git a/LocalMind-Frontend/src/features/Dashboard/V1/Component/Pages/DocumentsPage.tsx b/LocalMind-Frontend/src/features/Dashboard/V1/Component/Pages/DocumentsPage.tsx new file mode 100644 index 0000000..336a4d7 --- /dev/null +++ b/LocalMind-Frontend/src/features/Dashboard/V1/Component/Pages/DocumentsPage.tsx @@ -0,0 +1,35 @@ +import React from 'react' +import Breadcrumb from '../../../../../shared/component/v1/Breadcrumb' + +const DocumentsPage: React.FC = () => { + return ( +
+
+ +
+

Document Upload & RAG

+

Upload documents and train your AI with custom data

+
+ +
+
+

Upload Documents

+
+

Drag & drop files here or click to browse

+

Supported: Excel, CSV, PDF, TXT

+
+
+ +
+

Uploaded Files

+
+

No files uploaded yet

+
+
+
+
+
+ ) +} + +export default DocumentsPage \ No newline at end of file diff --git a/LocalMind-Frontend/src/features/Dashboard/V1/Component/Pages/SettingsPage.tsx b/LocalMind-Frontend/src/features/Dashboard/V1/Component/Pages/SettingsPage.tsx new file mode 100644 index 0000000..e314442 --- /dev/null +++ b/LocalMind-Frontend/src/features/Dashboard/V1/Component/Pages/SettingsPage.tsx @@ -0,0 +1,48 @@ +import React from 'react' +import Breadcrumb from '../../../../../shared/component/v1/Breadcrumb' + +const SettingsPage: React.FC = () => { + return ( +
+
+ +
+

Model Configuration

+

Configure AI models and API settings

+
+ +
+
+

Local Models (Ollama)

+
+
+
+

LLaMA 2

+

7B parameter model

+
+ Available +
+
+
+ +
+

Cloud Models

+
+
+
+

Google Gemini

+

Configure API key

+
+ +
+
+
+
+
+
+ ) +} + +export default SettingsPage \ No newline at end of file diff --git a/LocalMind-Frontend/src/shared/component/v1/Breadcrumb.tsx b/LocalMind-Frontend/src/shared/component/v1/Breadcrumb.tsx new file mode 100644 index 0000000..34492f3 --- /dev/null +++ b/LocalMind-Frontend/src/shared/component/v1/Breadcrumb.tsx @@ -0,0 +1,60 @@ +import React from 'react' +import { Link, useLocation } from 'react-router-dom' + +interface BreadcrumbItem { + label: string + path: string +} + +const Breadcrumb: React.FC = () => { + const location = useLocation() + + const getBreadcrumbs = (): BreadcrumbItem[] => { + const pathMap: Record = { + '/': 'Home', + '/chat': 'Chat Interface', + '/documents': 'Documents & RAG', + '/settings': 'Model Settings', + '/api': 'API Information' + } + + const currentPath = location.pathname + const breadcrumbs: BreadcrumbItem[] = [] + + if (currentPath !== '/') { + breadcrumbs.push({ label: 'Home', path: '/' }) + } + + if (pathMap[currentPath]) { + breadcrumbs.push({ label: pathMap[currentPath], path: currentPath }) + } + + return breadcrumbs + } + + const breadcrumbs = getBreadcrumbs() + + if (breadcrumbs.length <= 1) return null + + return ( + + ) +} + +export default Breadcrumb \ No newline at end of file diff --git a/LocalMind-Frontend/src/shared/component/v1/Navbar.tsx b/LocalMind-Frontend/src/shared/component/v1/Navbar.tsx index bfe080a..f556ad4 100644 --- a/LocalMind-Frontend/src/shared/component/v1/Navbar.tsx +++ b/LocalMind-Frontend/src/shared/component/v1/Navbar.tsx @@ -1,39 +1,74 @@ import React from 'react' import Artificialintelligence from '../../../assets/Artificial intelligence.png' -import { NavLink } from 'react-router-dom' +import { NavLink, useLocation } from 'react-router-dom' const Navbar: React.FC = () => { + const location = useLocation() + const isAppRoute = ['/chat', '/documents', '/settings', '/api'].includes(location.pathname) + const navLinkClass = ({ isActive }: { isActive: boolean }) => - isActive ? 'text-white line-through opacity-80' : 'text-white' + `px-4 py-2 rounded-lg font-medium transition-all duration-200 ${ + isActive + ? 'bg-blue-600 text-white shadow-lg' + : 'text-gray-300 hover:text-white hover:bg-zinc-700/50' + }` + + const publicNavLinkClass = ({ isActive }: { isActive: boolean }) => + isActive ? 'text-white border-b-2 border-blue-500' : 'text-gray-300 hover:text-white' return ( -
+
LocalMind logo -

LocalMind

+ + LocalMind +
-
- - Home - - - Docs - - - Models - - - PlayGround - +
+ {isAppRoute ? ( + // App Navigation (when user is in main app sections) + <> + + 💬 Chat + + + 📚 Documents + + + ⚙️ Settings + + + 🔌 API + + + ) : ( + // Public Navigation (for homepage, etc.) + <> + + Home + + + Chat + + + Documents + + + Settings + + + )}
- isActive - ? 'bg-blue-600 text-white px-8 py-1.5 rounded-full font-medium transition-colors hover:bg-blue-700 whitespace-nowrap' - : 'bg-blue-500 text-white px-8 py-1.5 rounded-full font-medium transition-colors hover:bg-blue-600 whitespace-nowrap' + `px-6 py-2 rounded-full font-medium transition-all duration-200 whitespace-nowrap ${ + isActive + ? 'bg-blue-700 text-white shadow-lg' + : 'bg-blue-600 text-white hover:bg-blue-700 hover:shadow-lg' + }` } > Sign Up