import { modelID } from "@/ai/providers"; import { Textarea as ShadcnTextarea } from "@/components/ui/textarea"; import { ArrowUp, Loader2 } from "lucide-react"; import { ModelPicker } from "./model-picker"; interface InputProps { input: string; handleInputChange: (event: React.ChangeEvent) => void; isLoading: boolean; status: string; stop: () => void; selectedModel: modelID; setSelectedModel: (model: modelID) => void; } export const Textarea = ({ input, handleInputChange, isLoading, status, stop, selectedModel, setSelectedModel, }: InputProps) => { const isStreaming = status === "streaming" || status === "submitted"; return (
{ if (e.key === "Enter" && !e.shiftKey && !isLoading && input.trim()) { e.preventDefault(); e.currentTarget.form?.requestSubmit(); } }} />
); };