import React from 'react'; import { EmployeeQuestion, EMPLOYEE_QUESTIONS } from '../../employeeQuestions'; import { Input, Textarea } from './Inputs'; interface QuestionInputProps { question: EmployeeQuestion; value: string; onChange: (value: string) => void; className?: string; // For yes/no questions with follow-ups, we need access to all answers and ability to set follow-up allAnswers?: Record; onFollowupChange?: (questionId: string, value: string) => void; } // Helper function to find follow-up question for a given question const findFollowupQuestion = (questionId: string): EmployeeQuestion | null => { return EMPLOYEE_QUESTIONS.find(q => q.followupTo === questionId) || null; }; export const QuestionInput: React.FC = ({ question, value, onChange, className = '', allAnswers = {}, onFollowupChange }) => { const baseInputClasses = "w-full px-3 py-2 border border-[--border-color] rounded-lg bg-[--background-primary] text-[--text-primary] focus:outline-none focus:ring-2 focus:ring-blue-500"; switch (question.type) { case 'text': return ( onChange(e.target.value)} placeholder={question.placeholder} className={className} /> ); case 'textarea': return (