import React, { useState } from 'react'; import type { CaseData } from '../types'; import { StepIndicator } from './StepIndicator'; interface CaseIntakeFormProps { onSubmit: (data: CaseData) => void; } const steps = ["About You", "Medical", "Work History", "Limitations"]; export const CaseIntakeForm: React.FC = ({ onSubmit }) => { const [currentStep, setCurrentStep] = useState(0); const [formData, setFormData] = useState({ age: '', medicalConditions: '', workHistory: '', limitations: '', }); const handleChange = (e: React.ChangeEvent) => { const { name, value } = e.target; setFormData(prev => ({ ...prev, [name]: value })); }; const nextStep = () => { if (currentStep < steps.length - 1) { setCurrentStep(currentStep + 1); } }; const prevStep = () => { if (currentStep > 0) { setCurrentStep(currentStep - 1); } }; const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); onSubmit(formData); }; const isNextDisabled = () => { switch(currentStep) { case 0: return !formData.age; case 1: return !formData.medicalConditions; case 2: return !formData.workHistory; case 3: return !formData.limitations; default: return true; } }; return (
{currentStep === 0 && (

About You

This information helps the AI tailor recommendations.

)} {currentStep === 1 && (

Your Medical Conditions

List all diagnosed conditions that affect your ability to work.