import React, { useState } from 'react'; import { Briefcase, GraduationCap, ArrowRight } from 'lucide-react'; import './SearchPathGate.css'; export const SEARCH_PATH_OPTIONS = [ { value: 'Internship search', title: 'Internship', description: 'I am looking for an internship (typical for juniors and earlier).', icon: GraduationCap, }, { value: 'Full-time / entry-level', title: 'Full-time job', description: 'I am looking for a full-time / entry-level role (typical for seniors and grads).', icon: Briefcase, }, ]; /** * First-run gate: internship vs full-time changes advisor trajectory. */ const SearchPathGate = ({ authToken, onComplete }) => { const [selected, setSelected] = useState(null); const [saving, setSaving] = useState(false); const [error, setError] = useState(''); const handleContinue = async () => { if (!selected) { setError('Pick internship or full-time to continue.'); return; } setSaving(true); setError(''); try { const resp = await fetch(`${process.env.REACT_APP_API_URL}/api/users/me/profile`, { method: 'PUT', headers: { Authorization: `Bearer ${authToken}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ cyber_role: selected }), }); if (!resp.ok) { const data = await resp.json().catch(() => ({})); throw new Error(data.detail || 'Could not save your choice'); } const profile = await resp.json(); localStorage.setItem('launchpadSearchPath', selected); onComplete?.(profile, selected); } catch (e) { setError(e.message || 'Could not save your choice'); } finally { setSaving(false); } }; return (

What are you aiming for right now?

This steers every advisor — search strategy, resume tone, interview prep, and weekly cadence.

{SEARCH_PATH_OPTIONS.map((opt) => { const Icon = opt.icon; const active = selected === opt.value; return ( ); })}
{error &&
{error}
}
); }; export function needsSearchPath(profile) { const role = profile?.cyber_role; if (!role) return true; const normalized = String(role).toLowerCase(); return !( normalized.includes('internship') || normalized.includes('full-time') || normalized.includes('full time') || normalized.includes('both') ); } export default SearchPathGate;