import React from "react"; import { Button } from "@/components/ui/button"; import { Send, Loader2 } from "lucide-react"; import { AutosizeTextarea } from "@/components/ui/autosize-textarea"; import { InputProps } from "../types"; import { ModelSelector } from "./ModelSelector"; import { AttachmentDropdown } from "./AttachmentDropdown"; import { DocumentBadgesScrollArea } from "./DocumentBadgesScrollArea"; export const Input = React.memo(({ input, selectedModel, attachments, onInputChange, onModelChange, onSendMessage, enabledChatModels, setPreviewDocument, isUrlInputOpen, setIsUrlInputOpen, urlInput, setUrlInput, handleAttachmentFileUpload, handleAttachmentUrlUpload, handleAttachmentRemove, selectedModelName, isGenerating, stopGenerating, }: InputProps) => { return (
{attachments.length > 0 && ( )} onInputChange(e.target.value)} className="bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 resize-none p-2" maxHeight={300} minHeight={50} onKeyDown={(e) => { if (e.key === "Enter" && !e.shiftKey) { e.preventDefault(); onSendMessage(); } }} />
); }); Input.displayName = "Input";