import React, { useState, Suspense } from 'react'; import { HashRouter, Routes, Route, useNavigate, Navigate } from 'react-router-dom'; import { FileText, FileUp, Clock, LogOut, Loader2, CheckCircle2, Shield, Activity, Lock, Terminal } from 'lucide-react'; import { Header } from './components/Header'; import { Sidebar } from './components/Sidebar'; import { RedactionCard } from './components/RedactionCard'; import { useThemeStore } from './store/theme'; // Lazy loading components for code splitting & bundle reduction const TextRedaction = React.lazy(() => import('./pages/TextRedaction').then(m => ({ default: m.TextRedaction }))); const PDFRedaction = React.lazy(() => import('./pages/PDFRedaction').then(m => ({ default: m.PDFRedaction }))); const History = React.lazy(() => import('./pages/History').then(m => ({ default: m.History }))); const AccountDetails = React.lazy(() => import('./pages/AccountDetails').then(m => ({ default: m.AccountDetails }))); const HowToUse = React.lazy(() => import('./pages/HowToUse').then(m => ({ default: m.HowToUse }))); const AboutUs = React.lazy(() => import('./pages/AboutUs').then(m => ({ default: m.AboutUs }))); const ContactUs = React.lazy(() => import('./pages/ContactUs').then(m => ({ default: m.ContactUs }))); const RegisterPage = React.lazy(() => import('./pages/Register')); const LoginPage = React.lazy(() => import('./pages/Login')); const LandingPage = React.lazy(() => import('./pages/Landing').then(m => ({ default: m.Landing }))); function PageLoader() { return (

Loading Module...

); } function ProtectedRoute({ children }: { children: React.ReactElement }) { const token = localStorage.getItem('token'); if (!token) { return ; } return children; } function Home() { const navigate = useNavigate(); const redactionOptions = [ { icon: FileText, title: 'Text Redaction', description: 'Obfuscate PII, Indian numbers, names, and custom confidential text in real-time.', path: '/text-redaction', }, { icon: FileUp, title: 'File Redaction', description: 'Sanitize PDF documents, Word files, Excel spreadsheets, and scanned images offline.', path: '/pdf-redaction', }, { icon: Clock, title: 'History', description: 'Review your recent redaction logs and processed files stored in local memory.', path: '/history', }, ]; const handleLogout = () => { localStorage.removeItem('token'); window.location.href = '/#/login'; }; return (
{/* Dynamic Ambient Background Animations */}
{/* Hero Welcome Banner */}
Security Console Active

Welcome to RE-DACT

Your localized workspace for stripping sensitive personal identifiers, Indian regulatory numbers, and financial data using advanced offline NLP and synthetic anonymization.

{/* Live Status Indicators */}
100% Offline
Trained and Finetuned Models
Zero Data Retention
5 Redaction Levels
{/* Module Selection Section */}

Select Sanitization Module

Choose a module to launch
{redactionOptions.map((option) => ( navigate(option.path)} /> ))}
); } function App() { const [isSidebarOpen, setIsSidebarOpen] = useState(false); const { theme } = useThemeStore(); return (
}> <>
setIsSidebarOpen(true)} /> setIsSidebarOpen(false)} /> } /> } /> <>
setIsSidebarOpen(true)} /> setIsSidebarOpen(false)} /> } /> <>
setIsSidebarOpen(true)} /> setIsSidebarOpen(false)} /> } /> <>
setIsSidebarOpen(true)} /> setIsSidebarOpen(false)} /> } /> <>
setIsSidebarOpen(true)} /> setIsSidebarOpen(false)} /> } /> <>
setIsSidebarOpen(true)} /> setIsSidebarOpen(false)} /> } /> <>
setIsSidebarOpen(true)} /> setIsSidebarOpen(false)} /> } /> <>
setIsSidebarOpen(true)} /> setIsSidebarOpen(false)} /> } /> } /> } /> } />
); } export default App;