import { ActionBarPrimitive, AssistantIf, BranchPickerPrimitive, ComposerPrimitive, ErrorPrimitive, MessagePrimitive, ThreadPrimitive, } from "@assistant-ui/react"; import { ArrowDownIcon, ArrowUpIcon, CheckIcon, ChevronLeftIcon, ChevronRightIcon, CopyIcon, DownloadIcon, PencilIcon, RefreshCwIcon, SquareIcon, } from "lucide-react"; import type { FC } from "react"; import { ComposerAddAttachment, ComposerAttachments, UserMessageAttachments, } from "@/components/assistant-ui/attachment"; import { MarkdownText } from "@/components/assistant-ui/markdown-text"; import { ToolFallback } from "@/components/assistant-ui/tool-fallback"; import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; export const Thread: FC = () => { return ( thread.isEmpty}> ); }; const ThreadScrollToBottom: FC = () => { return ( ); }; const ThreadWelcome: FC = () => { return (

Hello there!

How can I help you today?

); }; const SUGGESTIONS = [ { title: "What's the weather", label: "in San Francisco?", prompt: "What's the weather in San Francisco?", }, { title: "Explain React hooks", label: "like useState and useEffect", prompt: "Explain React hooks like useState and useEffect", }, ] as const; const ThreadSuggestions: FC = () => { return (
{SUGGESTIONS.map((suggestion, index) => (
))}
); }; const Composer: FC = () => { return ( ); }; const ComposerAction: FC = () => { return (
!thread.isRunning}> thread.isRunning}>
); }; const MessageError: FC = () => { return ( ); }; const AssistantMessage: FC = () => { return (
); }; const AssistantActionBar: FC = () => { return ( message.isCopied}> !message.isCopied}> ); }; const UserMessage: FC = () => { return (
); }; const UserActionBar: FC = () => { return ( ); }; const EditComposer: FC = () => { return (
); }; const BranchPicker: FC = ({ className, ...rest }) => { return ( / ); };