11import React from "react" ;
2- import { Flow , NodeFunction } from "@code0-tech/sagittarius-graphql-types" ;
2+ import { Flow , LiteralValue , NodeFunction , ReferenceValue } from "@code0-tech/sagittarius-graphql-types" ;
33import {
44 Badge ,
55 Button ,
@@ -15,7 +15,6 @@ import {Panel} from "@xyflow/react";
1515import { ButtonGroup } from "@code0-tech/pictor/dist/components/button-group/ButtonGroup" ;
1616import { FlowService } from "@edition/flow/services/Flow.service" ;
1717import { SuggestionDialogComponent } from "@edition/function/components/suggestion/SuggestionDialogComponent" ;
18- import { FunctionSuggestion } from "@edition/function/components/suggestion/FunctionSuggestionComponent.view" ;
1918import { Suggestion } from "@edition/function/components/suggestion/Suggestion.util" ;
2019import { useHotkeys } from "react-hotkeys-hook" ;
2120import { useSelectedFunctionNode } from "@edition/function/hooks/FunctionNode.selected.hook" ;
@@ -51,14 +50,14 @@ export const FlowPanelControlComponent: React.FC<FlowPanelControlComponentProps>
5150 } )
5251 } , [ selectedNode , flowService , flowStore ] )
5352
54- const addNodeToFlow = React . useCallback ( ( suggestion : FunctionSuggestion | Suggestion ) => {
55- if ( flowId && suggestion . value . __typename === "NodeFunction" && selectedNode ?. id . includes ( "NodeFunction" ) ) {
53+ const addNodeToFlow = React . useCallback ( ( suggestion : NodeFunction | ReferenceValue | LiteralValue ) => {
54+ if ( flowId && suggestion . __typename === "NodeFunction" && selectedNode ?. id . includes ( "NodeFunction" ) ) {
5655 startTransition ( async ( ) => {
57- await flowService . addNextNodeById ( flowId , selectedNode ?. id as NodeFunction [ 'id' ] , suggestion . value as NodeFunction )
56+ await flowService . addNextNodeById ( flowId , selectedNode ?. id as NodeFunction [ 'id' ] , suggestion as NodeFunction )
5857 } )
59- } else if ( suggestion . value . __typename === "NodeFunction" ) {
58+ } else if ( suggestion . __typename === "NodeFunction" ) {
6059 startTransition ( async ( ) => {
61- await flowService . addNextNodeById ( flowId , null , suggestion . value as NodeFunction )
60+ await flowService . addNextNodeById ( flowId , null , suggestion as NodeFunction )
6261 } )
6362 }
6463 } , [ flowId , flowService , flowStore , selectedNode ] )
0 commit comments