// src/components/PreparingLanding.js import React, { useState, useCallback, useEffect, useContext } from 'react'; import { useNavigate, useLocation } from 'react-router-dom'; import { Button } from './ui/button.js'; import LoanRepaymentDrawer from './LoanRepaymentDrawer.js'; import { ProfileCtx } from '../App.js'; function PreparingLanding() { const navigate = useNavigate(); const location = useLocation(); const { user } = useContext(ProfileCtx); /* ─── Drawer visibility ─────────────────────────────── */ const [showLoan, setShowLoan] = useState(false); /* ─── Stub-school state lives here; Drawer mutates it ─ */ const [schools, setSchools] = useState([]); // [] → quick-fill form const [cipCodes] = useState([]); // you may hold these at page level const [userZip] = useState(''); const [loanResults, setLoanResults] = useState([]); /* Esc -to-close convenience */ const escHandler = useCallback((e) => { if (e.key === 'Escape') setShowLoan(false); }, []); useEffect(() => { if (showLoan) window.addEventListener('keydown', escHandler); return () => window.removeEventListener('keydown', escHandler); }, [showLoan, escHandler]); /* ─── Auto-open drawer when routed from nav ───────── */ useEffect(() => { // support either query ?loan=1 or navigation state { openLoan: true } try { const qs = new URLSearchParams(location.search); const viaQuery = qs.get('loan') === '1'; const viaState = location.state && location.state.openLoan === true; if ((viaQuery || viaState) && !showLoan) { setShowLoan(true); } } catch {} }, [location.search, location.state, showLoan]); return (
Build the right skills and plan your education so you can confidently enter—or transition into—your new career.
We can help you identify whether a skills-based program (certifications, bootcamps) or a{' '} formal education route (two- or four-year college) is the best fit. Whichever path you choose, AptivaAI will help you map next steps—from applying to graduating.
Compare degrees, certificates, and training paths for your target role.
Estimate total costs and monthly payments with realistic assumptions.
Want to revisit career possibilities? Retake our Interest Inventory to see other matching paths.