import React, { useState } from 'react'; interface QuestionInputProps { onSubmit: (question: string) => void; disabled: boolean; placeholder?: string; } export const QuestionInput: React.FC = ({ onSubmit, disabled, placeholder }) => { const [inputValue, setInputValue] = useState(''); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); if (!inputValue.trim() || disabled) return; onSubmit(inputValue); setInputValue(''); }; return (
setInputValue(e.target.value)} disabled={disabled} placeholder={placeholder || "質問を入力..."} autoFocus />
); };