From 8d55270b8b8c698a4c6aa4bdfb1c93e431daf9b4 Mon Sep 17 00:00:00 2001 From: Simon Farshid Date: Sat, 14 Sep 2024 16:36:10 -0700 Subject: [PATCH] fix: build error (#837) --- packages/react/src/primitives/message/MessageContent.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 ;