"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 { type ReactNode, 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 /** Model + space controls on one row with send; textarea full-width above */ stackedToolbar?: ReactNode /** Nova status row + chain-of-thought toggle (off for e.g. home composer) */ showStatusStrip?: boolean } export default function ChatInput({ value, onChange, onSend, onStop, onKeyDown, isResponding = false, activeStatus, chainOfThoughtComponent, onExpandedChange, stackedToolbar, showStatusStrip = true, }: 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 ( {showStatusStrip ? ( <>
{chainOfThoughtComponent}
) : null} {stackedToolbar ? (