import React, { useState } from 'react'; function scoreClass(score) { if (score >= 7) return 'good'; if (score >= 4) return 'ok'; return 'bad'; } function StarBadge({ present }) { return ( {present ? 'Present' : 'Missing'} ); } function ScoreBar({ label, value, max = 10 }) { const pct = (value / max) * 100; const cls = value >= 7 ? 'good' : value >= 4 ? 'ok' : 'bad'; return (
{label}
{value}/{max}
); } export default function Interview({ question, progress, onSubmit, evaluation, loading }) { const [answer, setAnswer] = useState(''); const [activeTab, setActiveTab] = useState('overview'); const handleSubmit = () => { if (answer.trim().length >= 10) { onSubmit(answer.trim()); setAnswer(''); setActiveTab('overview'); } }; const pct = (progress.answered / progress.total) * 100; const tabs = [ { id: 'overview', label: 'Overview' }, { id: 'star', label: 'STAR Analysis' }, { id: 'scores', label: 'Detailed Scores' }, { id: 'language', label: 'Language Check' }, { id: 'followup', label: 'Follow-ups' }, { id: 'ideal', label: 'Ideal Answer' }, { id: 'rewrite', label: 'Rewritten' }, { id: 'delivery', label: 'Delivery Tips' }, ]; return (
Q{progress.answered + 1}/{progress.total}
{question.category} Question
{question.question}
{question.hint &&
Hint: {question.hint}
}
{evaluation && (
{evaluation.score}/10

{evaluation.feedback}

{tabs.map(tab => ( ))}
{activeTab === 'overview' && ( <> {evaluation.strengths?.length > 0 && (

Strengths

    {evaluation.strengths.map((s, i) =>
  • {s}
  • )}
)} {evaluation.improvements?.length > 0 && (

How to Improve

    {evaluation.improvements.map((s, i) =>
  • {s}
  • )}
)} {evaluation.sampleAnswer && (

Strong Answer Example

{evaluation.sampleAnswer}

)} )} {activeTab === 'star' && evaluation.starAnalysis && (

STAR Method Breakdown

The STAR method (Situation-Task-Action-Result) is the gold standard for structuring interview answers.

{['situation', 'task', 'action', 'result'].map(key => { const item = evaluation.starAnalysis[key]; if (!item) return null; return (
{key.charAt(0).toUpperCase()} {key.charAt(0).toUpperCase() + key.slice(1)}

{item.feedback}

); })}
)} {activeTab === 'scores' && evaluation.detailedScores && (

Google Hiring Committee Rubric

)} {activeTab === 'language' && (
{evaluation.fillerWords?.length > 0 && (

Filler Words Detected

{evaluation.fillerWords.map((w, i) => ( {w} ))}

Eliminate these to sound more confident and polished.

)} {evaluation.vagueStatements?.length > 0 && (

Vague Statements

    {evaluation.vagueStatements.map((v, i) => (
  • "{v}"
  • ))}

Replace these with specific numbers, names, or concrete outcomes.

)} {(!evaluation.fillerWords || evaluation.fillerWords.length === 0) && (!evaluation.vagueStatements || evaluation.vagueStatements.length === 0) && (

Clean language! No filler words or vague statements detected.

)}
)} {activeTab === 'followup' && evaluation.followUpQuestions?.length > 0 && (

Likely Follow-up Questions

An interviewer would probably ask these next. Prepare answers for each.

    {evaluation.followUpQuestions.map((q, i) => (
  1. {q}
  2. ))}
)} {activeTab === 'ideal' && evaluation.idealAnswer && (

Ideal Answer (Top Candidate)

This is what a top-performing candidate would say. Compare with your answer to identify gaps.

{evaluation.idealAnswer}

)} {activeTab === 'rewrite' && evaluation.rewrittenAnswer && (

Your Answer, Upgraded

Here is your core answer rewritten to be significantly stronger while preserving your key points.

{evaluation.rewrittenAnswer}

)} {activeTab === 'delivery' && evaluation.deliveryTips?.length > 0 && (

Body Language & Delivery Tips

    {evaluation.deliveryTips.map((tip, i) => (
  • {tip}
  • ))}
)}
)}