import './ChatInput.css'

interface ChatInputProps {
  value: string
  onChange: (value: string) => void
  onSend: () => void
  onKeyDown: (e: React.KeyboardEvent) => void
  disabled: boolean
}

function ChatInput({ value, onChange, onSend, onKeyDown, disabled }: ChatInputProps) {
  return (
    <div className="chat-input">
      <textarea
        value={value}
        onChange={(e) => onChange(e.target.value)}
        onKeyDown={onKeyDown}
        placeholder="Type your message..."
        disabled={disabled}
        rows={1}
      />
      <button
        type="button"
        onClick={onSend}
        disabled={disabled || !value.trim()}
        className="send-button"
      >
        Send
      </button>
    </div>
  )
}

export default ChatInput
