From 6fc3c5fdbef9e52bf407705d2f3f93707b2c0537 Mon Sep 17 00:00:00 2001 From: "zhangyumei.0319" Date: Mon, 22 Jul 2024 14:35:35 +0800 Subject: [PATCH] chore: types import error --- packages/semi-ui/chat/chatBox/chatBoxContent.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/semi-ui/chat/chatBox/chatBoxContent.tsx b/packages/semi-ui/chat/chatBox/chatBoxContent.tsx index 20bf6a8e9c..df64f063dc 100644 --- a/packages/semi-ui/chat/chatBox/chatBoxContent.tsx +++ b/packages/semi-ui/chat/chatBox/chatBoxContent.tsx @@ -4,7 +4,7 @@ import { Message, Metadata } from '../interface'; import MarkdownRender from '../../markdownRender'; import { cssClasses, strings } from '@douyinfe/semi-foundation/chat/constants'; import { MDXProps } from 'mdx/types'; -import { FileAttachment, ImageAttachment } from '..//attachment'; +import { FileAttachment, ImageAttachment } from '../attachment'; import Code from './code'; const { PREFIX_CHAT_BOX } = cssClasses; @@ -28,7 +28,7 @@ const ChatBoxContent = (props: ChatBoxContentProps) => { 'SemiFile': FileAttachment, 'img': ImageAttachment, ...customMarkDownComponents - }), [customMarkDownComponents]) + }), [customMarkDownComponents]); const wrapCls = useMemo(() => { const isUser = role === ROLE.USER; @@ -48,18 +48,18 @@ const ChatBoxContent = (props: ChatBoxContentProps) => { ; } else { let realContent = ''; - if (typeof content === 'string') { + if (typeof content === 'string') { realContent = content; - } else if (Array.isArray(content)){ + } else if (Array.isArray(content)) { realContent = content.map((item)=> { if (item.type === 'text') { return item.text; } else if (item.type === 'image_url') { return `![image](${item.image_url.url})`; } else if (item.type === 'file_url') { - const {name, size, url, type} = item.file_url; + const { name, size, url, type } = item.file_url; const realType = name.split('.').pop() ?? type?.split('/').pop(); - return `` + return ``; } return ''; }).join('\n\n');