'use client'; import { useEffect, useRef } from 'react'; import { ArrowUp, Brain, Square } from 'lucide-react'; import clsx from 'clsx'; interface Props { value: string; onChange: (v: string) => void; onSubmit: () => void; onStop?: () => void; isStreaming?: boolean; disabled?: boolean; thinkingMode?: boolean; onToggleThinking?: () => void; } export default function ChatInput({ value, onChange, onSubmit, onStop, isStreaming, disabled, thinkingMode, onToggleThinking }: Props) { const ref = useRef(null); useEffect(() => { const el = ref.current; if (!el) return; el.style.height = 'auto'; el.style.height = Math.min(el.scrollHeight, 200) + 'px'; }, [value]); useEffect(() => { ref.current?.focus(); }, []); const canSend = value.trim().length > 0 && !disabled && !isStreaming; const handleKeyDown = (e: React.KeyboardEvent) => { if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); if (canSend) onSubmit(); } }; return (
{/* Input pod — single rounded container with the button inside */}