| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  | import type { ChangeEvent } from 'react' | 
					
						
							|  |  |  | import { useState } from 'react' | 
					
						
							|  |  |  | import { useTranslation } from 'react-i18next' | 
					
						
							| 
									
										
										
										
											2024-06-20 11:05:08 +08:00
										 |  |  | import { | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |   RiEditBoxLine, | 
					
						
							|  |  |  |   RiEqualizer2Line, | 
					
						
							|  |  |  |   RiExchange2Fill, | 
					
						
							|  |  |  |   RiImageAddLine, | 
					
						
							|  |  |  |   RiLayoutLeft2Line, | 
					
						
							| 
									
										
										
										
											2024-06-20 11:05:08 +08:00
										 |  |  |   RiLoader2Line, | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |   RiPlayLargeLine, | 
					
						
							| 
									
										
										
										
											2024-06-20 11:05:08 +08:00
										 |  |  | } from '@remixicon/react' | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  | import LogoSite from '@/app/components/base/logo/logo-site' | 
					
						
							|  |  |  | import Switch from '@/app/components/base/switch' | 
					
						
							|  |  |  | import Button from '@/app/components/base/button' | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  | import Divider from '@/app/components/base/divider' | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  | import { useProviderContext } from '@/context/provider-context' | 
					
						
							|  |  |  | import { Plan } from '@/app/components/billing/type' | 
					
						
							|  |  |  | import { imageUpload } from '@/app/components/base/image-uploader/utils' | 
					
						
							|  |  |  | import { useToastContext } from '@/app/components/base/toast' | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  | import { BubbleTextMod } from '@/app/components/base/icons/src/vender/solid/communication' | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  | import { | 
					
						
							|  |  |  |   updateCurrentWorkspace, | 
					
						
							|  |  |  | } from '@/service/common' | 
					
						
							|  |  |  | import { useAppContext } from '@/context/app-context' | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  | import cn from '@/utils/classnames' | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | const ALLOW_FILE_EXTENSIONS = ['svg', 'png'] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const CustomWebAppBrand = () => { | 
					
						
							|  |  |  |   const { t } = useTranslation() | 
					
						
							|  |  |  |   const { notify } = useToastContext() | 
					
						
							| 
									
										
										
										
											2023-12-20 15:37:57 +08:00
										 |  |  |   const { plan, enableBilling } = useProviderContext() | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |   const { | 
					
						
							|  |  |  |     currentWorkspace, | 
					
						
							|  |  |  |     mutateCurrentWorkspace, | 
					
						
							|  |  |  |     isCurrentWorkspaceManager, | 
					
						
							|  |  |  |   } = useAppContext() | 
					
						
							|  |  |  |   const [fileId, setFileId] = useState('') | 
					
						
							| 
									
										
										
										
											2024-05-17 18:02:00 +08:00
										 |  |  |   const [imgKey, setImgKey] = useState(Date.now()) | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |   const [uploadProgress, setUploadProgress] = useState(0) | 
					
						
							| 
									
										
										
										
											2023-12-20 15:37:57 +08:00
										 |  |  |   const isSandbox = enableBilling && plan.type === Plan.sandbox | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |   const uploading = uploadProgress > 0 && uploadProgress < 100 | 
					
						
							|  |  |  |   const webappLogo = currentWorkspace.custom_config?.replace_webapp_logo || '' | 
					
						
							|  |  |  |   const webappBrandRemoved = currentWorkspace.custom_config?.remove_webapp_brand | 
					
						
							| 
									
										
										
										
											2023-12-20 15:37:57 +08:00
										 |  |  |   const uploadDisabled = isSandbox || webappBrandRemoved || !isCurrentWorkspaceManager | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   const handleChange = (e: ChangeEvent<HTMLInputElement>) => { | 
					
						
							|  |  |  |     const file = e.target.files?.[0] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (!file) | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (file.size > 5 * 1024 * 1024) { | 
					
						
							|  |  |  |       notify({ type: 'error', message: t('common.imageUploader.uploadFromComputerLimit', { size: 5 }) }) | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     imageUpload({ | 
					
						
							|  |  |  |       file, | 
					
						
							|  |  |  |       onProgressCallback: (progress) => { | 
					
						
							|  |  |  |         setUploadProgress(progress) | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       onSuccessCallback: (res) => { | 
					
						
							|  |  |  |         setUploadProgress(100) | 
					
						
							|  |  |  |         setFileId(res.id) | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       onErrorCallback: () => { | 
					
						
							|  |  |  |         notify({ type: 'error', message: t('common.imageUploader.uploadFromComputerUploadError') }) | 
					
						
							|  |  |  |         setUploadProgress(-1) | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, false, '/workspaces/custom-config/webapp-logo/upload') | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   const handleApply = async () => { | 
					
						
							|  |  |  |     await updateCurrentWorkspace({ | 
					
						
							|  |  |  |       url: '/workspaces/custom-config', | 
					
						
							|  |  |  |       body: { | 
					
						
							|  |  |  |         remove_webapp_brand: webappBrandRemoved, | 
					
						
							|  |  |  |         replace_webapp_logo: fileId, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }) | 
					
						
							|  |  |  |     mutateCurrentWorkspace() | 
					
						
							|  |  |  |     setFileId('') | 
					
						
							| 
									
										
										
										
											2024-05-17 18:02:00 +08:00
										 |  |  |     setImgKey(Date.now()) | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   const handleRestore = async () => { | 
					
						
							|  |  |  |     await updateCurrentWorkspace({ | 
					
						
							|  |  |  |       url: '/workspaces/custom-config', | 
					
						
							|  |  |  |       body: { | 
					
						
							|  |  |  |         remove_webapp_brand: false, | 
					
						
							| 
									
										
										
										
											2024-05-17 18:02:00 +08:00
										 |  |  |         replace_webapp_logo: '', | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |       }, | 
					
						
							|  |  |  |     }) | 
					
						
							|  |  |  |     mutateCurrentWorkspace() | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   const handleSwitch = async (checked: boolean) => { | 
					
						
							|  |  |  |     await updateCurrentWorkspace({ | 
					
						
							|  |  |  |       url: '/workspaces/custom-config', | 
					
						
							|  |  |  |       body: { | 
					
						
							|  |  |  |         remove_webapp_brand: checked, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }) | 
					
						
							|  |  |  |     mutateCurrentWorkspace() | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   const handleCancel = () => { | 
					
						
							|  |  |  |     setFileId('') | 
					
						
							|  |  |  |     setUploadProgress(0) | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   return ( | 
					
						
							|  |  |  |     <div className='py-4'> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |       <div className='system-md-medium mb-2 flex items-center justify-between rounded-xl bg-background-section-burn p-4 text-text-primary'> | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |         {t('custom.webapp.removeBrand')} | 
					
						
							|  |  |  |         <Switch | 
					
						
							|  |  |  |           size='l' | 
					
						
							|  |  |  |           defaultValue={webappBrandRemoved} | 
					
						
							|  |  |  |           disabled={isSandbox || !isCurrentWorkspaceManager} | 
					
						
							|  |  |  |           onChange={handleSwitch} | 
					
						
							|  |  |  |         /> | 
					
						
							|  |  |  |       </div> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |       <div className={cn('flex h-14 items-center justify-between rounded-xl bg-background-section-burn px-4', webappBrandRemoved && 'opacity-30')}> | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |         <div> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |           <div className='system-md-medium text-text-primary'>{t('custom.webapp.changeLogo')}</div> | 
					
						
							|  |  |  |           <div className='system-xs-regular text-text-tertiary'>{t('custom.webapp.changeLogoTip')}</div> | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |         </div> | 
					
						
							|  |  |  |         <div className='flex items-center'> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |           {(uploadDisabled || (!webappLogo && !webappBrandRemoved)) && ( | 
					
						
							|  |  |  |             <> | 
					
						
							|  |  |  |               <Button | 
					
						
							|  |  |  |                 variant='ghost' | 
					
						
							|  |  |  |                 disabled={uploadDisabled || (!webappLogo && !webappBrandRemoved)} | 
					
						
							|  |  |  |                 onClick={handleRestore} | 
					
						
							|  |  |  |               > | 
					
						
							|  |  |  |                 {t('custom.restore')} | 
					
						
							|  |  |  |               </Button> | 
					
						
							|  |  |  |               <div className='mx-2 h-5 w-[1px] bg-divider-regular'></div> | 
					
						
							|  |  |  |             </> | 
					
						
							|  |  |  |           )} | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |           { | 
					
						
							|  |  |  |             !uploading && ( | 
					
						
							|  |  |  |               <Button | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |                 className='relative mr-2' | 
					
						
							| 
									
										
										
										
											2023-12-20 15:37:57 +08:00
										 |  |  |                 disabled={uploadDisabled} | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |               > | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                 <RiImageAddLine className='mr-1 h-4 w-4' /> | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |                 { | 
					
						
							|  |  |  |                   (webappLogo || fileId) | 
					
						
							|  |  |  |                     ? t('custom.change') | 
					
						
							|  |  |  |                     : t('custom.upload') | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |                 <input | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                   className={cn('absolute inset-0 block w-full text-[0] opacity-0', uploadDisabled ? 'cursor-not-allowed' : 'cursor-pointer')} | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |                   onClick={e => (e.target as HTMLInputElement).value = ''} | 
					
						
							|  |  |  |                   type='file' | 
					
						
							|  |  |  |                   accept={ALLOW_FILE_EXTENSIONS.map(ext => `.${ext}`).join(',')} | 
					
						
							|  |  |  |                   onChange={handleChange} | 
					
						
							| 
									
										
										
										
											2023-12-20 15:37:57 +08:00
										 |  |  |                   disabled={uploadDisabled} | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |                 /> | 
					
						
							|  |  |  |               </Button> | 
					
						
							|  |  |  |             ) | 
					
						
							|  |  |  |           } | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             uploading && ( | 
					
						
							|  |  |  |               <Button | 
					
						
							| 
									
										
										
										
											2024-06-21 14:17:45 +08:00
										 |  |  |                 className='relative mr-2' | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |                 disabled={true} | 
					
						
							|  |  |  |               > | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                 <RiLoader2Line className='mr-1 h-4 w-4 animate-spin' /> | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |                 {t('custom.uploading')} | 
					
						
							|  |  |  |               </Button> | 
					
						
							|  |  |  |             ) | 
					
						
							|  |  |  |           } | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             fileId && ( | 
					
						
							|  |  |  |               <> | 
					
						
							|  |  |  |                 <Button | 
					
						
							| 
									
										
										
										
											2024-06-21 14:17:45 +08:00
										 |  |  |                   className='mr-2' | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |                   onClick={handleCancel} | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |                   disabled={webappBrandRemoved || !isCurrentWorkspaceManager} | 
					
						
							|  |  |  |                 > | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |                   {t('common.operation.cancel')} | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |                 </Button> | 
					
						
							|  |  |  |                 <Button | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |                   variant='primary' | 
					
						
							| 
									
										
										
										
											2024-06-21 14:17:45 +08:00
										 |  |  |                   className='mr-2' | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |                   onClick={handleApply} | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |                   disabled={webappBrandRemoved || !isCurrentWorkspaceManager} | 
					
						
							|  |  |  |                 > | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |                   {t('custom.apply')} | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |                 </Button> | 
					
						
							|  |  |  |               </> | 
					
						
							|  |  |  |             ) | 
					
						
							|  |  |  |           } | 
					
						
							|  |  |  |         </div> | 
					
						
							|  |  |  |       </div> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |       {uploadProgress === -1 && ( | 
					
						
							|  |  |  |         <div className='mt-2 text-xs text-[#D92D20]'>{t('custom.uploadedFail')}</div> | 
					
						
							|  |  |  |       )} | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |       <div className='mb-2 mt-5 flex items-center gap-2'> | 
					
						
							|  |  |  |         <div className='system-xs-medium-uppercase shrink-0 text-text-tertiary'>{t('appOverview.overview.appInfo.preview')}</div> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |         <Divider bgStyle='gradient' className='grow' /> | 
					
						
							|  |  |  |       </div> | 
					
						
							|  |  |  |       <div className='relative mb-2 flex items-center gap-3'> | 
					
						
							|  |  |  |         {/* chat card */} | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |         <div className='flex h-[320px] grow basis-1/2 overflow-hidden rounded-2xl border-[0.5px] border-components-panel-border-subtle bg-background-default-burn'> | 
					
						
							|  |  |  |           <div className='flex h-full w-[232px] shrink-0 flex-col p-1 pr-0'> | 
					
						
							|  |  |  |             <div className='flex items-center gap-3 p-3 pr-2'> | 
					
						
							|  |  |  |               <div className={cn('inline-flex h-8 w-8 items-center justify-center rounded-lg border border-divider-regular', 'bg-components-icon-bg-blue-light-solid')}> | 
					
						
							|  |  |  |                 <BubbleTextMod className='h-4 w-4 text-components-avatar-shape-fill-stop-100' /> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |               </div> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |               <div className='system-md-semibold grow text-text-secondary'>Chatflow App</div> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |               <div className='p-1.5'> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                 <RiLayoutLeft2Line className='h-4 w-4 text-text-tertiary' /> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |               </div> | 
					
						
							|  |  |  |             </div> | 
					
						
							|  |  |  |             <div className='shrink-0 px-4 py-3'> | 
					
						
							|  |  |  |               <Button variant='secondary-accent' className='w-full justify-center'> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                 <RiEditBoxLine className='mr-1 h-4 w-4' /> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |                 <div className='p-1 opacity-20'> | 
					
						
							|  |  |  |                   <div className='h-2 w-[94px] rounded-sm bg-text-accent-light-mode-only'></div> | 
					
						
							|  |  |  |                 </div> | 
					
						
							|  |  |  |               </Button> | 
					
						
							|  |  |  |             </div> | 
					
						
							|  |  |  |             <div className='grow px-3 pt-5'> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |               <div className='flex h-8 items-center px-3 py-1'> | 
					
						
							|  |  |  |                 <div className='h-2 w-14 rounded-sm bg-text-quaternary opacity-20'></div> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |               </div> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |               <div className='flex h-8 items-center px-3 py-1'> | 
					
						
							|  |  |  |                 <div className='h-2 w-[168px] rounded-sm bg-text-quaternary opacity-20'></div> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |               </div> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |               <div className='flex h-8 items-center px-3 py-1'> | 
					
						
							|  |  |  |                 <div className='h-2 w-[128px] rounded-sm bg-text-quaternary opacity-20'></div> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |               </div> | 
					
						
							|  |  |  |             </div> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |             <div className='flex shrink-0 items-center justify-between p-3'> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |               <div className='p-1.5'> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                 <RiEqualizer2Line className='h-4 w-4 text-text-tertiary' /> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |               </div> | 
					
						
							|  |  |  |               <div className='flex items-center gap-1.5'> | 
					
						
							|  |  |  |                 {!webappBrandRemoved && ( | 
					
						
							|  |  |  |                   <> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                     <div className='system-2xs-medium-uppercase text-text-tertiary'>POWERED BY</div> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |                     {webappLogo | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                       ? <img src={`${webappLogo}?hash=${imgKey}`} alt='logo' className='block h-5 w-auto' /> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |                       : <LogoSite className='!h-5' /> | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                   </> | 
					
						
							|  |  |  |                 )} | 
					
						
							|  |  |  |               </div> | 
					
						
							|  |  |  |             </div> | 
					
						
							|  |  |  |           </div> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |           <div className='flex w-[138px] grow flex-col justify-between p-2 pr-0'> | 
					
						
							|  |  |  |             <div className='flex grow flex-col justify-between rounded-l-2xl border-[0.5px] border-r-0 border-components-panel-border-subtle bg-chatbot-bg pb-4 pl-[22px] pt-16'> | 
					
						
							|  |  |  |               <div className='w-[720px] rounded-2xl border border-divider-subtle bg-chat-bubble-bg px-4 py-3'> | 
					
						
							|  |  |  |                 <div className='body-md-regular mb-1 text-text-primary'>Hello! How can I assist you today?</div> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |                 <Button size='small'> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                   <div className='h-2 w-[144px] rounded-sm bg-text-quaternary opacity-20'></div> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |                 </Button> | 
					
						
							|  |  |  |               </div> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |               <div className='body-lg-regular flex h-[52px] w-[578px] items-center rounded-xl border border-components-chat-input-border bg-components-panel-bg-blur pl-3.5 text-text-placeholder shadow-md backdrop-blur-sm'>Talk to Dify</div> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |             </div> | 
					
						
							|  |  |  |           </div> | 
					
						
							|  |  |  |         </div> | 
					
						
							|  |  |  |         {/* workflow card */} | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |         <div className='flex h-[320px] grow basis-1/2 flex-col overflow-hidden rounded-2xl border-[0.5px] border-components-panel-border-subtle bg-background-default-burn'> | 
					
						
							|  |  |  |           <div className='w-full border-b-[0.5px] border-divider-subtle p-4 pb-0'> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |             <div className='mb-2 flex items-center gap-3'> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |               <div className={cn('inline-flex h-8 w-8 items-center justify-center rounded-lg border border-divider-regular', 'bg-components-icon-bg-indigo-solid')}> | 
					
						
							|  |  |  |                 <RiExchange2Fill className='h-4 w-4 text-components-avatar-shape-fill-stop-100' /> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |               </div> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |               <div className='system-md-semibold grow text-text-secondary'>Workflow App</div> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |               <div className='p-1.5'> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                 <RiLayoutLeft2Line className='h-4 w-4 text-text-tertiary' /> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |               </div> | 
					
						
							|  |  |  |             </div> | 
					
						
							|  |  |  |             <div className='flex items-center gap-4'> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |               <div className='system-md-semibold-uppercase flex h-10 shrink-0 items-center border-b-2 border-components-tab-active text-text-primary'>RUN ONCE</div> | 
					
						
							|  |  |  |               <div className='system-md-semibold-uppercase flex h-10 grow items-center border-b-2 border-transparent text-text-tertiary'>RUN BATCH</div> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |             </div> | 
					
						
							|  |  |  |           </div> | 
					
						
							|  |  |  |           <div className='grow bg-components-panel-bg'> | 
					
						
							|  |  |  |             <div className='p-4 pb-1'> | 
					
						
							|  |  |  |               <div className='mb-1 py-2'> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                 <div className='h-2 w-20 rounded-sm bg-text-quaternary opacity-20'></div> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |               </div> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |               <div className='h-16 w-full rounded-lg bg-components-input-bg-normal '></div> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |             </div> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |             <div className='flex items-center justify-between px-4 py-3'> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |               <Button size='small'> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                 <div className='h-2 w-10 rounded-sm bg-text-quaternary opacity-20'></div> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |               </Button> | 
					
						
							|  |  |  |               <Button variant='primary' size='small' disabled> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                 <RiPlayLargeLine className='mr-1 h-4 w-4' /> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |                 <span>Execute</span> | 
					
						
							|  |  |  |               </Button> | 
					
						
							|  |  |  |             </div> | 
					
						
							|  |  |  |           </div> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |           <div className='flex h-12 shrink-0 items-center gap-1.5 bg-components-panel-bg p-4 pt-3'> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |             {!webappBrandRemoved && ( | 
					
						
							|  |  |  |               <> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                 <div className='system-2xs-medium-uppercase text-text-tertiary'>POWERED BY</div> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |                 {webappLogo | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |                   ? <img src={`${webappLogo}?hash=${imgKey}`} alt='logo' className='block h-5 w-auto' /> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |                   : <LogoSite className='!h-5' /> | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |               </> | 
					
						
							|  |  |  |             )} | 
					
						
							|  |  |  |           </div> | 
					
						
							|  |  |  |         </div> | 
					
						
							|  |  |  |       </div> | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |     </div> | 
					
						
							|  |  |  |   ) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export default CustomWebAppBrand |