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 ToolForm from './components/tool-form' import Field from '@/app/components/workflow/nodes/_base/components/field' import type { NodePanelProps } from '@/app/components/workflow/types' import Loading from '@/app/components/base/loading' import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars' import StructureOutputItem from '@/app/components/workflow/nodes/_base/components/variable/object-child-tree-panel/show' import { Type } from '../llm/types' const i18nPrefix = 'workflow.nodes.tool' const Panel: FC> = ({ id, data, }) => { const { t } = useTranslation() const { readOnly, inputs, toolInputVarSchema, setInputVar, toolSettingSchema, toolSettingValue, setToolSettingValue, currCollection, isShowAuthBtn, isLoading, outputSchema, hasObjectOutput, currTool, } = useConfig(id, data) const [collapsed, setCollapsed] = React.useState(false) if (isLoading) { return
} return (
{!isShowAuthBtn && (
{toolInputVarSchema.length > 0 && ( )} {toolInputVarSchema.length > 0 && toolSettingSchema.length > 0 && ( )} {toolSettingSchema.length > 0 && ( <> )}
)}
<> {outputSchema.map(outputItem => (
{outputItem.value?.type === 'object' ? ( ) : ( )}
))}
) } export default React.memo(Panel)