From 3a6f5813e87c101f5c9cf2cb9fdcdd8fc715e6d4 Mon Sep 17 00:00:00 2001 From: arvinxx Date: Fri, 29 Dec 2023 20:26:19 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style:=20improve=20loading=20sty?= =?UTF-8?q?le?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ChatList/Plugins/Render/BuiltinType/index.tsx | 9 +-------- .../ChatList/Plugins/Render/DefaultType/index.tsx | 9 +-------- .../ChatList/Plugins/Render/MarkdownType/index.tsx | 8 +------- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/src/features/Conversation/ChatList/Plugins/Render/BuiltinType/index.tsx b/src/features/Conversation/ChatList/Plugins/Render/BuiltinType/index.tsx index 586adfe780aa..8280930a85b5 100644 --- a/src/features/Conversation/ChatList/Plugins/Render/BuiltinType/index.tsx +++ b/src/features/Conversation/ChatList/Plugins/Render/BuiltinType/index.tsx @@ -1,5 +1,4 @@ import { memo } from 'react'; -import { Flexbox } from 'react-layout-kit'; import { BuiltinToolsRenders } from '@/tools/renders'; @@ -17,13 +16,7 @@ const BuiltinType = memo(({ content, id, identifier, loading } const { isJSON, data } = useParseContent(content); if (!isJSON) { - return ( - loading && ( - - - - ) - ); + return loading && ; } const Render = BuiltinToolsRenders[identifier || '']; diff --git a/src/features/Conversation/ChatList/Plugins/Render/DefaultType/index.tsx b/src/features/Conversation/ChatList/Plugins/Render/DefaultType/index.tsx index 88b8492b2fa3..baf83444324d 100644 --- a/src/features/Conversation/ChatList/Plugins/Render/DefaultType/index.tsx +++ b/src/features/Conversation/ChatList/Plugins/Render/DefaultType/index.tsx @@ -1,7 +1,6 @@ import { Skeleton } from 'antd'; import dynamic from 'next/dynamic'; import { Suspense, memo } from 'react'; -import { Flexbox } from 'react-layout-kit'; import { useToolStore } from '@/store/tool'; import { pluginSelectors } from '@/store/tool/selectors'; @@ -24,13 +23,7 @@ const PluginDefaultType = memo(({ content, name, loading const { isJSON, data } = useParseContent(content); if (!isJSON) { - return ( - loading && ( - - - - ) - ); + return loading && ; } if (!manifest?.ui) return; diff --git a/src/features/Conversation/ChatList/Plugins/Render/MarkdownType/index.tsx b/src/features/Conversation/ChatList/Plugins/Render/MarkdownType/index.tsx index cd5edbf50f28..6fe73ee53a8b 100644 --- a/src/features/Conversation/ChatList/Plugins/Render/MarkdownType/index.tsx +++ b/src/features/Conversation/ChatList/Plugins/Render/MarkdownType/index.tsx @@ -1,6 +1,5 @@ import { Markdown } from '@lobehub/ui'; import { memo } from 'react'; -import { Flexbox } from 'react-layout-kit'; import Loading from '../Loading'; @@ -10,12 +9,7 @@ export interface PluginMarkdownTypeProps { } const PluginMarkdownType = memo(({ content, loading }) => { - if (loading) - return ( - - - - ); + if (loading) return ; return {content}; });