import { cn } from '@/lib/utils'; import { ArrowUp } from 'lucide-react'; import { useEffect, useState } from 'react'; import TextareaAutosize from 'react-textarea-autosize'; import { Attach, CopilotToggle } from './MessageInputActions'; const MessageInput = ({ sendMessage, loading, }: { sendMessage: (message: string) => void; loading: boolean; }) => { const [copilotEnabled, setCopilotEnabled] = useState(false); const [message, setMessage] = useState(''); const [textareaRows, setTextareaRows] = useState(1); const [mode, setMode] = useState<'multi' | 'single'>('single'); useEffect(() => { if (textareaRows >= 2 && message && mode === 'single') { setMode('multi'); } else if (!message && mode === 'multi') { setMode('single'); } }, [textareaRows, mode, message]); return (
); }; export default MessageInput;