| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  | 'use client' | 
					
						
							|  |  |  | import type { FC } from 'react' | 
					
						
							|  |  |  | import React, { useState } from 'react' | 
					
						
							|  |  |  | import { useTranslation } from 'react-i18next' | 
					
						
							|  |  |  | import produce from 'immer' | 
					
						
							|  |  |  | import type { Emoji, WorkflowToolProviderParameter, WorkflowToolProviderRequest } from '../types' | 
					
						
							| 
									
										
										
										
											2024-07-09 15:05:40 +08:00
										 |  |  | import cn from '@/utils/classnames' | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  | import Drawer from '@/app/components/base/drawer-plus' | 
					
						
							| 
									
										
										
										
											2024-10-21 10:32:37 +08:00
										 |  |  | import Input from '@/app/components/base/input' | 
					
						
							|  |  |  | import Textarea from '@/app/components/base/textarea' | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  | import Button from '@/app/components/base/button' | 
					
						
							|  |  |  | import Toast from '@/app/components/base/toast' | 
					
						
							|  |  |  | import EmojiPicker from '@/app/components/base/emoji-picker' | 
					
						
							|  |  |  | import AppIcon from '@/app/components/base/app-icon' | 
					
						
							|  |  |  | import MethodSelector from '@/app/components/tools/workflow-tool/method-selector' | 
					
						
							|  |  |  | import LabelSelector from '@/app/components/tools/labels/selector' | 
					
						
							|  |  |  | import ConfirmModal from '@/app/components/tools/workflow-tool/confirm-modal' | 
					
						
							|  |  |  | import Tooltip from '@/app/components/base/tooltip' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | type Props = { | 
					
						
							|  |  |  |   isAdd?: boolean | 
					
						
							|  |  |  |   payload: any | 
					
						
							|  |  |  |   onHide: () => void | 
					
						
							|  |  |  |   onRemove?: () => void | 
					
						
							|  |  |  |   onCreate?: (payload: WorkflowToolProviderRequest & { workflow_app_id: string }) => void | 
					
						
							|  |  |  |   onSave?: (payload: WorkflowToolProviderRequest & Partial<{ | 
					
						
							|  |  |  |     workflow_app_id: string | 
					
						
							|  |  |  |     workflow_tool_id: string | 
					
						
							|  |  |  |   }>) => void | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | // Add and Edit
 | 
					
						
							|  |  |  | const WorkflowToolAsModal: FC<Props> = ({ | 
					
						
							|  |  |  |   isAdd, | 
					
						
							|  |  |  |   payload, | 
					
						
							|  |  |  |   onHide, | 
					
						
							|  |  |  |   onRemove, | 
					
						
							|  |  |  |   onSave, | 
					
						
							|  |  |  |   onCreate, | 
					
						
							|  |  |  | }) => { | 
					
						
							|  |  |  |   const { t } = useTranslation() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-17 17:05:13 +08:00
										 |  |  |   const [showEmojiPicker, setShowEmojiPicker] = useState<boolean>(false) | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |   const [emoji, setEmoji] = useState<Emoji>(payload.icon) | 
					
						
							|  |  |  |   const [label, setLabel] = useState<string>(payload.label) | 
					
						
							|  |  |  |   const [name, setName] = useState(payload.name) | 
					
						
							|  |  |  |   const [description, setDescription] = useState(payload.description) | 
					
						
							|  |  |  |   const [parameters, setParameters] = useState<WorkflowToolProviderParameter[]>(payload.parameters) | 
					
						
							|  |  |  |   const handleParameterChange = (key: string, value: string, index: number) => { | 
					
						
							|  |  |  |     const newData = produce(parameters, (draft: WorkflowToolProviderParameter[]) => { | 
					
						
							|  |  |  |       if (key === 'description') | 
					
						
							|  |  |  |         draft[index].description = value | 
					
						
							|  |  |  |       else | 
					
						
							|  |  |  |         draft[index].form = value | 
					
						
							|  |  |  |     }) | 
					
						
							|  |  |  |     setParameters(newData) | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   const [labels, setLabels] = useState<string[]>(payload.labels) | 
					
						
							|  |  |  |   const handleLabelSelect = (value: string[]) => { | 
					
						
							|  |  |  |     setLabels(value) | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   const [privacyPolicy, setPrivacyPolicy] = useState(payload.privacy_policy) | 
					
						
							|  |  |  |   const [showModal, setShowModal] = useState(false) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   const isNameValid = (name: string) => { | 
					
						
							| 
									
										
										
										
											2024-07-11 11:08:50 +08:00
										 |  |  |     // when the user has not input anything, no need for a warning
 | 
					
						
							|  |  |  |     if (name === '') | 
					
						
							|  |  |  |       return true | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-14 15:28:20 +08:00
										 |  |  |     return /^\w+$/.test(name) | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   const onConfirm = () => { | 
					
						
							| 
									
										
										
										
											2024-07-11 11:08:50 +08:00
										 |  |  |     let errorMessage = '' | 
					
						
							|  |  |  |     if (!label) | 
					
						
							|  |  |  |       errorMessage = t('common.errorMsg.fieldRequired', { field: t('tools.createTool.name') }) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (!name) | 
					
						
							|  |  |  |       errorMessage = t('common.errorMsg.fieldRequired', { field: t('tools.createTool.nameForToolCall') }) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (!isNameValid(name)) | 
					
						
							|  |  |  |       errorMessage = t('tools.createTool.nameForToolCall') + t('tools.createTool.nameForToolCallTip') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (errorMessage) { | 
					
						
							|  |  |  |       Toast.notify({ | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |         type: 'error', | 
					
						
							| 
									
										
										
										
											2024-07-11 11:08:50 +08:00
										 |  |  |         message: errorMessage, | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |       }) | 
					
						
							| 
									
										
										
										
											2024-07-11 11:08:50 +08:00
										 |  |  |       return | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2024-07-11 11:08:50 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |     const requestParams = { | 
					
						
							|  |  |  |       name, | 
					
						
							|  |  |  |       description, | 
					
						
							|  |  |  |       icon: emoji, | 
					
						
							|  |  |  |       label, | 
					
						
							|  |  |  |       parameters: parameters.map(item => ({ | 
					
						
							|  |  |  |         name: item.name, | 
					
						
							|  |  |  |         description: item.description, | 
					
						
							|  |  |  |         form: item.form, | 
					
						
							|  |  |  |       })), | 
					
						
							|  |  |  |       labels, | 
					
						
							|  |  |  |       privacy_policy: privacyPolicy, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (!isAdd) { | 
					
						
							|  |  |  |       onSave?.({ | 
					
						
							|  |  |  |         ...requestParams, | 
					
						
							|  |  |  |         workflow_tool_id: payload.workflow_tool_id, | 
					
						
							|  |  |  |       }) | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     else { | 
					
						
							|  |  |  |       onCreate?.({ | 
					
						
							|  |  |  |         ...requestParams, | 
					
						
							|  |  |  |         workflow_app_id: payload.workflow_app_id, | 
					
						
							|  |  |  |       }) | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   return ( | 
					
						
							|  |  |  |     <> | 
					
						
							|  |  |  |       <Drawer | 
					
						
							|  |  |  |         isShow | 
					
						
							|  |  |  |         onHide={onHide} | 
					
						
							|  |  |  |         title={t('workflow.common.workflowAsTool')!} | 
					
						
							|  |  |  |         panelClassName='mt-2 !w-[640px]' | 
					
						
							|  |  |  |         maxWidthClassName='!max-w-[640px]' | 
					
						
							|  |  |  |         height='calc(100vh - 16px)' | 
					
						
							| 
									
										
										
										
											2025-02-17 17:05:13 +08:00
										 |  |  |         headerClassName='!border-b-divider' | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |         body={ | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |           <div className='flex h-full flex-col'> | 
					
						
							|  |  |  |             <div className='h-0 grow space-y-4 overflow-y-auto px-6 py-3'> | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |               {/* name & icon */} | 
					
						
							|  |  |  |               <div> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                 <div className='system-sm-medium py-2 text-text-primary'>{t('tools.createTool.name')} <span className='ml-1 text-red-500'>*</span></div> | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                 <div className='flex items-center justify-between gap-3'> | 
					
						
							| 
									
										
										
										
											2024-08-22 13:32:59 +08:00
										 |  |  |                   <AppIcon size='large' onClick={() => { setShowEmojiPicker(true) }} className='cursor-pointer' iconType='emoji' icon={emoji.content} background={emoji.background} /> | 
					
						
							| 
									
										
										
										
											2024-10-21 10:32:37 +08:00
										 |  |  |                   <Input | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                     className='h-10 grow' | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                     placeholder={t('tools.createTool.toolNamePlaceHolder')!} | 
					
						
							|  |  |  |                     value={label} | 
					
						
							|  |  |  |                     onChange={e => setLabel(e.target.value)} | 
					
						
							|  |  |  |                   /> | 
					
						
							|  |  |  |                 </div> | 
					
						
							|  |  |  |               </div> | 
					
						
							|  |  |  |               {/* name for tool call */} | 
					
						
							|  |  |  |               <div> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                 <div className='system-sm-medium flex items-center py-2 text-text-primary'> | 
					
						
							| 
									
										
										
										
											2024-07-11 11:08:50 +08:00
										 |  |  |                   {t('tools.createTool.nameForToolCall')} <span className='ml-1 text-red-500'>*</span> | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                   <Tooltip | 
					
						
							| 
									
										
										
										
											2024-08-26 13:00:02 +08:00
										 |  |  |                     popupContent={ | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                       <div className='w-[180px]'> | 
					
						
							|  |  |  |                         {t('tools.createTool.nameForToolCallPlaceHolder')} | 
					
						
							|  |  |  |                       </div> | 
					
						
							|  |  |  |                     } | 
					
						
							| 
									
										
										
										
											2024-08-26 13:00:02 +08:00
										 |  |  |                   /> | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                 </div> | 
					
						
							| 
									
										
										
										
											2024-10-21 10:32:37 +08:00
										 |  |  |                 <Input | 
					
						
							|  |  |  |                   className='h-10' | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                   placeholder={t('tools.createTool.nameForToolCallPlaceHolder')!} | 
					
						
							|  |  |  |                   value={name} | 
					
						
							|  |  |  |                   onChange={e => setName(e.target.value)} | 
					
						
							|  |  |  |                 /> | 
					
						
							|  |  |  |                 {!isNameValid(name) && ( | 
					
						
							| 
									
										
										
										
											2024-07-11 11:08:50 +08:00
										 |  |  |                   <div className='text-xs leading-[18px] text-red-500'>{t('tools.createTool.nameForToolCallTip')}</div> | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                 )} | 
					
						
							|  |  |  |               </div> | 
					
						
							|  |  |  |               {/* description */} | 
					
						
							|  |  |  |               <div> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                 <div className='system-sm-medium py-2 text-text-primary'>{t('tools.createTool.description')}</div> | 
					
						
							| 
									
										
										
										
											2024-10-21 10:32:37 +08:00
										 |  |  |                 <Textarea | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                   placeholder={t('tools.createTool.descriptionPlaceholder') || ''} | 
					
						
							|  |  |  |                   value={description} | 
					
						
							|  |  |  |                   onChange={e => setDescription(e.target.value)} | 
					
						
							|  |  |  |                 /> | 
					
						
							|  |  |  |               </div> | 
					
						
							|  |  |  |               {/* Tool Input  */} | 
					
						
							|  |  |  |               <div> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                 <div className='system-sm-medium py-2 text-text-primary'>{t('tools.createTool.toolInput.title')}</div> | 
					
						
							|  |  |  |                 <div className='w-full overflow-x-auto rounded-lg border border-divider-regular'> | 
					
						
							|  |  |  |                   <table className='w-full text-xs font-normal leading-[18px] text-text-secondary'> | 
					
						
							|  |  |  |                     <thead className='uppercase text-text-tertiary'> | 
					
						
							| 
									
										
										
										
											2025-02-17 17:05:13 +08:00
										 |  |  |                       <tr className='border-b border-divider-regular'> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                         <th className="w-[156px] p-2 pl-3 font-medium">{t('tools.createTool.toolInput.name')}</th> | 
					
						
							|  |  |  |                         <th className="w-[102px] p-2 pl-3 font-medium">{t('tools.createTool.toolInput.method')}</th> | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                         <th className="p-2 pl-3 font-medium">{t('tools.createTool.toolInput.description')}</th> | 
					
						
							|  |  |  |                       </tr> | 
					
						
							|  |  |  |                     </thead> | 
					
						
							|  |  |  |                     <tbody> | 
					
						
							|  |  |  |                       {parameters.map((item, index) => ( | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                         <tr key={index} className='border-b border-divider-regular last:border-0'> | 
					
						
							|  |  |  |                           <td className="max-w-[156px] p-2 pl-3"> | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                             <div className='text-[13px] leading-[18px]'> | 
					
						
							|  |  |  |                               <div title={item.name} className='flex'> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                                 <span className='truncate font-medium text-text-primary'>{item.name}</span> | 
					
						
							|  |  |  |                                 <span className='shrink-0 pl-1 text-xs leading-[18px] text-[#ec4a0a]'>{item.required ? t('tools.createTool.toolInput.required') : ''}</span> | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                               </div> | 
					
						
							| 
									
										
										
										
											2025-02-17 17:05:13 +08:00
										 |  |  |                               <div className='text-text-tertiary'>{item.type}</div> | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                             </div> | 
					
						
							|  |  |  |                           </td> | 
					
						
							|  |  |  |                           <td> | 
					
						
							|  |  |  |                             {item.name === '__image' && ( | 
					
						
							|  |  |  |                               <div className={cn( | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                                 'flex h-9 min-h-[56px] cursor-default items-center gap-1 bg-transparent px-3 py-2', | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                               )}> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                                 <div className={cn('grow truncate text-[13px] leading-[18px] text-text-secondary')}> | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                                   {t('tools.createTool.toolInput.methodParameter')} | 
					
						
							|  |  |  |                                 </div> | 
					
						
							|  |  |  |                               </div> | 
					
						
							|  |  |  |                             )} | 
					
						
							|  |  |  |                             {item.name !== '__image' && ( | 
					
						
							| 
									
										
										
										
											2024-06-19 14:13:16 +08:00
										 |  |  |                               <MethodSelector value={item.form} onChange={value => handleParameterChange('form', value, index)} /> | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                             )} | 
					
						
							|  |  |  |                           </td> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                           <td className="w-[236px] p-2 pl-3 text-text-tertiary"> | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                             <input | 
					
						
							|  |  |  |                               type='text' | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                               className='w-full appearance-none bg-transparent text-[13px] font-normal leading-[18px] text-text-secondary caret-primary-600 outline-none placeholder:text-text-quaternary' | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                               placeholder={t('tools.createTool.toolInput.descriptionPlaceholder')!} | 
					
						
							|  |  |  |                               value={item.description} | 
					
						
							|  |  |  |                               onChange={e => handleParameterChange('description', e.target.value, index)} | 
					
						
							|  |  |  |                             /> | 
					
						
							|  |  |  |                           </td> | 
					
						
							|  |  |  |                         </tr> | 
					
						
							|  |  |  |                       ))} | 
					
						
							|  |  |  |                     </tbody> | 
					
						
							|  |  |  |                   </table> | 
					
						
							|  |  |  |                 </div> | 
					
						
							|  |  |  |               </div> | 
					
						
							|  |  |  |               {/* Tags */} | 
					
						
							|  |  |  |               <div> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                 <div className='system-sm-medium py-2 text-text-primary'>{t('tools.createTool.toolInput.label')}</div> | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                 <LabelSelector value={labels} onChange={handleLabelSelect} /> | 
					
						
							|  |  |  |               </div> | 
					
						
							|  |  |  |               {/* Privacy Policy */} | 
					
						
							|  |  |  |               <div> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                 <div className='system-sm-medium py-2 text-text-primary'>{t('tools.createTool.privacyPolicy')}</div> | 
					
						
							| 
									
										
										
										
											2024-10-21 10:32:37 +08:00
										 |  |  |                 <Input | 
					
						
							|  |  |  |                   className='h-10' | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                   value={privacyPolicy} | 
					
						
							|  |  |  |                   onChange={e => setPrivacyPolicy(e.target.value)} | 
					
						
							| 
									
										
										
										
											2024-10-21 10:32:37 +08:00
										 |  |  |                   placeholder={t('tools.createTool.privacyPolicyPlaceholder') || ''} /> | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |               </div> | 
					
						
							|  |  |  |             </div> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |             <div className={cn((!isAdd && onRemove) ? 'justify-between' : 'justify-end', 'mt-2 flex shrink-0 rounded-b-[10px] border-t border-divider-regular bg-background-section-burn px-6 py-4')} > | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |               {!isAdd && onRemove && ( | 
					
						
							| 
									
										
										
										
											2025-02-17 17:05:13 +08:00
										 |  |  |                 <Button variant='warning' onClick={onRemove}>{t('common.operation.delete')}</Button> | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |               )} | 
					
						
							|  |  |  |               <div className='flex space-x-2 '> | 
					
						
							| 
									
										
										
										
											2024-06-21 14:17:45 +08:00
										 |  |  |                 <Button onClick={onHide}>{t('common.operation.cancel')}</Button> | 
					
						
							| 
									
										
										
										
											2024-07-11 11:08:50 +08:00
										 |  |  |                 <Button variant='primary' onClick={() => { | 
					
						
							| 
									
										
										
										
											2024-05-27 21:57:08 +08:00
										 |  |  |                   if (isAdd) | 
					
						
							|  |  |  |                     onConfirm() | 
					
						
							|  |  |  |                   else | 
					
						
							|  |  |  |                     setShowModal(true) | 
					
						
							|  |  |  |                 }}>{t('common.operation.save')}</Button> | 
					
						
							|  |  |  |               </div> | 
					
						
							|  |  |  |             </div> | 
					
						
							|  |  |  |           </div> | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         isShowMask={true} | 
					
						
							|  |  |  |         clickOutsideNotOpen={true} | 
					
						
							|  |  |  |       /> | 
					
						
							|  |  |  |       {showEmojiPicker && <EmojiPicker | 
					
						
							|  |  |  |         onSelect={(icon, icon_background) => { | 
					
						
							|  |  |  |           setEmoji({ content: icon, background: icon_background }) | 
					
						
							|  |  |  |           setShowEmojiPicker(false) | 
					
						
							|  |  |  |         }} | 
					
						
							|  |  |  |         onClose={() => { | 
					
						
							|  |  |  |           setShowEmojiPicker(false) | 
					
						
							|  |  |  |         }} | 
					
						
							|  |  |  |       />} | 
					
						
							|  |  |  |       {showModal && ( | 
					
						
							|  |  |  |         <ConfirmModal | 
					
						
							|  |  |  |           show={showModal} | 
					
						
							|  |  |  |           onClose={() => setShowModal(false)} | 
					
						
							|  |  |  |           onConfirm={onConfirm} | 
					
						
							|  |  |  |         /> | 
					
						
							|  |  |  |       )} | 
					
						
							|  |  |  |     </> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   ) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | export default React.memo(WorkflowToolAsModal) |