| | |
| | | isComparisonOperatorNeedTranslate, |
| | | isEmptyRelatedOperator, |
| | | } from '../utils' |
| | | import { FILE_TYPE_OPTIONS, TRANSFER_METHOD } from '../../constants' |
| | | import { FILE_TYPE_OPTIONS, TRANSFER_METHOD } from '../default' |
| | | import type { ValueSelector } from '../../../types' |
| | | import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development' |
| | | import { BubbleX, Env } from '@/app/components/base/icons/src/vender/line/others' |
| | |
| | | : '' |
| | | } |
| | | return '' |
| | | }, [t]) |
| | | }, []) |
| | | |
| | | return ( |
| | | <div className='rounded-md bg-workflow-block-parma-bg'> |
| | | <div className='flex h-6 items-center px-1 '> |
| | | {!isEnvVar && !isChatVar && <Variable02 className='mr-1 h-3.5 w-3.5 shrink-0 text-text-accent' />} |
| | | {isEnvVar && <Env className='mr-1 h-3.5 w-3.5 shrink-0 text-util-colors-violet-violet-600' />} |
| | | {isChatVar && <BubbleX className='h-3.5 w-3.5 text-util-colors-teal-teal-700' />} |
| | | <div className='flex items-center px-1 h-6 '> |
| | | {!isEnvVar && !isChatVar && <Variable02 className='shrink-0 mr-1 w-3.5 h-3.5 text-text-accent' />} |
| | | {isEnvVar && <Env className='shrink-0 mr-1 w-3.5 h-3.5 text-util-colors-violet-violet-600' />} |
| | | {isChatVar && <BubbleX className='w-3.5 h-3.5 text-util-colors-teal-teal-700' />} |
| | | |
| | | <div |
| | | className={cn( |
| | |
| | | {variableName} |
| | | </div> |
| | | <div |
| | | className='mx-1 shrink-0 text-xs font-medium text-text-primary' |
| | | className='shrink-0 mx-1 text-xs font-medium text-text-primary' |
| | | title={operatorName} |
| | | > |
| | | {operatorName} |
| | | </div> |
| | | </div> |
| | | <div className='ml-[10px] border-l border-divider-regular pl-[10px]'> |
| | | <div className='ml-[10px] pl-[10px] border-l border-divider-regular'> |
| | | { |
| | | sub_variable_condition?.conditions.map((c: Condition, index) => ( |
| | | <div className='relative flex h-6 items-center space-x-1' key={c.id}> |
| | | <div className='system-xs-medium text-text-accent'>{c.key}</div> |
| | | <div className='system-xs-medium text-text-primary'>{isComparisonOperatorNeedTranslate(c.comparison_operator) ? t(`workflow.nodes.ifElse.comparisonOperator.${c.comparison_operator}`) : c.comparison_operator}</div> |
| | | {c.comparison_operator && !isEmptyRelatedOperator(c.comparison_operator) && <div className='system-xs-regular text-text-secondary'>{isSelect(c) ? selectName(c) : formatValue(c)}</div>} |
| | | {index !== sub_variable_condition.conditions.length - 1 && (<div className='absolute bottom-[-10px] right-1 z-10 text-[10px] font-medium uppercase leading-4 text-text-accent'>{t(`${i18nPrefix}.${sub_variable_condition.logical_operator}`)}</div>)} |
| | | <div className='relative flex items-center h-6 space-x-1' key={c.id}> |
| | | <div className='text-text-accent system-xs-medium'>{c.key}</div> |
| | | <div className='text-text-primary system-xs-medium'>{isComparisonOperatorNeedTranslate(c.comparison_operator) ? t(`workflow.nodes.ifElse.comparisonOperator.${c.comparison_operator}`) : c.comparison_operator}</div> |
| | | {c.comparison_operator && !isEmptyRelatedOperator(c.comparison_operator) && <div className='text-text-secondary system-xs-regular'>{isSelect(c) ? selectName(c) : formatValue(c)}</div>} |
| | | {index !== sub_variable_condition.conditions.length - 1 && (<div className='absolute z-10 right-1 bottom-[-10px] leading-4 text-[10px] font-medium text-text-accent uppercase'>{t(`${i18nPrefix}.${sub_variable_condition.logical_operator}`)}</div>)} |
| | | </div> |
| | | )) |
| | | } |