import type { FC } from 'react' import React from 'react' import { useTranslation } from 'react-i18next' import Split from '../_base/components/split' import type { ToolNodeType } from './types' import useConfig from './use-config' import InputVarList from './components/input-var-list' import Button from '@/app/components/base/button' import Field from '@/app/components/workflow/nodes/_base/components/field' import type { NodePanelProps } from '@/app/components/workflow/types' import Form from '@/app/components/header/account-setting/model-provider-page/model-modal/Form' import ConfigCredential from '@/app/components/tools/setting/build-in/config-credentials' import Loading from '@/app/components/base/loading' import BeforeRunForm from '@/app/components/workflow/nodes/_base/components/before-run-form' import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars' import ResultPanel from '@/app/components/workflow/run/result-panel' const i18nPrefix = 'workflow.nodes.tool' const Panel: FC> = ({ id, data, }) => { const { t } = useTranslation() const { readOnly, inputs, toolInputVarSchema, setInputVar, handleOnVarOpen, filterVar, toolSettingSchema, toolSettingValue, setToolSettingValue, currCollection, isShowAuthBtn, showSetAuth, showSetAuthModal, hideSetAuthModal, handleSaveAuth, isLoading, isShowSingleRun, hideSingleRun, singleRunForms, runningStatus, handleRun, handleStop, runResult, } = useConfig(id, data) if (isLoading) { return
} return (
{!readOnly && isShowAuthBtn && ( <>
)} {!isShowAuthBtn && <>
{toolInputVarSchema.length > 0 && ( )} {toolInputVarSchema.length > 0 && toolSettingSchema.length > 0 && ( )}
} {showSetAuth && ( )}
<>
{isShowSingleRun && ( } /> )}
) } export default React.memo(Panel)