import React from 'react'; // Hypothetical Button component from your UI library import { Button } from '../ui/button.js'; // Adjust path if needed /** * Helper to format numeric fields for display. * If val is null/undefined or 0 and you want to hide it, * you can adapt the logic below. */ function formatNum(val) { // If val is null or undefined, show 'N/A' if (val == null) return 'N/A'; // If you'd like to hide zero, you could do: // if (val === 0) return 'N/A'; return val; } function formatYesNo(val) { if (val == null) return 'N/A'; return val === true || val === 'yes' ? 'Yes' : 'No'; } function ReviewPage({ careerData = {}, financialData = {}, collegeData = {}, onSubmit, onBack }) { // Decide if user is in or planning to be in college const inOrPlanningCollege = ( careerData.college_enrollment_status === 'currently_enrolled' || careerData.college_enrollment_status === 'prospective_student' ); return (

Review Your Info

{/* --- CAREER SECTION --- */}

Career Info

Career Name: {careerData.career_name || 'N/A'}
Currently Working: {careerData.currently_working || 'N/A'}
College enrollment Status: {careerData.college_enrollment_status || 'N/A'}
Status: {careerData.status || 'N/A'}
Start Date: {careerData.start_date || 'N/A'}
Projected End Date: {careerData.projected_end_date || 'N/A'}
Career Goals: {careerData.career_goals || 'N/A'}
{/* --- FINANCIAL SECTION --- */}

Financial Info

{/* Current/Additional Income */} {careerData.currently_working === 'yes' ? (
Current Annual Salary: {formatNum(financialData.current_salary)}
Additional Annual Income: {formatNum(financialData.additional_income)}
) : (
Currently Not Working
)} {/* Monthly Expenses / Debt */}
Monthly Expenses: {formatNum(financialData.monthly_expenses)}
Monthly Debt Payments: {formatNum(financialData.monthly_debt_payments)}
{/* Retirement */}
Retirement Savings: {formatNum(financialData.retirement_savings)}
Monthly Retirement Contribution: {formatNum(financialData.retirement_contribution)}
{/* Emergency Fund */}
Emergency Fund Savings: {formatNum(financialData.emergency_fund)}
Monthly Emergency Contribution: {formatNum(financialData.emergency_contribution)}
{/* Extra Monthly Cash Allocation */}
Extra Monthly Cash to Emergency (%): {formatNum(financialData.extra_cash_emergency_pct)}
Extra Monthly Cash to Retirement (%): {formatNum(financialData.extra_cash_retirement_pct)}
{/* --- COLLEGE SECTION --- */} {inOrPlanningCollege && (

College Info

College Name: {collegeData.selected_school || 'N/A'}
Major: {collegeData.selected_program || 'N/A'}
Program Type: {collegeData.program_type || 'N/A'}
Yearly Tuition: {formatNum(collegeData.tuition)}
Program Length (years): {formatNum(collegeData.program_length)}
Credit Hours Per Year: {formatNum(collegeData.credit_hours_per_year)}
{/* Only render "Credit Hours Required" for Doctoral / First Professional / Graduate/Professional Certificate */} {[ "Doctoral Degree", "First Professional Degree", "Graduate/Professional Certificate" ].includes(collegeData.program_type) && (
Credit Hours Required: {formatNum(collegeData.credit_hours_required)}
)} {/* Only render Hours Completed if "currently_enrolled" */} {careerData.college_enrollment_status === 'currently_enrolled' && (
Hours Completed: {formatNum(collegeData.hours_completed)}
)}
Is In State?: {formatYesNo(collegeData.is_in_state)}
Loan Deferral Until Graduation?: {formatYesNo(collegeData.loan_deferral_until_graduation)}
Annual Financial Aid: {formatNum(collegeData.annual_financial_aid)}
Existing College Debt: {formatNum(collegeData.existing_college_debt)}
Extra Monthly Payment: {formatNum(collegeData.extra_payment)}
Expected Graduation: {collegeData.expected_graduation || 'N/A'}
Expected Salary: {formatNum(collegeData.expected_salary)}
)} {/* --- ACTION BUTTONS --- */}
); } export default ReviewPage;