import { useState, useEffect } from 'react' import { useParams, useNavigate } from 'react-router-dom' export default function BriefPreview() { const { candidateId } = useParams() const navigate = useNavigate() const [brief, setBrief] = useState(null) const [loading, setLoading] = useState(true) const [error, setError] = useState('') useEffect(() => { async function fetchBrief() { try { const res = await fetch(`/api/candidates/${candidateId}/brief`) if (!res.ok) { const errData = await res.json() throw new Error(errData.detail || 'Failed to fetch brief.') } const data = await res.json() setBrief(data) } catch (err) { console.error(err) setError(err.message || 'Could not load prep brief.') } finally { setLoading(false) } } fetchBrief() }, [candidateId]) const handlePrint = () => { window.print() } if (loading) { return
Generating prep brief...
} if (error) { return (

⚠️ Error

{error}

) } if (!brief) return null return ( <>
{brief.client_archetype === 'consulting' ? '💼 Corporate Vetting Profile' : '🚀 Startup Vetting Profile'}

Candidate Interview Preparation Brief

Prepared for {brief.candidate_name} for their interview with {brief.client_name}


Client Expectations:

{brief.client_expectations || 'No specific custom expectations logged.'}

Competency Alignment Check

{brief.competency_scores.map((comp) => ( ))}
Competency Candidate Score Min. Required Status
{comp.name} {comp.score} / 5 {comp.min_required} / 5 {comp.status === 'pass' ? '✓ Meets Expectations' : '⚠️ Gap Identified'}

💡 Tailored Vetting Coaching & Strategy

Prioritized tips targeting areas of potential client mismatch:

🎯 High-Probability Practice Questions

Have the candidate practice the STAR method with these archetype-relevant questions:

Generated via Staffinc Match on {new Date(brief.generated_at).toLocaleString()}
) }