@ -2,6 +2,7 @@ import { useTranslation } from 'react-i18next'
import {
RiArrowGoBackLine ,
RiCloseLine ,
RiDeleteBinLine ,
RiMenuLine ,
} from '@remixicon/react'
import { useStore } from '../store'
@ -38,6 +39,7 @@ const Right = ({
const setCurrentFocusNodeId = useStore ( s = > s . setCurrentFocusNodeId )
const {
resetConversationVar ,
resetToLastRunVar ,
editInspectVarValue ,
} = useCurrentVars ( )
@ -57,6 +59,11 @@ const Right = ({
setCurrentFocusNodeId ( '' )
}
const handleClear = ( ) = > {
if ( ! currentNodeVar ) return
resetConversationVar ( currentNodeVar . var . id )
}
return (
< div className = { cn ( 'flex h-full flex-col' ) } >
{ /* header */ }
@ -110,6 +117,13 @@ const Right = ({
< / ActionButton >
< / Tooltip >
) }
{ currentNodeVar . var . type === VarInInspectType . conversation && (
< Tooltip popupContent = { t ( 'workflow.debug.variableInspect.clearNode' ) } >
< ActionButton onClick = { handleClear } >
< RiDeleteBinLine className = 'h-4 w-4' / >
< / ActionButton >
< / Tooltip >
) }
{ currentNodeVar . var . value_type !== 'secret' && (
< CopyFeedback content = { currentNodeVar . var . value ? JSON . stringify ( currentNodeVar . var . value ) : '' } / >
) }