// import { useState } from 'react' import { useTranslation } from 'react-i18next' import { RiArrowGoBackLine, RiCloseLine, RiMenuLine, } from '@remixicon/react' import { useStore } from '../store' import type { BlockEnum } from '../types' import useCurrentVars from '../hooks/use-inspect-vars-crud' import Empty from './empty' import ValueContent from './value-content' 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 { Variable02 } from '@/app/components/base/icons/src/vender/solid/development' import type { currentVarType } from './panel' import { VarInInspectType } from '@/types/workflow' import cn from '@/utils/classnames' type Props = { currentNodeVar?: currentVarType handleOpenMenu: () => void } const Right = ({ currentNodeVar, handleOpenMenu, }: Props) => { const { t } = useTranslation() const bottomPanelWidth = useStore(s => s.bottomPanelWidth) const setShowVariableInspectPanel = useStore(s => s.setShowVariableInspectPanel) const { resetToLastRunVar, } = useCurrentVars() const resetValue = () => { if (!currentNodeVar) return resetToLastRunVar(currentNodeVar.nodeId, currentNodeVar.var.name) } return (
{/* header */}
{bottomPanelWidth < 488 && ( )}
{currentNodeVar && ( <> {currentNodeVar.nodeType === VarInInspectType.environment && ( )} {currentNodeVar.nodeType === VarInInspectType.conversation && ( )} {currentNodeVar.nodeType === VarInInspectType.system && ( )} {currentNodeVar.nodeType !== VarInInspectType.environment && currentNodeVar.nodeType !== VarInInspectType.conversation && currentNodeVar.nodeType !== VarInInspectType.system && ( <>
{currentNodeVar.nodeTitle}
/
)}
{currentNodeVar.var.name}
{currentNodeVar.var.value_type}
)}
{currentNodeVar && ( <> {currentNodeVar.var.edited && ( {t('workflow.debug.variableInspect.edited')} )} {currentNodeVar.var.edited && ( )} {currentNodeVar.var.value_type !== 'secret' && ( )} )} setShowVariableInspectPanel(false)}>
{/* content */}
{!currentNodeVar && } {currentNodeVar && }
) } export default Right