import React, { useState, useEffect } from 'react';
import {
FileText,
Mic,
Image as ImageIcon,
CheckCircle,
Send,
Clock,
Search,
User,
Settings,
Menu,
X,
Sparkles,
ChevronRight,
ChevronLeft,
Save,
Download,
Upload,
MessageSquare,
BarChart3,
ThumbsUp,
ThumbsDown,
AlertCircle,
FileInput
} from 'lucide-react';
// --- Mock Data & Constants ---
const MOCK_IDFS = [
{
id: 'IDF-2026-001',
title: 'Adaptive Battery Management for EV Fleets',
inventor: 'Sarah Chen',
dateCreated: '2026-02-14',
status: 'Pending Review',
score: null,
description: 'A system for optimizing battery charging cycles based on fleet route prediction.',
problem: 'Current charging is static and degrades battery life.',
solution: 'We use machine learning to predict daily usage and limit charge accordingly.',
figures: ['sketch_01.jpg']
},
{
id: 'IDF-2026-002',
title: 'Holographic Display Overlay',
inventor: 'Mike Ross',
dateCreated: '2026-02-10',
status: 'Approved',
score: 85,
description: 'Method for projecting 3D overlays on standard glass surfaces.',
problem: 'AR requires expensive headsets.',
solution: 'Micro-projectors embedded in the bezel with a specialized film.',
figures: ['diagram_a.png']
},
{
id: 'IDF-2026-003',
title: 'Distributed Ledger for Supply Chain',
inventor: 'Sarah Chen',
dateCreated: '2026-01-22',
status: 'Drafting',
score: 92,
description: 'Blockchain implementation for tracking pharmaceutical provenance.',
problem: 'Counterfeit drugs entering the supply chain.',
solution: 'Immutable ledger with IoT sensor integration.',
figures: []
}
];
const AI_SUGGESTIONS = {
polish: "The disclosed embodiment relates to a system and method for adaptive battery management in electric vehicle fleets. Specifically, the system utilizes predictive machine learning algorithms to analyze historical route data and determine optimal charging thresholds, thereby extending battery longevity while ensuring operational readiness.",
clarification: "Could you specify the type of machine learning model used? (e.g., Neural Network, Random Forest) and what specific input parameters are collected from the vehicle?"
};
// --- Components ---
const Button = ({ children, onClick, variant = 'primary', icon: Icon, className = '', disabled = false }) => {
const baseStyle = "flex items-center justify-center px-4 py-2 rounded-lg font-medium transition-all duration-200";
const variants = {
primary: "bg-blue-600 text-white hover:bg-blue-700 shadow-sm hover:shadow-md disabled:bg-blue-300",
secondary: "bg-white text-slate-700 border border-slate-200 hover:bg-slate-50 disabled:bg-slate-100",
ghost: "text-slate-600 hover:bg-slate-100 disabled:text-slate-300",
success: "bg-emerald-600 text-white hover:bg-emerald-700 shadow-sm",
danger: "bg-red-600 text-white hover:bg-red-700 shadow-sm",
ai: "bg-gradient-to-r from-violet-600 to-indigo-600 text-white hover:from-violet-700 hover:to-indigo-700 shadow-md"
};
return (
{Icon && }
{children}
);
};
const Card = ({ children, className = '' }) => (
{children}
);
const Badge = ({ status }) => {
const styles = {
'Draft': 'bg-slate-100 text-slate-700',
'Pending Review': 'bg-amber-100 text-amber-800',
'Approved': 'bg-emerald-100 text-emerald-800',
'Rejected': 'bg-red-100 text-red-800',
'Drafting': 'bg-blue-100 text-blue-800'
};
return (
{status}
);
};
// --- Main Application ---
export default function IIDPApp() {
// State
const [userRole, setUserRole] = useState(null); // 'inventor', 'reviewer', or null (login)
const [activeTab, setActiveTab] = useState('dashboard');
const [idfs, setIdfs] = useState(MOCK_IDFS);
const [currentIdf, setCurrentIdf] = useState(null);
// --- Login Screen ---
if (!userRole) {
return (
StratIP Intelligent Platform
Secure Invention Disclosure & Review System
setUserRole('inventor')}
className="w-full p-4 border border-slate-200 rounded-xl hover:border-blue-500 hover:bg-blue-50 transition-all flex items-center group"
>
Login as Inventor
Submit new ideas & track status
setUserRole('reviewer')}
className="w-full p-4 border border-slate-200 rounded-xl hover:border-indigo-500 hover:bg-indigo-50 transition-all flex items-center group"
>
Login as Reviewer
Evaluate disclosures & IP strategy
© 2026 StratIP Technologies. All rights reserved.
);
}
// --- Main Layout ---
return (
{/* Sidebar */}
{ setActiveTab('dashboard'); setCurrentIdf(null); }}
/>
{userRole === 'inventor' && (
{ setActiveTab('new'); setCurrentIdf(null); }}
/>
)}
{userRole === 'inventor' ? 'SC' : 'MR'}
{userRole === 'inventor' ? 'Sarah Chen' : 'Mike Ross'}
{userRole}
setUserRole(null)}
className="w-full flex items-center justify-center px-4 py-2 text-xs font-medium bg-slate-800 hover:bg-slate-700 rounded-md transition-colors"
>
Sign Out
{/* Main Content */}
{/* Header */}
{/* Scrollable Content Area */}
{currentIdf ? (
// Detail View (Reviewer or Edit Mode)
setCurrentIdf(null)}
onUpdate={(updated) => {
setIdfs(idfs.map(i => i.id === updated.id ? updated : i));
setCurrentIdf(updated);
}}
/>
) : activeTab === 'new' ? (
// New Wizard
setActiveTab('dashboard')}
onComplete={(newIdf) => {
setIdfs([newIdf, ...idfs]);
setActiveTab('dashboard');
}}
/>
) : (
// Dashboard List
setCurrentIdf(idf)}
/>
)}
);
}
// --- Sub-Components ---
const SidebarItem = ({ icon: Icon, label, active, onClick }) => (
{label}
);
const DashboardView = ({ idfs, onSelectIdf, userRole }) => {
const filteredIDFs = userRole === 'inventor'
? idfs.filter(i => i.inventor === 'Sarah Chen')
: idfs; // Reviewer sees all
return (
i.status === 'Pending Review').length} icon={Clock} color="amber" />
{userRole === 'reviewer' ? (
) : (
i.status === 'Approved').length} icon={CheckCircle} color="emerald" />
)}
Recent Disclosures
View All
Docket ID
Title
Date
Status
{userRole === 'reviewer' && Score }
Action
{filteredIDFs.map((idf) => (
onSelectIdf(idf)}>
{idf.id}
{idf.title}
{idf.dateCreated}
{userRole === 'reviewer' && (
{idf.score ? idf.score : '-'}
)}
{userRole === 'reviewer' ? 'Review' : 'View'}
))}
);
};
const StatCard = ({ title, value, icon: Icon, color }) => {
const colorClasses = {
blue: "bg-blue-100 text-blue-600",
amber: "bg-amber-100 text-amber-600",
emerald: "bg-emerald-100 text-emerald-600"
};
return (
);
};
// --- Wizard Component for New IDF ---
const NewIDFWizard = ({ onCancel, onComplete }) => {
const [step, setStep] = useState(1);
const [loading, setLoading] = useState(false);
const [formData, setFormData] = useState({
title: '',
problem: '',
solution: '',
figures: [],
docket: `IDF-2026-0${Math.floor(Math.random() * 89) + 10}`
});
const handleNext = () => setStep(step + 1);
const handleBack = () => setStep(step - 1);
const AIPolish = ({ field, value }) => {
const [isPolishing, setIsPolishing] = useState(false);
const handlePolish = () => {
setIsPolishing(true);
setTimeout(() => {
setFormData(prev => ({...prev, [field]: AI_SUGGESTIONS.polish}));
setIsPolishing(false);
}, 1500);
};
return (
{isPolishing ? 'Optimizing language...' : 'Refine with Agentic AI'}
);
};
const steps = [
{ number: 1, title: "Basic Information" },
{ number: 2, title: "The Innovation" },
{ number: 3, title: "Drawings & Evidence" },
{ number: 4, title: "Review & Submit" }
];
return (
{/* Wizard Progress */}
{steps.map((s) => (
= s.number
? 'bg-blue-600 border-blue-600 text-white'
: 'bg-white border-slate-300 text-slate-400'
}`}>
{step > s.number ? : s.number}
= s.number ? 'text-slate-800' : 'text-slate-400'}`}>
{s.title}
))}
{/* Step 1: Basics */}
{step === 1 && (
)}
{/* Step 2: Innovation (AI Heavily Used Here) */}
{step === 2 && (
Describe the invention
You can speak, upload a file, or type. The AI will format it.
Record
Upload Doc
What problem does this solve?
What is your technical solution?
)}
{/* Step 3: Drawings */}
{step === 3 && (
Drop sketches or diagrams here
AI will process hand-drawn sketches into Visio-style blocks.
Select Files
Agentic Figure Assistant
Once you upload a sketch, I will automatically label the components (100, 110, 120) and generate a preliminary description of the drawings for the application.
)}
{/* Step 4: Review */}
{step === 4 && (
Preview Disclosure
INVENTION DISCLOSURE FORM
Docket: {formData.docket}
Title: {formData.title || 'Untitled Invention'}
I. TECHNICAL FIELD
The present disclosure relates generally to the field of software architecture, and more specifically to...
II. BACKGROUND
{formData.problem || 'No problem description provided.'}
III. DETAILED DESCRIPTION
{formData.solution || 'No solution description provided.'}
)}
{/* Footer Navigation */}
{step === 1 ? 'Cancel' : 'Back'}
Save Draft
onComplete({...formData, id: formData.docket, status: 'Pending Review', dateCreated: '2026-02-17', inventor: 'Sarah Chen'}) : handleNext}
icon={step === 4 ? Send : ChevronRight}
>
{step === 4 ? 'Submit for Review' : 'Next Step'}
);
};
// --- Detailed View & Reviewer Panel ---
const IDFDetailView = ({ idf, userRole, onBack, onUpdate }) => {
const [reviewTab, setReviewTab] = useState('content');
const [comment, setComment] = useState('');
return (
Back to Dashboard
{/* Main Document Content */}
{idf.title}
{idf.id} • v1.0
PDF
{userRole === 'inventor' && Edit }
{/* Document Body */}
1. Problem Statement
{idf.problem}
2. Proposed Solution
{idf.description}
{idf.solution}
Figure 1: System Architecture (Processed)
3. Alternatives Considered
No alternatives provided by inventor.
{/* Right Sidebar: Review & Actions */}
{/* Status Card */}
Current Status
Submitted:
{idf.dateCreated}
Inventor:
{idf.inventor}
{/* AI Analysis (Agentic Feature) */}
Agentic Analysis
Automated pre-check against MPEP standards.
Enablement Score
High (92%)
Novelty Probability
Medium (64%)
Gap Detected: The description mentions "Machine Learning" but lacks specific training data inputs. This may risk a 112 rejection.
{/* Reviewer Actions (Only for Reviewer Role) */}
{userRole === 'reviewer' && (
Reviewer Decision
Commercial Value (1-5)
{[1,2,3,4,5].map(n => (
{n}
))}
Feedback
onUpdate({...idf, status: 'Rejected', score: 45})}
className="w-full justify-center"
>
No Go
onUpdate({...idf, status: 'Approved', score: 88})}
className="w-full justify-center"
>
Approve
)}
{/* Chat/Collaboration */}
Collaboration Log
AI
I asked the inventor to clarify the battery chemistry in section 2.
SC
Updated the spec with Lithium-Iron-Phosphate details.
);
};