"use client"; import type { ReactNode, RefObject } from "react"; type Props = { input: string; setInput: (v: string) => void; send: () => void; stop: () => void; busy: boolean; summariesReady: boolean; // Why the chat cannot ask at all, shown as one line under the box (the box is // disabled). Set on the hub when it has no archives, or every one is switched // off. blocked?: ReactNode; hasKey: boolean; markdownOn: boolean; setMarkdownOn: (v: boolean) => void; textareaRef?: RefObject; }; export function Composer(props: Props) { const { input, setInput, send, stop, busy, summariesReady, blocked, hasKey, markdownOn, setMarkdownOn, textareaRef, } = props; return (
{ e.preventDefault(); send(); }} // Below lg the messages ride the document scroll, so the composer is // pinned to the bottom of the viewport — the question box is the point of // the page and should never be a scroll away. `-mx-4 px-4` lets its // background span the padded column it sits in. className="flex flex-col gap-2 max-lg:sticky max-lg:bottom-0 max-lg:z-10 max-lg:-mx-4 max-lg:border-t max-lg:border-border max-lg:bg-background max-lg:px-4 max-lg:pt-2 max-lg:pb-[calc(0.5rem+env(safe-area-inset-bottom,0px))]" >