"use client"; import { MessageInput, MessageInputTextarea, MessageInputToolbar, MessageInputSubmitButton, MessageInputError, // MessageInputMcpConfigButton, } from "@/components/ui/message-input"; import { MessageSuggestions, MessageSuggestionsStatus, MessageSuggestionsList, } from "@/components/ui/message-suggestions"; import type { messageVariants } from "@/components/ui/message"; import { ThreadHistory, ThreadHistoryHeader, ThreadHistoryNewButton, ThreadHistorySearch, ThreadHistoryList, } from "@/components/ui/thread-history"; import { ThreadContent, ThreadContentMessages, } from "@/components/ui/thread-content"; import { ThreadContainer, useThreadContainerContext, } from "@/components/ui/thread-container"; import { ScrollableMessageContainer } from "@/components/ui/scrollable-message-container"; import { useMergedRef } from "@/lib/thread-hooks"; import type { Suggestion } from "@tambo-ai/react"; import type { VariantProps } from "class-variance-authority"; import * as React from "react"; /** * Props for the MessageThreadFull component */ export interface MessageThreadFullProps extends React.HTMLAttributes { /** Optional context key for the thread */ contextKey?: string; /** * Controls the visual styling of messages in the thread. * Possible values include: "default", "compact", etc. * These values are defined in messageVariants from "@/components/ui/message". * @example variant="compact" */ variant?: VariantProps["variant"]; } /** * A full-screen chat thread component with message history, input, and suggestions */ export const MessageThreadFull = React.forwardRef< HTMLDivElement, MessageThreadFullProps >(({ className, contextKey, variant, ...props }, ref) => { const { containerRef, historyPosition } = useThreadContainerContext(); const mergedRef = useMergedRef(ref, containerRef); const threadHistorySidebar = ( ); const defaultSuggestions: Suggestion[] = [ { id: "suggestion-1", title: "Get started", detailedSuggestion: "What can you help me with?", messageId: "welcome-query", }, { id: "suggestion-2", title: "Learn more", detailedSuggestion: "Tell me about your capabilities.", messageId: "capabilities-query", }, { id: "suggestion-3", title: "Examples", detailedSuggestion: "Show me some example queries I can try.", messageId: "examples-query", }, ]; return ( <> {/* Thread History Sidebar - rendered first if history is on the left */} {historyPosition === "left" && threadHistorySidebar} {/* Message suggestions status */} {/* Message input */}
{/* Uncomment this to enable client-side MCP config modal button */} {/* */}
{/* Message suggestions */}
{/* Thread History Sidebar - rendered last if history is on the right */} {historyPosition === "right" && threadHistorySidebar} ); }); MessageThreadFull.displayName = "MessageThreadFull";