/** * InterviewPlanPreview Component * * Displays a preview of the interview plan including: * - Question breakdown by category * - Estimated duration * - Focus areas * - Start Interview button */ import React from 'react'; function InterviewPlanPreview({ plan, loading = false, onStartInterview, onRegenerate, }) { // Loading state if (loading) { return (

Generating your personalized interview plan...

This may take a few seconds

); } // No plan state if (!plan) { return null; } /** * Get difficulty badge class */ const getDifficultyClass = (level) => { switch (level?.toLowerCase()) { case 'easy': return 'difficulty-easy'; case 'medium': return 'difficulty-medium'; case 'hard': return 'difficulty-hard'; case 'expert': return 'difficulty-expert'; default: return 'difficulty-medium'; } }; /** * Get category icon */ const getCategoryIcon = (category) => { switch (category?.toLowerCase()) { case 'dsa': return '🧮'; case 'technical': return '💻'; case 'behavioral': return '🤝'; case 'hr': return '👔'; case 'situational': return '🎯'; default: return '❓'; } }; /** * Format duration */ const formatDuration = (minutes) => { if (minutes < 60) return `${minutes} min`; const hours = Math.floor(minutes / 60); const mins = minutes % 60; return mins > 0 ? `${hours}h ${mins}m` : `${hours} hour${hours > 1 ? 's' : ''}`; }; return (
{/* Header */}

📋 Interview Plan Ready

{plan.difficulty_level}

For: {plan.target_role}

{plan.generation_source === 'mock' && ( Demo Mode )}
{/* Quick Stats */}
📝 {plan.total_questions} Questions
⏱️ {formatDuration(plan.total_questions * 3)} Duration
{/* Question Breakdown */}

Question Breakdown

{plan.breakdown && Object.entries(plan.breakdown).map(([category, count]) => ( count > 0 && (
{getCategoryIcon(category)}
{category.charAt(0).toUpperCase() + category.slice(1)} {count} question{count > 1 ? 's' : ''}
) ))}
{/* Focus Areas */} {(plan.strength_focus_areas?.length > 0 || plan.weakness_focus_areas?.length > 0) && (

Focus Areas

{plan.strength_focus_areas?.slice(0, 2).map((area, idx) => (
💪 {area.area}
))} {plan.weakness_focus_areas?.slice(0, 2).map((area, idx) => (
🎯 {area.area}
))}
)} {/* Skills to Test */} {plan.skills_to_test?.length > 0 && (

Skills to Be Tested

{plan.skills_to_test.slice(0, 8).map((skill, idx) => ( {skill} ))} {plan.skills_to_test.length > 8 && ( +{plan.skills_to_test.length - 8} more )}
)} {/* Summary */} {plan.summary && (

{plan.summary}

)} {/* Actions */}
{onRegenerate && ( )}
{plan.is_used && (

This plan has already been used for an interview.

)}
); } export default InterviewPlanPreview;