import React, { useState } from 'react'; import ReportDashboard from './components/ReportDashboard'; import ModelsOverview from './components/ModelsOverview'; import HeroSection from './components/HeroSection'; import StatsGrid from './components/StatsGrid'; import FeaturesGrid from './components/FeaturesGrid'; import UploadZone from './components/UploadZone'; import AnalysisTerminal from './components/AnalysisTerminal'; import Toast from './components/Toast'; import { useAnalysisPipeline } from './hooks/useAnalysisPipeline'; import { Shield, Zap, ScanSearch, Info, Database, GitBranch, History, ChevronRight } from 'lucide-react'; import { useHistory } from './hooks/useHistory'; import Footer from './components/Footer'; import HowItWorks from './components/HowItWorks'; function App() { const { file, status, progress, telemetry, logs, jobId, result, error, setError, handleFileUpload, resetApp, setJobId, setResult, setStatus } = useAnalysisPipeline(); const { history, saveToHistory, clearHistory } = useHistory(); const [activeNav, setActiveNav] = useState('analyze'); // Save to history automatically when a job completes React.useEffect(() => { if (status === 'complete' && result && jobId) { saveToHistory(jobId, result, file?.name); } }, [status, result, jobId]); const loadHistoryItem = (item) => { // Fake reloading the state to view a past report setJobId(item.jobId); // Note: To fully reload, we either need the full result object saved in history (which is huge), // or we fetch it from the backend using the jobId. // For now, let's just use it to show past jobs. If they want to reload, they can click it. }; return ( <> {error && ( setError(null)} /> )} {/* Navigation Bar */}
{/* ====== ANALYZE TAB ====== */} {activeNav === 'analyze' && ( <> {/* IDLE STATE: Hero + Upload */} {status === 'idle' && ( <>
)} {/* PROCESSING STATE */} {(status === 'uploading' || status === 'processing') && ( )} {/* COMPLETE STATE */} {status === 'complete' && result && ( )} )} {/* ====== MODELS TAB ====== */} {activeNav === 'models' && } {/* ====== ABOUT TAB ====== */} {activeNav === 'about' && ( { setActiveNav('analyze'); resetApp(); }} /> )} {/* ====== HISTORY TAB ====== */} {activeNav === 'history' && (

Recent Scans

Your analysis history is stored securely in your browser.

{history.length === 0 ? (

No history yet

Analyze your first media file to see it here.

) : (
{history.map((item, idx) => (

{item.fileName} 0.55 ? 'var(--danger-glow)' : 'var(--success-glow)', color: item.score > 0.55 ? 'var(--danger)' : 'var(--success)', border: `1px solid ${item.score > 0.55 ? 'var(--danger)' : 'var(--success)'}33` }}> {item.verdict}

ID: {item.jobId.substring(0,8)}... Date: {new Date(item.date).toLocaleString()}
0.55 ? 'var(--danger)' : 'var(--success)' }}> {(item.score * 100).toFixed(1)}%
AI Confidence
))}
)}
)}