import type { FC } from 'react' import React from 'react' import type { PluginTriggerNodeType } from './types' import Split from '@/app/components/workflow/nodes/_base/components/split' import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars' import type { NodePanelProps } from '@/app/components/workflow/types' import useConfig from './use-config' import TriggerForm from './components/trigger-form' import StructureOutputItem from '@/app/components/workflow/nodes/_base/components/variable/object-child-tree-panel/show' import { Type } from '../llm/types' import { BlockEnum } from '@/app/components/workflow/types' const Panel: FC> = ({ id, data, }) => { const { readOnly, triggerParameterSchema, triggerParameterValue, setTriggerParameterValue, outputSchema, hasObjectOutput, currentProvider, currentEvent, subscriptionSelected, } = useConfig(id, data) const disableVariableInsertion = data.type === BlockEnum.TriggerPlugin // Convert output schema to VarItem format const outputVars = Object.entries(outputSchema.properties || {}).map(([name, schema]: [string, any]) => ({ name, type: schema.type || 'string', description: schema.description || '', })) return (
{/* Dynamic Parameters Form - Only show when authenticated */} {triggerParameterSchema.length > 0 && subscriptionSelected && ( <>
)} {/* Output Variables - Always show */} <> {outputVars.map(varItem => ( ))} {Object.entries(outputSchema.properties || {}).map(([name, schema]: [string, any]) => (
{schema.type === 'object' ? ( ) : null}
))}
) } export default React.memo(Panel)