import React, { useState, useRef } from 'react'; import { SendHorizontal, Loader2, Eye, EyeOff } from 'lucide-react'; interface Props { onSend: (text: string) => void; isLoading: boolean; disabled: boolean; isOffTheRecord: boolean; onToggleOffTheRecord: () => void; } export function ChatInput({ onSend, isLoading, disabled, isOffTheRecord, onToggleOffTheRecord }: Props) { const [input, setInput] = useState(''); const textareaRef = useRef(null); const handleSubmit = () => { if (input.trim() && !isLoading && !disabled) { onSend(input); setInput(''); if (textareaRef.current) textareaRef.current.style.height = 'auto'; } }; const handleKeyDown = (e: React.KeyboardEvent) => { if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); handleSubmit(); } }; const handleChange = (e: React.ChangeEvent) => { setInput(e.target.value); e.target.style.height = 'auto'; e.target.style.height = `${Math.min(e.target.scrollHeight, 150)}px`; }; return (