"use client" import { ChevronUpIcon } from "lucide-react" import NovaOrb from "@/components/nova/nova-orb" import { cn } from "@lib/utils" import { dmSansClassName } from "@/lib/fonts" import { useRef, useState } from "react" import { motion } from "motion/react" import { SendButton, StopButton } from "./actions" interface ChatInputProps { value: string onChange: (e: React.ChangeEvent) => void onSend: () => void onStop: () => void onKeyDown?: (e: React.KeyboardEvent) => void isResponding?: boolean activeStatus?: string chainOfThoughtComponent?: React.ReactNode onExpandedChange?: (expanded: boolean) => void } export default function ChatInput({ value, onChange, onSend, onStop, onKeyDown, isResponding = false, activeStatus, chainOfThoughtComponent, onExpandedChange, }: ChatInputProps) { const [isMultiline, setIsMultiline] = useState(false) const [isExpanded, setIsExpanded] = useState(false) const textareaRef = useRef(null) const handleChange = (e: React.ChangeEvent) => { onChange(e) const textarea = e.target textarea.style.height = "auto" // Set height based on scrollHeight, with a max of ~96px (4-5 lines) const newHeight = Math.min(textarea.scrollHeight, 96) textarea.style.height = `${newHeight}px` setIsMultiline(textarea.scrollHeight > 52) } return (
{chainOfThoughtComponent}