import { useTheme } from '@/components/theme-provider'; import { Handle, NodeProps, Position } from '@xyflow/react'; import { Flex } from 'antd'; import classNames from 'classnames'; import { get } from 'lodash'; import { useGetComponentLabelByValue } from '../../hooks/use-get-begin-query'; import { IGenerateParameter } from '../../interface'; import { LeftHandleStyle, RightHandleStyle } from './handle-icon'; import NodeHeader from './node-header'; import { ITemplateNode } from '@/interfaces/database/flow'; import styles from './index.less'; export function TemplateNode({ id, data, isConnectable = true, selected, }: NodeProps) { const parameters: IGenerateParameter[] = get(data, 'form.parameters', []); const getLabel = useGetComponentLabelByValue(id); const { theme } = useTheme(); return (
{parameters.map((x) => ( {getLabel(x.component_id)} ))}
); }