diff --git a/src/pages/interview-prep/PracticeTab.tsx b/src/pages/interview-prep/PracticeTab.tsx index 416b8247..3461643b 100644 --- a/src/pages/interview-prep/PracticeTab.tsx +++ b/src/pages/interview-prep/PracticeTab.tsx @@ -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; @@ -44,7 +45,7 @@ interface PracticeStats { interface PracticeTabProps { mockInterviewQuestions?: MockQuestion[]; - onTabChange?: (tab: string) => void; + onTabChange?: (tab: TabType) => void; } const fadeIn = { @@ -220,7 +221,7 @@ const PracticeTab: React.FC = ({ }); }; - const handleTabNavigation = (tab: string) => { + const handleTabNavigation = (tab: TabType) => { if (onTabChange) { onTabChange(tab); } diff --git a/src/pages/interview-prep/index.tsx b/src/pages/interview-prep/index.tsx index 1ed718ff..b42cf1dd 100644 --- a/src/pages/interview-prep/index.tsx +++ b/src/pages/interview-prep/index.tsx @@ -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("overview"); const [expandedCategories, setExpandedCategories] = useState<{ [key: string]: boolean; }>({}); @@ -1501,11 +1506,7 @@ function InterviewPrepContent({ mockInterviewQuestions, }: { activeTab: string; - setActiveTab: React.Dispatch< - React.SetStateAction< - "overview" | "technical" | "behavioral" | "companies" | "practice" - > - >; + setActiveTab: React.Dispatch>; expandedCategories: { [key: string]: boolean }; toggleCategory: (categoryIndex: number) => void; showTips: { [key: number]: boolean }; @@ -1654,7 +1655,10 @@ function InterviewPrepContent({ {/* Practice Tab */} {activeTab === "practice" && ( - + )} @@ -1702,3 +1706,4 @@ function InterviewPrepContent({ } export default InterviewPrepPage; +export type { TabType };