From c2f1a6583880aba62770058016ffe04721b0b2d3 Mon Sep 17 00:00:00 2001 From: Ramcharan S <139494941+Ramcharan-Swaminathan@users.noreply.github.com> Date: Thu, 13 Mar 2025 00:06:13 +0530 Subject: [PATCH 1/4] Add tab system to interview room Add a tab system to display generated questions and questions from the question bank in the interview room. * Add new states for managing the active tab. * Add buttons to switch between "Generated" and "Question Bank" tabs. * Display generated questions in the "Generated" tab. * Display mock question bank data in the "Question Bank" tab. * Update the left panel header to "Questions" instead of "Suggested Questions". --- src/pages/InterviewRoom.jsx | 122 +++++++++++++++++++++++++++++++----- 1 file changed, 108 insertions(+), 14 deletions(-) diff --git a/src/pages/InterviewRoom.jsx b/src/pages/InterviewRoom.jsx index 77472dc..32eca43 100644 --- a/src/pages/InterviewRoom.jsx +++ b/src/pages/InterviewRoom.jsx @@ -41,6 +41,9 @@ const InterviewRoom = () => { const [codingChallenge, setCodingChallenge] = useState(null) const [showCompiler, setShowCompiler] = useState(false) + // New states for tab system + const [activeTab, setActiveTab] = useState("generated") + // Mock resume data useEffect(() => { // In a real app, this would be fetched from an API @@ -703,7 +706,7 @@ const InterviewRoom = () => { {userRole === "interviewer" && (
-

Suggested Questions

+

Questions

-
- {displayQuestions.length > 0 ? ( - displayQuestions.map((question, index) => ( +
+ + +
+ + {activeTab === "generated" && ( +
+ {displayQuestions.length > 0 ? ( + displayQuestions.map((question, index) => ( +
setHoveredQuestion(question)} + onMouseLeave={() => setHoveredQuestion(null)} + > +

{question}

+ + {/* Star rating for interviewer */} + + +
+ + +
+
+ )) + ) : ( +
+

No questions available yet.

+

Start recording to generate questions based on the conversation.

+
+ )} +
+ )} + + {activeTab === "questionBank" && ( +
+ {/* Mock question bank data */} + {[ + "What is your greatest strength?", + "Describe a time you faced a challenge at work.", + "How do you prioritize your tasks?", + "What are your career goals?", + "Why do you want to work here?", + ].map((question, index) => (
{
- )) - ) : ( -
-

No questions available yet.

-

Start recording to generate questions based on the conversation.

-
- )} -
+ ))} +
+ )} {pinnedQuestions.length > 0 && (
@@ -1277,5 +1373,3 @@ const InterviewRoom = () => { } export default InterviewRoom - - From 381df6c3bffc16d9443a4587b8065460387a06e9 Mon Sep 17 00:00:00 2001 From: Ramcharan S <139494941+Ramcharan-Swaminathan@users.noreply.github.com> Date: Thu, 13 Mar 2025 08:08:48 +0530 Subject: [PATCH 2/4] changed t vertical --- src/pages/InterviewRoom.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/InterviewRoom.jsx b/src/pages/InterviewRoom.jsx index 32eca43..e324c7a 100644 --- a/src/pages/InterviewRoom.jsx +++ b/src/pages/InterviewRoom.jsx @@ -729,10 +729,10 @@ const InterviewRoom = () => {
-
+
-
+
-
- -
- - -
- - {activeTab === "generated" && ( -
- {displayQuestions.length > 0 ? ( - displayQuestions.map((question, index) => ( -
setHoveredQuestion(question)} - onMouseLeave={() => setHoveredQuestion(null)} + {selectedQuestion ? ( +
+ {/* Selected Question View */} +
+
+

Selected Question

+ +
+
+

{selectedQuestion}

+ { + handleRateQuestion(q, rating) + setSelectedQuestion(null) + }} + /> +
+
- {/* Star rating for interviewer */} - + + +
+
+ ) : ( + <> +
+

Questions

+ +
-
- - + +
+ + {activeTab === "generated" && ( +
+ {displayQuestions.length > 0 ? ( + displayQuestions.map((question, index) => ( +
setHoveredQuestion(question)} + onMouseLeave={() => setHoveredQuestion(null)} + onClick={() => setSelectedQuestion(question)} > - - - - +

{question}

+ +
+ + +
+
+ )) + ) : ( +
+

No questions available yet.

+

Start recording to generate questions based on the conversation.

-
- )) - ) : ( -
-

No questions available yet.

-

Start recording to generate questions based on the conversation.

+ )}
)} -
- )} - - {activeTab === "questionBank" && ( -
- {/* Mock question bank data */} - {[ - "What is your greatest strength?", - "Describe a time you faced a challenge at work.", - "How do you prioritize your tasks?", - "What are your career goals?", - "Why do you want to work here?", - ].map((question, index) => ( -
setHoveredQuestion(question)} - onMouseLeave={() => setHoveredQuestion(null)} - > -

{question}

- {/* Star rating for interviewer */} - - -
- - -
+

{question}

+ +
+ + +
+
+ ))}
- ))} -
- )} - - {pinnedQuestions.length > 0 && ( -
-

Pinned Questions

-
- {pinnedQuestions.map((question, index) => ( -
setHoveredQuestion(question)} - onMouseLeave={() => setHoveredQuestion(null)} - > -

{question}

- - {/* Star rating for interviewer */} - + )} -
- -
+

{question}

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