diff --git a/.changeset/purple-moose-confess.md b/.changeset/purple-moose-confess.md new file mode 100644 index 000000000..8c222f58d --- /dev/null +++ b/.changeset/purple-moose-confess.md @@ -0,0 +1,5 @@ +--- +"@assistant-ui/react": patch +--- + +feat: allow specifying Empty component in thread-config diff --git a/packages/react/src/ui/assistant-message.tsx b/packages/react/src/ui/assistant-message.tsx index 67f7a0390..5b54b2d32 100644 --- a/packages/react/src/ui/assistant-message.tsx +++ b/packages/react/src/ui/assistant-message.tsx @@ -72,6 +72,7 @@ const AssistantMessageContent = forwardRef< components={{ ...componentsProp, Text: componentsProp?.Text ?? components.Text ?? ContentPart.Text, + Empty: componentsProp?.Empty ?? components.Empty, tools: toolsComponents, }} /> diff --git a/packages/react/src/ui/thread-config.tsx b/packages/react/src/ui/thread-config.tsx index d05ad2359..66946c15c 100644 --- a/packages/react/src/ui/thread-config.tsx +++ b/packages/react/src/ui/thread-config.tsx @@ -11,7 +11,11 @@ import { import { AssistantRuntime } from "../api/AssistantRuntime"; import { AvatarProps } from "./base/avatar"; -import { TextContentPartComponent, ToolCallContentPartProps } from "../types"; +import { + EmptyContentPartComponent, + TextContentPartComponent, + ToolCallContentPartProps, +} from "../types"; import { AssistantRuntimeProvider } from "../context"; import { AssistantToolUI } from "../model-config"; import { useAssistantRuntime } from "../context/react/AssistantContext"; @@ -39,6 +43,7 @@ export type AssistantMessageConfig = { components?: | { Text?: TextContentPartComponent | undefined; + Empty?: EmptyContentPartComponent | undefined; ToolFallback?: ComponentType | undefined; } | undefined;