Prakhar Singh
commited on
Commit
·
7e99777
1
Parent(s):
8811e47
DashBoard skeleton completed
Browse files- Frontend/index.html +18 -11
- Frontend/src/App.tsx +1 -1
- Frontend/src/components/dashboard/Sidebar.tsx +2 -7
- Frontend/src/pages/AiInterview.tsx +147 -9
- Frontend/src/pages/dashboard.tsx +1 -1
- Frontend/src/pages/home.tsx +1 -1
- Frontend/src/pages/note.tsx +159 -3
- Frontend/src/pages/quize.tsx +5 -5
Frontend/index.html
CHANGED
|
@@ -1,13 +1,20 @@
|
|
| 1 |
<!doctype html>
|
| 2 |
<html lang="en">
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
</
|
| 9 |
-
<
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
<!doctype html>
|
| 2 |
<html lang="en">
|
| 3 |
+
|
| 4 |
+
<head>
|
| 5 |
+
<meta charset="UTF-8" />
|
| 6 |
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
| 7 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 8 |
+
<title>Prep-AI</title>
|
| 9 |
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 10 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 11 |
+
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap"
|
| 12 |
+
rel="stylesheet">
|
| 13 |
+
</head>
|
| 14 |
+
|
| 15 |
+
<body>
|
| 16 |
+
<div id="root"></div>
|
| 17 |
+
<script type="module" src="/src/main.tsx"></script>
|
| 18 |
+
</body>
|
| 19 |
+
|
| 20 |
+
</html>
|
Frontend/src/App.tsx
CHANGED
|
@@ -45,7 +45,7 @@ const App: React.FC = () => {
|
|
| 45 |
<Sidebar onLogout={handleLogout} />
|
| 46 |
|
| 47 |
{/* Main Content */}
|
| 48 |
-
<main className="flex-1 overflow-y-auto
|
| 49 |
<Routes>
|
| 50 |
<Route path="/dashboard" element={<Dashboard />} />
|
| 51 |
<Route path="/notes" element={<Notes />} />
|
|
|
|
| 45 |
<Sidebar onLogout={handleLogout} />
|
| 46 |
|
| 47 |
{/* Main Content */}
|
| 48 |
+
<main className="flex-1 overflow-y-auto">
|
| 49 |
<Routes>
|
| 50 |
<Route path="/dashboard" element={<Dashboard />} />
|
| 51 |
<Route path="/notes" element={<Notes />} />
|
Frontend/src/components/dashboard/Sidebar.tsx
CHANGED
|
@@ -19,7 +19,7 @@ const Sidebar: React.FC<SidebarProps> = ({ onLogout }) => {
|
|
| 19 |
{ path: "/quize", label: "Resume Quiz", icon: <FileText size={18} /> },
|
| 20 |
];
|
| 21 |
return (
|
| 22 |
-
<aside className="w-64 bg-gray-900 text-white flex flex-col justify-between">
|
| 23 |
|
| 24 |
{/* Top Section */}
|
| 25 |
<div>
|
|
@@ -45,11 +45,6 @@ const Sidebar: React.FC<SidebarProps> = ({ onLogout }) => {
|
|
| 45 |
|
| 46 |
{/* Bottom Section (From Header) */}
|
| 47 |
<div className="p-4 border-t border-gray-700 space-y-4">
|
| 48 |
-
<button className="flex items-center space-x-3 p-3 rounded-lg hover:bg-gray-800 transition w-full text-left">
|
| 49 |
-
<Bell size={18} />
|
| 50 |
-
<span>Notifications</span>
|
| 51 |
-
</button>
|
| 52 |
-
|
| 53 |
<button className="flex items-center space-x-3 p-3 rounded-lg hover:bg-gray-800 transition w-full text-left">
|
| 54 |
<Settings size={18} />
|
| 55 |
<span>Settings</span>
|
|
@@ -60,7 +55,7 @@ const Sidebar: React.FC<SidebarProps> = ({ onLogout }) => {
|
|
| 60 |
<span>John Doe</span>
|
| 61 |
</button>
|
| 62 |
|
| 63 |
-
<button className="flex items-center space-x-3 p-3 rounded-lg hover:bg-red-600
|
| 64 |
<LogOut size={18} />
|
| 65 |
<span>Logout</span>
|
| 66 |
</button>
|
|
|
|
| 19 |
{ path: "/quize", label: "Resume Quiz", icon: <FileText size={18} /> },
|
| 20 |
];
|
| 21 |
return (
|
| 22 |
+
<aside className="w-64 bg-linear-to-r from-blue-700 to-gray-900/50 text-white flex flex-col justify-between">
|
| 23 |
|
| 24 |
{/* Top Section */}
|
| 25 |
<div>
|
|
|
|
| 45 |
|
| 46 |
{/* Bottom Section (From Header) */}
|
| 47 |
<div className="p-4 border-t border-gray-700 space-y-4">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
<button className="flex items-center space-x-3 p-3 rounded-lg hover:bg-gray-800 transition w-full text-left">
|
| 49 |
<Settings size={18} />
|
| 50 |
<span>Settings</span>
|
|
|
|
| 55 |
<span>John Doe</span>
|
| 56 |
</button>
|
| 57 |
|
| 58 |
+
<button className="flex items-center space-x-3 p-3 rounded-lg hover:bg-red-600 text-black transition w-full text-left">
|
| 59 |
<LogOut size={18} />
|
| 60 |
<span>Logout</span>
|
| 61 |
</button>
|
Frontend/src/pages/AiInterview.tsx
CHANGED
|
@@ -1,17 +1,155 @@
|
|
| 1 |
-
import React from "react";
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
const AIInterview: React.FC = () => {
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
</p>
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
</button>
|
| 13 |
</div>
|
| 14 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
};
|
| 16 |
|
| 17 |
-
export default AIInterview;
|
|
|
|
| 1 |
+
import React, { useState } from "react";
|
| 2 |
+
import { Send, Settings, CheckCircle } from "lucide-react";
|
| 3 |
+
|
| 4 |
+
// Define the structure for the interview state
|
| 5 |
+
type InterviewState = 'config' | 'chat' | 'results';
|
| 6 |
|
| 7 |
const AIInterview: React.FC = () => {
|
| 8 |
+
const [interviewState, setInterviewState] = useState<InterviewState>('config');
|
| 9 |
+
const [jobRole, setJobRole] = useState('');
|
| 10 |
+
const [experience, setExperience] = useState('');
|
| 11 |
+
const [level, setLevel] = useState('Medium');
|
| 12 |
+
|
| 13 |
+
// Placeholder for the AI Chat bubble/ball
|
| 14 |
+
const InterviewBall: React.FC = () => (
|
| 15 |
+
<div className="flex items-center justify-center w-24 h-24 bg-purple-600 rounded-full shadow-2xl animate-pulse cursor-pointer">
|
| 16 |
+
<span className="text-white font-bold text-xl">AI</span>
|
| 17 |
+
</div>
|
| 18 |
+
);
|
| 19 |
+
|
| 20 |
+
// --- RENDER FUNCTIONS ---
|
| 21 |
+
|
| 22 |
+
// 1. Configuration Phase
|
| 23 |
+
const renderConfig = () => (
|
| 24 |
+
<div className="bg-white p-6 rounded-xl shadow-lg border border-gray-200">
|
| 25 |
+
<h3 className="text-2xl font-semibold mb-6 flex items-center gap-2 text-blue-700">
|
| 26 |
+
<Settings size={24} /> Configure Your Interview
|
| 27 |
+
</h3>
|
| 28 |
+
|
| 29 |
+
<div className="space-y-6">
|
| 30 |
+
{/* Job Role Input */}
|
| 31 |
+
<label className="block">
|
| 32 |
+
<span className="text-gray-700 font-medium">1. Job Role/Position (e.g., Senior Frontend Developer)</span>
|
| 33 |
+
<input
|
| 34 |
+
type="text"
|
| 35 |
+
value={jobRole}
|
| 36 |
+
onChange={(e) => setJobRole(e.target.value)}
|
| 37 |
+
placeholder="Enter the job role for tailored questions"
|
| 38 |
+
className="mt-1 block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:ring-blue-500 focus:border-blue-500"
|
| 39 |
+
/>
|
| 40 |
+
</label>
|
| 41 |
+
|
| 42 |
+
{/* Experience Input */}
|
| 43 |
+
<label className="block">
|
| 44 |
+
<span className="text-gray-700 font-medium">2. Years of Professional Experience</span>
|
| 45 |
+
<input
|
| 46 |
+
type="number"
|
| 47 |
+
min="0"
|
| 48 |
+
value={experience}
|
| 49 |
+
onChange={(e) => setExperience(e.target.value)}
|
| 50 |
+
placeholder="e.g., 5"
|
| 51 |
+
className="mt-1 block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:ring-blue-500 focus:border-blue-500"
|
| 52 |
+
/>
|
| 53 |
+
</label>
|
| 54 |
+
|
| 55 |
+
{/* Level Select */}
|
| 56 |
+
<label className="block">
|
| 57 |
+
<span className="text-gray-700 font-medium">3. Difficulty Level</span>
|
| 58 |
+
<select
|
| 59 |
+
value={level}
|
| 60 |
+
onChange={(e) => setLevel(e.target.value)}
|
| 61 |
+
className="mt-1 block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:ring-blue-500 focus:border-blue-500 bg-white"
|
| 62 |
+
>
|
| 63 |
+
<option value="Basic">Basic (Beginner)</option>
|
| 64 |
+
<option value="Medium">Medium (Intermediate)</option>
|
| 65 |
+
<option value="Hard">Hard (Senior/Expert)</option>
|
| 66 |
+
</select>
|
| 67 |
+
</label>
|
| 68 |
+
</div>
|
| 69 |
+
|
| 70 |
+
<button
|
| 71 |
+
onClick={() => {
|
| 72 |
+
if (jobRole && experience) {
|
| 73 |
+
setInterviewState('chat');
|
| 74 |
+
} else {
|
| 75 |
+
alert('Please fill in the Job Role and Experience.');
|
| 76 |
+
}
|
| 77 |
+
}}
|
| 78 |
+
className="mt-8 px-8 py-3 bg-blue-600 text-white font-semibold rounded-lg hover:bg-blue-700 transition duration-150 flex items-center gap-2"
|
| 79 |
+
disabled={!jobRole || !experience}
|
| 80 |
+
>
|
| 81 |
+
<Send size={20} /> Start Interview
|
| 82 |
+
</button>
|
| 83 |
+
</div>
|
| 84 |
+
);
|
| 85 |
+
|
| 86 |
+
// 2. Chat/Interview Phase
|
| 87 |
+
const renderChat = () => (
|
| 88 |
+
<div className="flex flex-col items-center bg-white p-6 rounded-xl shadow-lg h-[600px] overflow-hidden relative">
|
| 89 |
+
<h3 className="text-xl font-bold mb-4">Interview in Progress</h3>
|
| 90 |
+
<p className="text-gray-600 mb-6">
|
| 91 |
+
Role: {jobRole} | Experience: {experience} yrs | Level: {level}
|
| 92 |
</p>
|
| 93 |
+
|
| 94 |
+
{/* The AI Ball UI Element */}
|
| 95 |
+
<InterviewBall />
|
| 96 |
+
|
| 97 |
+
{/* Placeholder for Chat Messages */}
|
| 98 |
+
<div className="flex-1 w-full mt-4 p-4 border border-dashed border-gray-300 rounded-lg overflow-y-auto bg-gray-50">
|
| 99 |
+
<div className="bg-purple-100 p-3 rounded-lg text-purple-800 mb-2">
|
| 100 |
+
**AI:** Welcome! Based on your configuration, let's start with your first question...
|
| 101 |
+
</div>
|
| 102 |
+
{/* User messages and AI responses would go here */}
|
| 103 |
+
</div>
|
| 104 |
+
|
| 105 |
+
{/* Input area */}
|
| 106 |
+
<div className="w-full flex gap-2 mt-4">
|
| 107 |
+
<input
|
| 108 |
+
type="text"
|
| 109 |
+
placeholder="Type your answer here..."
|
| 110 |
+
className="flex-1 px-4 py-3 border border-gray-300 rounded-lg focus:ring-purple-500 focus:border-purple-500"
|
| 111 |
+
/>
|
| 112 |
+
<button className="px-4 py-3 bg-purple-600 text-white rounded-lg hover:bg-purple-700">
|
| 113 |
+
<Send size={20} />
|
| 114 |
+
</button>
|
| 115 |
+
</div>
|
| 116 |
+
|
| 117 |
+
<button
|
| 118 |
+
onClick={() => setInterviewState('results')}
|
| 119 |
+
className="mt-4 text-sm text-red-500 hover:text-red-700 underline"
|
| 120 |
+
>
|
| 121 |
+
End Interview
|
| 122 |
+
</button>
|
| 123 |
+
</div>
|
| 124 |
+
);
|
| 125 |
+
|
| 126 |
+
// 3. Results Phase (Simple Placeholder)
|
| 127 |
+
const renderResults = () => (
|
| 128 |
+
<div className="bg-green-50 p-8 rounded-xl shadow-xl text-center">
|
| 129 |
+
<CheckCircle size={48} className="text-green-600 mx-auto mb-4" />
|
| 130 |
+
<h3 className="text-3xl font-bold text-green-700 mb-2">Interview Ended</h3>
|
| 131 |
+
<p className="text-gray-700 mb-6">Thank you for practicing! Your detailed feedback and results are being compiled now.</p>
|
| 132 |
+
<button
|
| 133 |
+
onClick={() => setInterviewState('config')}
|
| 134 |
+
className="px-6 py-3 bg-green-600 text-white rounded-lg hover:bg-green-700 transition duration-150"
|
| 135 |
+
>
|
| 136 |
+
Start New Interview
|
| 137 |
</button>
|
| 138 |
</div>
|
| 139 |
);
|
| 140 |
+
|
| 141 |
+
// --- MAIN RENDER ---
|
| 142 |
+
|
| 143 |
+
return (
|
| 144 |
+
<div className="p-8 max-w-4xl mx-auto">
|
| 145 |
+
<h1 className="text-4xl font-extrabold text-gray-800 mb-6">AI Interview Practice 🤖</h1>
|
| 146 |
+
|
| 147 |
+
{/* State rendering */}
|
| 148 |
+
{interviewState === 'config' && renderConfig()}
|
| 149 |
+
{interviewState === 'chat' && renderChat()}
|
| 150 |
+
{interviewState === 'results' && renderResults()}
|
| 151 |
+
</div>
|
| 152 |
+
);
|
| 153 |
};
|
| 154 |
|
| 155 |
+
export default AIInterview;
|
Frontend/src/pages/dashboard.tsx
CHANGED
|
@@ -23,7 +23,7 @@ const Dashboard = () => {
|
|
| 23 |
// PRIMARY CHANGE: Background Gradient inspired by landing page
|
| 24 |
// Using a custom CSS class for a more complex gradient if needed, or approximating with Tailwind.
|
| 25 |
// For now, let's use a subtle linear gradient that implies the dark blue-black.
|
| 26 |
-
<div className="px-6 py-8 space-y-10 min-h-screen text-gray-100 bg-
|
| 27 |
{/* Font sans is a good default for modern look */}
|
| 28 |
|
| 29 |
{/* ----------- HEADER SECTION (Updated for new theme) ----------- */}
|
|
|
|
| 23 |
// PRIMARY CHANGE: Background Gradient inspired by landing page
|
| 24 |
// Using a custom CSS class for a more complex gradient if needed, or approximating with Tailwind.
|
| 25 |
// For now, let's use a subtle linear gradient that implies the dark blue-black.
|
| 26 |
+
<div className="px-6 py-8 space-y-10 min-h-screen text-gray-100 bg-black font-OpenSans">
|
| 27 |
{/* Font sans is a good default for modern look */}
|
| 28 |
|
| 29 |
{/* ----------- HEADER SECTION (Updated for new theme) ----------- */}
|
Frontend/src/pages/home.tsx
CHANGED
|
@@ -92,7 +92,7 @@ const AIInterviewPlatform: React.FC<AIInterviewPlatformProps> = ({ onLogin }) =>
|
|
| 92 |
const heroRef = useRef<HTMLDivElement>(null);
|
| 93 |
|
| 94 |
return (
|
| 95 |
-
<div className="w-full min-h-screen bg-linear-to-br from-blue-900 to-gray-400 text-white overflow-x-hidden">
|
| 96 |
{/* Navigation Bar */}
|
| 97 |
<nav className={`fixed top-0 left-0 right-0 w-full z-50 transition-all duration-300 ${scrolled ? 'bg-slate-900/95 backdrop-blur-md shadow-xl' : 'bg-slate-900/80 backdrop-blur-sm'}`}>
|
| 98 |
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
|
|
| 92 |
const heroRef = useRef<HTMLDivElement>(null);
|
| 93 |
|
| 94 |
return (
|
| 95 |
+
<div className="w-full min-h-screen bg-linear-to-br from-blue-900 to-gray-400 text-white overflow-x-hidden font-opensans">
|
| 96 |
{/* Navigation Bar */}
|
| 97 |
<nav className={`fixed top-0 left-0 right-0 w-full z-50 transition-all duration-300 ${scrolled ? 'bg-slate-900/95 backdrop-blur-md shadow-xl' : 'bg-slate-900/80 backdrop-blur-sm'}`}>
|
| 98 |
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
Frontend/src/pages/note.tsx
CHANGED
|
@@ -1,10 +1,166 @@
|
|
| 1 |
import React from "react";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
const Notes: React.FC = () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
return (
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
</div>
|
| 9 |
);
|
| 10 |
};
|
|
|
|
| 1 |
import React from "react";
|
| 2 |
+
import { FileText, History, RefreshCw, Plus, Download, Upload, Save, Star, Menu, X } from "lucide-react";
|
| 3 |
+
|
| 4 |
+
// Placeholder data for the Summary/Important Parts section
|
| 5 |
+
const sampleSummary = [
|
| 6 |
+
"DP weakness identified. Must solve 10 hard DP problems this week.",
|
| 7 |
+
"Crucial to articulate Time/Space Complexity for every solution.",
|
| 8 |
+
"Practice conversational pacing to reduce filler words.",
|
| 9 |
+
];
|
| 10 |
|
| 11 |
const Notes: React.FC = () => {
|
| 12 |
+
// State for the notes content
|
| 13 |
+
const [notesContent, setNotesContent] = React.useState(
|
| 14 |
+
`Goal: Focus on Dynamic Programming and explanation clarity.\n\nKey DP Concepts to review:\n1. Overlapping Subproblems\n2. Optimal Substructure\n3. Memoization vs. Tabulation\n\nInterview Explanation Focus:\n1. State the approach (e.g., "I will use DP with memoization").\n2. Clearly define the state/subproblem (e.g., "dp[i] represents...").\n3. State the base case(s).\n4. Define the recurrence relation.\n5. Analyze Time/Space Complexity (O(n)).\n\n*Self-Reminder: Use fewer 'um's and 'like's.*`
|
| 15 |
+
);
|
| 16 |
+
|
| 17 |
+
// NEW STATE: State to manage the sidebar's open/close status
|
| 18 |
+
const [isSidebarOpen, setIsSidebarOpen] = React.useState(true);
|
| 19 |
+
|
| 20 |
+
// Toggle function
|
| 21 |
+
const toggleSidebar = () => {
|
| 22 |
+
setIsSidebarOpen(!isSidebarOpen);
|
| 23 |
+
};
|
| 24 |
+
|
| 25 |
+
// A function to simulate saving the notes (placeholder)
|
| 26 |
+
const handleSave = () => {
|
| 27 |
+
alert("Notes Saved!");
|
| 28 |
+
// In a real app, you would call an API here
|
| 29 |
+
};
|
| 30 |
+
|
| 31 |
return (
|
| 32 |
+
// Ensure the overall container is flex and full viewport height
|
| 33 |
+
<div className="flex bg-black h-screen overflow-hidden">
|
| 34 |
+
|
| 35 |
+
{/* 1. Left Sidebar: Navigation & Utility (New, History, Upload) */}
|
| 36 |
+
<div
|
| 37 |
+
className={`
|
| 38 |
+
// Full height and transition for sliding
|
| 39 |
+
h-screen flex-shrink-0 transition-all duration-300 ease-in-out
|
| 40 |
+
bg-gray-800 flex flex-col gap-4 shadow-xl
|
| 41 |
+
${isSidebarOpen ? 'w-56 p-4' : 'w-0 p-0 overflow-hidden'} // Transition controls width and padding
|
| 42 |
+
`}
|
| 43 |
+
>
|
| 44 |
+
{isSidebarOpen && ( // Only show content when open
|
| 45 |
+
<>
|
| 46 |
+
<h3 className="text-xl font-bold text-white mb-2 border-b border-gray-700 pb-2">My Notes</h3>
|
| 47 |
+
|
| 48 |
+
<button
|
| 49 |
+
className="flex items-center gap-3 w-full bg-blue-600 text-white px-4 py-3 rounded-xl hover:bg-blue-700 transition duration-150 font-semibold whitespace-nowrap"
|
| 50 |
+
aria-label="Create New Note"
|
| 51 |
+
>
|
| 52 |
+
<Plus size={20} />
|
| 53 |
+
New Note
|
| 54 |
+
</button>
|
| 55 |
+
|
| 56 |
+
<button
|
| 57 |
+
className="flex items-center gap-3 w-full text-gray-300 px-4 py-3 rounded-xl hover:bg-gray-700 hover:text-white transition duration-150 whitespace-nowrap"
|
| 58 |
+
aria-label="Upload Notes"
|
| 59 |
+
>
|
| 60 |
+
<Upload size={20} />
|
| 61 |
+
Upload
|
| 62 |
+
</button>
|
| 63 |
+
|
| 64 |
+
<button
|
| 65 |
+
className="flex items-center gap-3 w-full text-gray-300 px-4 py-3 rounded-xl hover:bg-gray-700 hover:text-white transition duration-150 whitespace-nowrap"
|
| 66 |
+
aria-label="View History"
|
| 67 |
+
>
|
| 68 |
+
<History size={20} />
|
| 69 |
+
History
|
| 70 |
+
</button>
|
| 71 |
+
</>
|
| 72 |
+
)}
|
| 73 |
+
</div>
|
| 74 |
+
|
| 75 |
+
{/* 2. Main Content Area */}
|
| 76 |
+
<div className="flex-1 p-8 overflow-y-auto"> {/* Allow main content to scroll */}
|
| 77 |
+
|
| 78 |
+
<header className="flex justify-between items-center mb-6">
|
| 79 |
+
{/* Toggle Button for Sidebar - Moved to the header of the main content */}
|
| 80 |
+
<div className="flex items-center gap-4">
|
| 81 |
+
<button
|
| 82 |
+
onClick={toggleSidebar}
|
| 83 |
+
className="p-2 rounded-full bg-gray-200 hover:bg-gray-300 text-gray-800 transition-colors duration-200"
|
| 84 |
+
aria-label={isSidebarOpen ? "Close Sidebar" : "Open Sidebar"}
|
| 85 |
+
>
|
| 86 |
+
{isSidebarOpen ? <X size={24} /> : <Menu size={24} />}
|
| 87 |
+
</button>
|
| 88 |
+
<h2 className="text-4xl font-extrabold text-white"> My Prep Notes</h2>
|
| 89 |
+
</div>
|
| 90 |
+
|
| 91 |
+
{/* Top Right Actions (Save, Rephrase, Download) */}
|
| 92 |
+
<div className="flex gap-3">
|
| 93 |
+
<button
|
| 94 |
+
onClick={handleSave}
|
| 95 |
+
className="flex items-center gap-2 bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition duration-150 font-medium shadow-md"
|
| 96 |
+
aria-label="Save Current Note"
|
| 97 |
+
>
|
| 98 |
+
<Save size={18} />
|
| 99 |
+
Save
|
| 100 |
+
</button>
|
| 101 |
+
|
| 102 |
+
<button
|
| 103 |
+
className="flex items-center gap-2 bg-purple-600 text-white px-4 py-2 rounded-lg hover:bg-purple-700 transition duration-150"
|
| 104 |
+
aria-label="Rephrase Selected Text"
|
| 105 |
+
>
|
| 106 |
+
<RefreshCw size={18} />
|
| 107 |
+
Rephrase
|
| 108 |
+
</button>
|
| 109 |
+
|
| 110 |
+
<button
|
| 111 |
+
className="flex items-center gap-2 bg-indigo-600 text-white px-4 py-2 rounded-lg hover:bg-indigo-700 transition duration-150"
|
| 112 |
+
aria-label="Download Notes"
|
| 113 |
+
>
|
| 114 |
+
<Download size={18} />
|
| 115 |
+
Download
|
| 116 |
+
</button>
|
| 117 |
+
</div>
|
| 118 |
+
</header>
|
| 119 |
+
|
| 120 |
+
{/* Note Editor and Summary Section */}
|
| 121 |
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-8">
|
| 122 |
+
|
| 123 |
+
{/* Middle Section: Notes Text Area (Takes 2/3 width on large screens) */}
|
| 124 |
+
<div className="md:col-span-2">
|
| 125 |
+
<p className="text-white mb-2 font-medium">Current Note: Dynamic Programming & Clarity</p>
|
| 126 |
+
<textarea
|
| 127 |
+
className="w-full h-[600px] p-6 text-lg border-2 bg-white border-gray-300 rounded-xl shadow-lg focus:outline-none focus:ring-4 focus:ring-blue-500/50 resize-none font-mono leading-relaxed"
|
| 128 |
+
placeholder="Write your notes here..."
|
| 129 |
+
value={notesContent}
|
| 130 |
+
onChange={(e) => setNotesContent(e.target.value)}
|
| 131 |
+
></textarea>
|
| 132 |
+
</div>
|
| 133 |
+
|
| 134 |
+
{/* Right Section: Summary/Important Parts (Takes 1/3 width) */}
|
| 135 |
+
<div className="md:col-span-1">
|
| 136 |
+
<div className="bg-white p-6 rounded-xl shadow-lg h-full border border-gray-200">
|
| 137 |
+
<h3 className="text-xl font-bold text-gray-800 mb-4 flex items-center gap-2 border-b pb-2">
|
| 138 |
+
<Star className="text-yellow-500" size={20} />
|
| 139 |
+
AI Summary & Key Takeaways
|
| 140 |
+
</h3>
|
| 141 |
+
<p className="text-sm text-gray-600 mb-4">
|
| 142 |
+
This section extracts or highlights the most important parts of your current note or feedback.
|
| 143 |
+
</p>
|
| 144 |
+
<ul className="space-y-3">
|
| 145 |
+
{sampleSummary.map((item, index) => (
|
| 146 |
+
<li key={index} className="flex items-start gap-2 text-gray-700">
|
| 147 |
+
<span className="text-yellow-500 font-extrabold text-lg">•</span>
|
| 148 |
+
<span className="text-sm">{item}</span>
|
| 149 |
+
</li>
|
| 150 |
+
))}
|
| 151 |
+
</ul>
|
| 152 |
+
|
| 153 |
+
<button
|
| 154 |
+
className="mt-6 flex items-center gap-2 bg-gray-200 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-300 transition duration-150 text-sm w-full justify-center"
|
| 155 |
+
aria-label="Generate Summary"
|
| 156 |
+
>
|
| 157 |
+
<FileText size={16} />
|
| 158 |
+
Generate Summary
|
| 159 |
+
</button>
|
| 160 |
+
</div>
|
| 161 |
+
</div>
|
| 162 |
+
</div>
|
| 163 |
+
</div>
|
| 164 |
</div>
|
| 165 |
);
|
| 166 |
};
|
Frontend/src/pages/quize.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import { FileText, FileSpreadsheet, Code2, ListChecks, UploadCloud, Type } from
|
|
| 5 |
const ResumeGeneratedQuize: React.FC = () => {
|
| 6 |
|
| 7 |
// Consistent purple button style
|
| 8 |
-
const buttonClass = "w-full py-3 rounded-lg bg-gradient-to-r from-
|
| 9 |
|
| 10 |
const OutputTypeOption = ({ icon, title, desc }: { icon: React.ReactNode; title: string; desc: string }) => (
|
| 11 |
// These cards inherently take full width of their parent container (which is now the right column)
|
|
@@ -47,7 +47,7 @@ const ResumeGeneratedQuize: React.FC = () => {
|
|
| 47 |
|
| 48 |
{/* --- LEFT SIDE: INPUT SOURCE SELECTION --- */}
|
| 49 |
<div>
|
| 50 |
-
<h3 className="text-3xl font-bold mb-6 text-gray-100 border-b border-
|
| 51 |
1. Select Quiz Source
|
| 52 |
</h3>
|
| 53 |
<div className="space-y-8">
|
|
@@ -64,7 +64,7 @@ const ResumeGeneratedQuize: React.FC = () => {
|
|
| 64 |
|
| 65 |
{/* --- RIGHT SIDE: PROMPT & OUTPUT CONFIGURATION (The full width section) --- */}
|
| 66 |
<div className="lg:sticky lg:top-8 self-start">
|
| 67 |
-
<h3 className="text-3xl font-bold mb-6 text-gray-100 border-b border-
|
| 68 |
2. Configure & Generate
|
| 69 |
</h3>
|
| 70 |
|
|
@@ -99,14 +99,14 @@ const ResumeGeneratedQuize: React.FC = () => {
|
|
| 99 |
|
| 100 |
{/* MCQ Quiz Option - takes full width of its column */}
|
| 101 |
<OutputTypeOption
|
| 102 |
-
icon={<ListChecks className="w-6 h-6 text-
|
| 103 |
title="Multiple Choice Quiz (MCQ)"
|
| 104 |
desc="Ideal for quick assessment of knowledge and comprehension."
|
| 105 |
/>
|
| 106 |
|
| 107 |
{/* Coding Quiz Option - takes full width of its column */}
|
| 108 |
<OutputTypeOption
|
| 109 |
-
icon={<Code2 className="w-6 h-6 text-
|
| 110 |
title="Coding Challenge Quiz"
|
| 111 |
desc="Generates problems requiring code snippets or full functions for evaluation."
|
| 112 |
/>
|
|
|
|
| 5 |
const ResumeGeneratedQuize: React.FC = () => {
|
| 6 |
|
| 7 |
// Consistent purple button style
|
| 8 |
+
const buttonClass = "w-full py-3 rounded-lg bg-gradient-to-r from-blue-500 to-blue-700 hover:from-blue-400 hover:to-blue-600 font-medium transition shadow-lg shadow-blue-500/30 text-white mt-4";
|
| 9 |
|
| 10 |
const OutputTypeOption = ({ icon, title, desc }: { icon: React.ReactNode; title: string; desc: string }) => (
|
| 11 |
// These cards inherently take full width of their parent container (which is now the right column)
|
|
|
|
| 47 |
|
| 48 |
{/* --- LEFT SIDE: INPUT SOURCE SELECTION --- */}
|
| 49 |
<div>
|
| 50 |
+
<h3 className="text-3xl font-bold mb-6 text-gray-100 border-b border-blue-700 pb-2">
|
| 51 |
1. Select Quiz Source
|
| 52 |
</h3>
|
| 53 |
<div className="space-y-8">
|
|
|
|
| 64 |
|
| 65 |
{/* --- RIGHT SIDE: PROMPT & OUTPUT CONFIGURATION (The full width section) --- */}
|
| 66 |
<div className="lg:sticky lg:top-8 self-start">
|
| 67 |
+
<h3 className="text-3xl font-bold mb-6 text-gray-100 border-b border-blue-700 pb-2">
|
| 68 |
2. Configure & Generate
|
| 69 |
</h3>
|
| 70 |
|
|
|
|
| 99 |
|
| 100 |
{/* MCQ Quiz Option - takes full width of its column */}
|
| 101 |
<OutputTypeOption
|
| 102 |
+
icon={<ListChecks className="w-6 h-6 text-blue-400" />}
|
| 103 |
title="Multiple Choice Quiz (MCQ)"
|
| 104 |
desc="Ideal for quick assessment of knowledge and comprehension."
|
| 105 |
/>
|
| 106 |
|
| 107 |
{/* Coding Quiz Option - takes full width of its column */}
|
| 108 |
<OutputTypeOption
|
| 109 |
+
icon={<Code2 className="w-6 h-6 text-blue-400" />}
|
| 110 |
title="Coding Challenge Quiz"
|
| 111 |
desc="Generates problems requiring code snippets or full functions for evaluation."
|
| 112 |
/>
|