From 7999a3fa04980fd694d729cea183a321080a6878 Mon Sep 17 00:00:00 2001 From: gamvo74 Date: Wed, 25 Feb 2026 11:31:38 -0500 Subject: [PATCH] Add upload button and simulated progress to Mock Trial page --- apps/web/app/mock-trial/page.tsx | 236 +++++++++++++++++++++---------- 1 file changed, 160 insertions(+), 76 deletions(-) diff --git a/apps/web/app/mock-trial/page.tsx b/apps/web/app/mock-trial/page.tsx index 18f6217..5e35d7f 100644 --- a/apps/web/app/mock-trial/page.tsx +++ b/apps/web/app/mock-trial/page.tsx @@ -1,95 +1,179 @@ -import { Gavel, Mic, Users, MessageSquare, Play, Info } from 'lucide-react'; +"use client"; + +import { useState, useRef } from 'react'; +import { + Plus, + Search, + Gavel, + User, + Mic, + Book, + MessageSquare, + Upload, + X, + FileAudio +} from 'lucide-react'; + +const mockTrials = [ + { + id: '1', + title: 'Barden v. State Farm - Jurisdiction Challenge', + status: 'Ready for Play', + lastPractice: '2 days ago', + transcript: 'Plaintiff argues lack of personal jurisdiction...', + players: ['AI Judge', 'AI Opposing Counsel'], + }, + { + id: '2', + title: 'Malveo Estate - Witness Testimony', + status: 'Drafting Script', + lastPractice: '1 week ago', + transcript: 'Witness deposition regarding estate assets...', + players: ['AI Judge'], + }, +]; export default function MockTrialPage() { + const [searchQuery, setSearchQuery] = useState(''); + const [isUploading, setIsUploading] = useState(false); + const [uploadProgress, setUploadProgress] = useState(0); + const [selectedFile, setSelectedFile] = useState(null); + const fileInputRef = useRef(null); + + const handleUpload = (event: React.ChangeEvent) => { + const file = event.target.files?.[0]; + if (file) { + setSelectedFile(file); + simulateUpload(); + } + }; + + const simulateUpload = () => { + setIsUploading(true); + let progress = 0; + const interval = setInterval(() => { + progress += 10; + setUploadProgress(progress); + if (progress >= 100) { + clearInterval(interval); + setTimeout(() => { + setIsUploading(false); + setUploadProgress(0); + alert('Simulated upload complete. Actual backend integration coming soon!'); + }, 500); + } + }, 200); + }; + return ( -
+

Mock Trial Simulator

-

Practice your arguments and receive real-time feedback from an AI Judge.

+

Practice your arguments against AI Judge & Opposing Counsel.

+
+
+ + +
-
-
-
-
-
-
-
- -
-

The Honorable AI Judge

-

Ready to hear your opening statement or oral argument. Click 'Start Simulation' to begin.

+ {isUploading && ( +
+
+ +
+
+
+

Processing: {selectedFile?.name}

+

{uploadProgress}%

- -
-
-
-
- Live -
-
-
- - -
-
-
- -
-

- - Simulation Settings -

-
-
- - -
-
- - -
+
+
+
+ )} -
-
-
- -

Trial Log

-
-
-
-

"The court is now in session..."

-

Logs will appear here during your simulation.

-
-
-
- -
-
+
+
+ + setSearchQuery(e.target.value)} + className="w-full pl-10 pr-4 py-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-all" + />
+ +
+ + + + + + + + + + + + {mockTrials.map((trial) => ( + + + + + + + + ))} + +
Trial NameStatusPlayersLast PracticeActions
+
+
+ +
+ {trial.title} +
+
{trial.status} +
+ {trial.players.map((player, index) => ( + + {player.includes('AI') ? : } + + ))} +
+
{trial.lastPractice} + +
+
); }