import type { FC } from 'react' import React from 'react' import type { ToolNodeType } from './types' import type { NodeProps } from '@/app/components/workflow/types' import { FormTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations' const Node: FC> = ({ data, }) => { const { tool_configurations, paramSchemas } = data const toolConfigs = Object.keys(tool_configurations || {}) if (!toolConfigs.length) return null return (
{toolConfigs.map((key, index) => (
{key}
{typeof tool_configurations[key].value === 'string' && (
{paramSchemas?.find(i => i.name === key)?.type === FormTypeEnum.secretInput ? '********' : tool_configurations[key].value}
)} {typeof tool_configurations[key].value === 'number' && (
{Number.isNaN(tool_configurations[key].value) ? '' : tool_configurations[key].value}
)} {typeof tool_configurations[key] !== 'string' && tool_configurations[key]?.type === FormTypeEnum.modelSelector && (
{tool_configurations[key].model}
)}
))}
) } export default React.memo(Node)