diff --git a/web/app/components/workflow/variable-inspect/right.tsx b/web/app/components/workflow/variable-inspect/right.tsx index 2ed3dd88a7..bf8b86bcc7 100644 --- a/web/app/components/workflow/variable-inspect/right.tsx +++ b/web/app/components/workflow/variable-inspect/right.tsx @@ -1,4 +1,5 @@ // import { useState } from 'react' +import { useTranslation } from 'react-i18next' import { RiArrowGoBackLine, RiCloseLine, @@ -6,22 +7,52 @@ import { } from '@remixicon/react' import { useStore } from '../store' import { BlockEnum } from '../types' +import useCurrentVars from '../hooks/use-current-vars' import Empty from './empty' import ActionButton from '@/app/components/base/action-button' import Badge from '@/app/components/base/badge' import CopyFeedback from '@/app/components/base/copy-feedback' import Tooltip from '@/app/components/base/tooltip' import BlockIcon from '@/app/components/workflow/block-icon' +import { BubbleX, Env } from '@/app/components/base/icons/src/vender/line/others' import cn from '@/utils/classnames' +export const currentVar = { + id: 'var-jfkldjjfkldaf-dfhekdfj', + type: 'node', + // type: 'conversation', + // type: 'environment', + name: 'out_put', + var_type: 'string', + // var_type: 'number', + // var_type: 'object', + // var_type: 'array[string]', + // var_type: 'array[number]', + // var_type: 'array[object]', + // var_type: 'file', + // var_type: 'array[file]', + value: 'tuituitui', +} + type Props = { handleOpenMenu: () => void } const Right = ({ handleOpenMenu }: Props) => { + const { t } = useTranslation() const bottomPanelWidth = useStore(s => s.bottomPanelWidth) const setShowVariableInspectPanel = useStore(s => s.setShowVariableInspectPanel) + const current = currentVar + + const { + resetToLastRunVar, + } = useCurrentVars() + + const resetValue = () => { + resetToLastRunVar('node_id', current.name) + } + return (