import React, { useState } from 'react'; function scoreClass(score) { if (score >= 70) return 'good'; if (score >= 40) return 'ok'; return 'bad'; } function ScoreBar({ label, value, max = 10 }) { const pct = (value / max) * 100; const cls = value >= 7 ? 'good' : value >= 4 ? 'ok' : 'bad'; return (
{label}
{value}/{max}
); } function PriorityBadge({ priority }) { return {priority.toUpperCase()}; } export default function Report({ data, onReset }) { const { report, details, meta } = data; const [activeSection, setActiveSection] = useState('overview'); const sections = [ { id: 'overview', label: 'Overview' }, { id: 'communication', label: 'Communication Profile' }, { id: 'patterns', label: 'Interview Patterns' }, { id: 'actionplan', label: 'Action Plan' }, { id: 'breakdown', label: 'Q&A Breakdown' }, { id: 'tips', label: 'Next Steps' }, ]; return (
{report.overallScore}
Overall Score
{report.verdict.replace(/_/g, ' ')}
{report.readinessLevel}
{sections.map(sec => ( ))}
{activeSection === 'overview' && ( <>

Summary

{report.summary}

Top Strengths

    {report.topStrengths?.map((s, i) =>
  • {s}
  • )}

Areas to Improve

    {report.areasToImprove?.map((a, i) =>
  • {a}
  • )}

Recommendation

{report.recommendation}

)} {activeSection === 'communication' && report.communicationProfile && (

Communication Profile

How you come across in an interview setting, scored across five key dimensions.

)} {activeSection === 'patterns' && report.interviewPatterns && (

Interview Patterns

Patterns observed across all your answers.

Performance Trajectory: {report.interviewPatterns.trajectory === 'improving' ? 'Improving' : report.interviewPatterns.trajectory === 'declining' ? 'Declining' : 'Stable'}
{report.interviewPatterns.consistentStrengths?.length > 0 && (

Consistent Strengths

    {report.interviewPatterns.consistentStrengths.map((p, i) =>
  • {p}
  • )}
)} {report.interviewPatterns.consistentWeaknesses?.length > 0 && (

Consistent Weaknesses

    {report.interviewPatterns.consistentWeaknesses.map((p, i) =>
  • {p}
  • )}
)}
)} {activeSection === 'actionplan' && report.actionPlan?.length > 0 && (

Personalized Action Plan

Your prioritized roadmap to interview readiness.

{report.actionPlan.map((item, i) => (
{item.timeframe}

{item.action}

))}
)} {activeSection === 'breakdown' && (

Question-by-Question Breakdown

{details.map((d, i) => (

Q{i + 1}: {d.question}

Your answer: {d.answer.substring(0, 200)}{d.answer.length > 200 ? '...' : ''}

Score: = 7 ? 'good' : d.score >= 4 ? 'ok' : 'bad'}`}> {d.score}/10 {' '}{d.feedback}

))}
)} {activeSection === 'tips' && (

Tips for Your Next Practice Session

{report.mockInterviewTips?.length > 0 && (
    {report.mockInterviewTips.map((tip, i) =>
  • {tip}
  • )}
)}
)}
); }