File size: 986 Bytes
cfaaa6c
 
 
 
 
1dd9186
cfaaa6c
 
 
 
 
 
 
 
 
 
 
 
 
 
1dd9186
 
cfaaa6c
 
 
 
 
 
1dd9186
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { memo } from 'react';
import NodeShell from '../components/NodeShell.jsx';
import { useWorkflow } from '../context/WorkflowContext.jsx';
import { getNodeAccent } from '../lib/nodeRegistry.js';

function StartFlowNode({ id, data, selected, type }) {
  const { getNodeHandles } = useWorkflow();
  const handles = getNodeHandles(type, data);
  const runtime = data.runtime || {};

  return (
    <NodeShell
      nodeId={id}
      title={data.title}
      accent={getNodeAccent(type)}
      selected={selected}
      status={runtime.status}
      inputs={handles.inputs}
      outputs={handles.outputs}
    >
      <div className="node-note">
        Точка входа сценария. Если в графе есть эта нода, runtime начинает только с достижимой от нее ветки.
      </div>
      {runtime.error ? <div className="node-error">{runtime.error}</div> : null}
    </NodeShell>
  );
}

export default memo(StartFlowNode);