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
{error}
Prepared for {brief.candidate_name} for their interview with {brief.client_name}
{brief.client_expectations || 'No specific custom expectations logged.'}
| Competency | Candidate Score | Min. Required | Status |
|---|---|---|---|
| {comp.name} | {comp.score} / 5 | {comp.min_required} / 5 | {comp.status === 'pass' ? '✓ Meets Expectations' : '⚠️ Gap Identified'} |
Prioritized tips targeting areas of potential client mismatch:
Have the candidate practice the STAR method with these archetype-relevant questions: