Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/pages/interview-prep/PracticeTab.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import { useState, useEffect } from "react";
import { motion, AnimatePresence } from "framer-motion";
import type { TabType } from "./index";

interface MockQuestion {
id: string;
Expand Down Expand Up @@ -44,7 +45,7 @@ interface PracticeStats {

interface PracticeTabProps {
mockInterviewQuestions?: MockQuestion[];
onTabChange?: (tab: string) => void;
onTabChange?: (tab: TabType) => void;
}

const fadeIn = {
Expand Down Expand Up @@ -220,7 +221,7 @@ const PracticeTab: React.FC<PracticeTabProps> = ({
});
};

const handleTabNavigation = (tab: string) => {
const handleTabNavigation = (tab: TabType) => {
if (onTabChange) {
onTabChange(tab);
}
Expand Down
23 changes: 14 additions & 9 deletions src/pages/interview-prep/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ const staggerContainer = {
},
};

type TabType =
| "overview"
| "technical"
| "behavioral"
| "companies"
| "practice";

const InterviewPrepPage: React.FC = () => {
const [activeTab, setActiveTab] = useState<
"overview" | "technical" | "behavioral" | "companies" | "practice"
>("overview");
const [activeTab, setActiveTab] = useState<TabType>("overview");
const [expandedCategories, setExpandedCategories] = useState<{
[key: string]: boolean;
}>({});
Expand Down Expand Up @@ -1501,11 +1506,7 @@ function InterviewPrepContent({
mockInterviewQuestions,
}: {
activeTab: string;
setActiveTab: React.Dispatch<
React.SetStateAction<
"overview" | "technical" | "behavioral" | "companies" | "practice"
>
>;
setActiveTab: React.Dispatch<React.SetStateAction<TabType>>;
expandedCategories: { [key: string]: boolean };
toggleCategory: (categoryIndex: number) => void;
showTips: { [key: number]: boolean };
Expand Down Expand Up @@ -1654,7 +1655,10 @@ function InterviewPrepContent({

{/* Practice Tab */}
{activeTab === "practice" && (
<PracticeTab mockInterviewQuestions={mockInterviewQuestions} />
<PracticeTab
mockInterviewQuestions={mockInterviewQuestions}
onTabChange={setActiveTab}
/>
)}
</div>

Expand Down Expand Up @@ -1702,3 +1706,4 @@ function InterviewPrepContent({
}

export default InterviewPrepPage;
export type { TabType };
Loading