diff --git a/packages/react/src/primitives/message/MessageContent.tsx b/packages/react/src/primitives/message/MessageContent.tsx index f3b721026..52406d4d6 100644 --- a/packages/react/src/primitives/message/MessageContent.tsx +++ b/packages/react/src/primitives/message/MessageContent.tsx @@ -75,7 +75,7 @@ type MessageContentPartComponentProps = { const MessageContentPartComponent: FC = ({ components: { Text = defaultComponents.Text, - Empty = Text, + Empty, Image = defaultComponents.Image, UI = defaultComponents.UI, tools: { by_name = {}, Fallback = undefined } = {}, @@ -93,7 +93,9 @@ const MessageContentPartComponent: FC = ({ case "text": if (status.type === "requires-action") throw new Error("Encountered unexpected requires-action status"); - if (part === EMPTY_CONTENT) return ; + if (part === EMPTY_CONTENT && !!Empty) { + return ; + } return ;