|
|
|
|
@ -5,11 +5,11 @@ import { useBoolean, useHover } from 'ahooks'
|
|
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
|
import {
|
|
|
|
|
RiDeleteBinLine,
|
|
|
|
|
RiEditLine,
|
|
|
|
|
} from '@remixicon/react'
|
|
|
|
|
import InputVarTypeIcon from '../../_base/components/input-var-type-icon'
|
|
|
|
|
import type { InputVar, MoreInfo } from '@/app/components/workflow/types'
|
|
|
|
|
import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development'
|
|
|
|
|
import { Edit03 } from '@/app/components/base/icons/src/vender/solid/general'
|
|
|
|
|
import Badge from '@/app/components/base/badge'
|
|
|
|
|
import ConfigVarModal from '@/app/components/app/configuration/config-var/config-modal'
|
|
|
|
|
|
|
|
|
|
@ -46,12 +46,12 @@ const VarItem: FC<Props> = ({
|
|
|
|
|
hideEditVarModal()
|
|
|
|
|
}, [onChange, hideEditVarModal])
|
|
|
|
|
return (
|
|
|
|
|
<div ref={ref} className='flex items-center h-8 justify-between px-2.5 bg-white rounded-lg border border-gray-200 shadow-xs cursor-pointer hover:shadow-md'>
|
|
|
|
|
<div ref={ref} className='flex items-center h-8 justify-between px-2.5 bg-components-panel-on-panel-item-bg rounded-lg border border-components-panel-border-subtle shadow-xs cursor-pointer hover:shadow-md shadow-shadow-shadow-3'>
|
|
|
|
|
<div className='flex items-center space-x-1 grow w-0'>
|
|
|
|
|
<Variable02 className='w-3.5 h-3.5 text-primary-500' />
|
|
|
|
|
<div title={payload.variable} className='shrink-0 max-w-[130px] truncate text-[13px] font-medium text-gray-700'>{payload.variable}</div>
|
|
|
|
|
{payload.label && (<><div className='shrink-0 text-xs font-medium text-gray-400'>·</div>
|
|
|
|
|
<div title={payload.label as string} className='max-w-[130px] truncate text-[13px] font-medium text-gray-500'>{payload.label as string}</div>
|
|
|
|
|
<Variable02 className='w-3.5 h-3.5 text-text-accent' />
|
|
|
|
|
<div title={payload.variable} className='shrink-0 max-w-[130px] truncate system-sm-medium text-text-secondary'>{payload.variable}</div>
|
|
|
|
|
{payload.label && (<><div className='shrink-0 system-xs-regular text-text-quaternary'>·</div>
|
|
|
|
|
<div title={payload.label as string} className='max-w-[130px] truncate system-xs-medium text-text-tertiary'>{payload.label as string}</div>
|
|
|
|
|
</>)}
|
|
|
|
|
{showLegacyBadge && (
|
|
|
|
|
<Badge
|
|
|
|
|
@ -66,18 +66,18 @@ const VarItem: FC<Props> = ({
|
|
|
|
|
? (
|
|
|
|
|
<>
|
|
|
|
|
{payload.required && (
|
|
|
|
|
<div className='mr-2 text-xs font-normal text-gray-500'>{t('workflow.nodes.start.required')}</div>
|
|
|
|
|
<Badge className='mr-2' uppercase>{t('workflow.nodes.start.required')}</Badge>
|
|
|
|
|
)}
|
|
|
|
|
<InputVarTypeIcon type={payload.type} className='w-3.5 h-3.5 text-gray-500' />
|
|
|
|
|
<InputVarTypeIcon type={payload.type} className='w-3 h-3 text-text-tertiary' />
|
|
|
|
|
</>
|
|
|
|
|
)
|
|
|
|
|
: (!readonly && (
|
|
|
|
|
<>
|
|
|
|
|
<div onClick={showEditVarModal} className='mr-1 p-1 rounded-md cursor-pointer hover:bg-black/5'>
|
|
|
|
|
<Edit03 className='w-4 h-4 text-gray-500' />
|
|
|
|
|
<div onClick={showEditVarModal} className='mr-1 p-1 cursor-pointer'>
|
|
|
|
|
<RiEditLine className='w-4 h-4 text-text-tertiary' />
|
|
|
|
|
</div>
|
|
|
|
|
<div onClick={onRemove} className='p-1 rounded-md cursor-pointer hover:bg-black/5'>
|
|
|
|
|
<RiDeleteBinLine className='w-4 h-4 text-gray-500' />
|
|
|
|
|
<div onClick={onRemove} className='p-1 cursor-pointer'>
|
|
|
|
|
<RiDeleteBinLine className='w-4 h-4 text-text-tertiary' />
|
|
|
|
|
</div>
|
|
|
|
|
</>
|
|
|
|
|
))}
|
|
|
|
|
|