| | |
| | | import { useBlocks } from './hooks' |
| | | import type { ToolDefaultValue } from './types' |
| | | import Tooltip from '@/app/components/base/tooltip' |
| | | import Badge from '@/app/components/base/badge' |
| | | |
| | | type BlocksProps = { |
| | | searchText: string |
| | |
| | | > |
| | | { |
| | | classification !== '-' && !!list.length && ( |
| | | <div className='flex h-[22px] items-start px-3 text-xs font-medium text-text-tertiary'> |
| | | <div className='flex items-start px-3 h-[22px] text-xs font-medium text-text-tertiary'> |
| | | {t(`workflow.tabs.${classification}`)} |
| | | </div> |
| | | ) |
| | |
| | | className='mb-2' |
| | | type={block.type} |
| | | /> |
| | | <div className='system-md-medium mb-1 text-text-primary'>{block.title}</div> |
| | | <div className='system-xs-regular text-text-tertiary'>{nodesExtraData[block.type].about}</div> |
| | | <div className='mb-1 system-md-medium text-text-primary'>{block.title}</div> |
| | | <div className='text-text-tertiary system-xs-regular'>{nodesExtraData[block.type].about}</div> |
| | | </div> |
| | | )} |
| | | > |
| | | <div |
| | | key={block.type} |
| | | className='flex h-8 w-full cursor-pointer items-center rounded-lg px-3 hover:bg-state-base-hover' |
| | | className='flex items-center px-3 w-full h-8 rounded-lg hover:bg-state-base-hover cursor-pointer' |
| | | onClick={() => onSelect(block.type)} |
| | | > |
| | | <BlockIcon |
| | | className='mr-2 shrink-0' |
| | | type={block.type} |
| | | /> |
| | | <div className='grow text-sm text-text-secondary'>{block.title}</div> |
| | | { |
| | | block.type === BlockEnum.LoopEnd && ( |
| | | <Badge |
| | | text={t('workflow.nodes.loop.loopNode')} |
| | | className='ml-2 shrink-0' |
| | | /> |
| | | ) |
| | | } |
| | | <div className='text-sm text-text-secondary'>{block.title}</div> |
| | | </div> |
| | | </Tooltip> |
| | | )) |
| | |
| | | <div className='p-1'> |
| | | { |
| | | isEmpty && ( |
| | | <div className='flex h-[22px] items-center px-3 text-xs font-medium text-text-tertiary'>{t('workflow.tabs.noResult')}</div> |
| | | <div className='flex items-center px-3 h-[22px] text-xs font-medium text-text-tertiary'>{t('workflow.tabs.noResult')}</div> |
| | | ) |
| | | } |
| | | { |