11import i18n from '@/i18n'
2- import { EActionTypes , EMessageTypes } from '@/types/flow'
2+ import { EActionTypes , EGrammarTypes , EMessageTypes } from '@/types/flow'
33import {
44 Bolt ,
55 GitPullRequest ,
@@ -11,7 +11,13 @@ import {
1111 Workflow ,
1212} from 'lucide-react'
1313import { useTranslation } from 'react-i18next'
14- import { CheckVariablesContent , MessageDialogContent } from './node-dialog'
14+ import {
15+ CheckVariablesContent ,
16+ HttpRequestDialogContent ,
17+ MessageDialogContent ,
18+ PromptAndCollectDialogContent ,
19+ SubFlowContent ,
20+ } from './node-dialog'
1521
1622export const MAP_ACTION_TO_LABEL : Record < EActionTypes , string > = {
1723 [ EActionTypes . MESSAGE ] : i18n . t ( 'flowDetail:actions.items.message' ) as string ,
@@ -70,7 +76,7 @@ export const MAP_ACTION: Record<
7076 [ EActionTypes . PROMPT_AND_COLLECT ] : {
7177 icon : ( ) => < HelpCircle className = 'w-4 h-4' /> ,
7278 label : 'Prompt and collect' ,
73- dialogContent : ( ) => < MessageDialogContent /> ,
79+ dialogContent : ( ) => < PromptAndCollectDialogContent /> ,
7480 } ,
7581 [ EActionTypes . CHECK_VARIABLES ] : {
7682 icon : ( ) => < Variable className = 'w-4 h-4' /> ,
@@ -80,7 +86,7 @@ export const MAP_ACTION: Record<
8086 [ EActionTypes . HTTP_REQUEST ] : {
8187 icon : ( ) => < GitPullRequest className = 'w-4 h-4' /> ,
8288 label : 'Http request' ,
83- dialogContent : ( ) => < div > Http request </ div > ,
89+ dialogContent : ( ) => < HttpRequestDialogContent / >,
8490 } ,
8591 [ EActionTypes . SEND_MAIL ] : {
8692 icon : ( ) => < Mail className = 'w-4 h-4' /> ,
@@ -100,7 +106,7 @@ export const MAP_ACTION: Record<
100106 [ EActionTypes . SUB_FLOW ] : {
101107 icon : ( ) => < Workflow className = 'w-4 h-4' /> ,
102108 label : 'Sub flow' ,
103- dialogContent : ( ) => < div > Sub flow </ div > ,
109+ dialogContent : ( ) => < SubFlowContent / >,
104110 } ,
105111}
106112
@@ -136,3 +142,12 @@ export const CONDITIONAL_OPERATOR = [
136142 'in' ,
137143 'not_in' ,
138144]
145+
146+ export const MAP_GRAMMAR_TYPE : Record < EGrammarTypes , string > = {
147+ [ EGrammarTypes . INTENT ] : i18n . t ( 'flowDetail:grammars_type.intent' ) ,
148+ [ EGrammarTypes . NUMBER ] : i18n . t ( 'flowDetail:grammars_type.number' ) ,
149+ [ EGrammarTypes . EMAIL ] : i18n . t ( 'flowDetail:grammars_type.email' ) ,
150+ [ EGrammarTypes . PHONE_NUMBER ] : i18n . t ( 'flowDetail:grammars_type.phone_number' ) ,
151+ [ EGrammarTypes . TEXT ] : i18n . t ( 'flowDetail:grammars_type.text' ) ,
152+ [ EGrammarTypes . YES_NO ] : i18n . t ( 'flowDetail:grammars_type.yes_no' ) ,
153+ }
0 commit comments