From 3e187ba6aa5fd5f8c824cd10b231ae8ab0279fd0 Mon Sep 17 00:00:00 2001 From: twwu Date: Thu, 10 Jul 2025 16:56:59 +0800 Subject: [PATCH] refactor: update BlockIcon component to handle Tool and DataSource types for conditional rendering --- web/app/components/workflow/block-icon.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/app/components/workflow/block-icon.tsx b/web/app/components/workflow/block-icon.tsx index 517fbd114b..14dcf3ac81 100644 --- a/web/app/components/workflow/block-icon.tsx +++ b/web/app/components/workflow/block-icon.tsx @@ -97,23 +97,25 @@ const BlockIcon: FC = ({ className, toolIcon, }) => { + const isToolOrDataSource = type === BlockEnum.Tool || type === BlockEnum.DataSource + return (
{ - type !== BlockEnum.Tool && ( + !isToolOrDataSource && ( getIcon(type, size === 'xs' ? 'w-3 h-3' : 'w-3.5 h-3.5') ) } { - (type === BlockEnum.Tool || type === BlockEnum.DataSource) && toolIcon && ( + isToolOrDataSource && toolIcon && ( <> { typeof toolIcon === 'string'