@@ -8,7 +8,7 @@ import * as Yup from 'yup';
88
99import TemplateIcon from 'assets/images/icons/Template/UnselectedDark.svg?react' ;
1010
11- import { CALL_TO_ACTION , QUICK_REPLY } from 'common/constants' ;
11+ import { BUTTON_OPTIONS , CALL_TO_ACTION , QUICK_REPLY } from 'common/constants' ;
1212import { validateMedia } from 'common/utils' ;
1313import { AutoComplete } from 'components/UI/Form/AutoComplete/AutoComplete' ;
1414import { Checkbox } from 'components/UI/Form/Checkbox/Checkbox' ;
@@ -60,12 +60,6 @@ const buttonTypes: any = {
6060 WHATSAPP_FORM : { type : 'whatsapp_form' , form_id : '' , text : '' , navigate_screen : '' } ,
6161} ;
6262
63- export const buttonOptions : any = [
64- { id : 'CALL_TO_ACTION' , label : 'Call to Action' } ,
65- { id : 'QUICK_REPLY' , label : 'Quick Reply' } ,
66- { id : 'WHATSAPP_FORM' , label : 'WhatsApp Form' } ,
67- ] ;
68-
6963export const HSM = ( ) => {
7064 const location : any = useLocation ( ) ;
7165 const [ language , setLanguageId ] = useState < any > ( null ) ;
@@ -89,7 +83,7 @@ export const HSM = () => {
8983 const [ languageOptions , setLanguageOptions ] = useState < any > ( [ ] ) ;
9084 const [ validatingURL , setValidatingURL ] = useState < boolean > ( false ) ;
9185 const [ isUrlValid , setIsUrlValid ] = useState < any > ( ) ;
92- const [ templateType , setTemplateType ] = useState < any > ( buttonOptions [ 0 ] ) ;
86+ const [ templateType , setTemplateType ] = useState < any > ( BUTTON_OPTIONS [ 0 ] ) ;
9387 const [ dynamicUrlParams , setDynamicUrlParams ] = useState < any > ( {
9488 urlType : 'Static' ,
9589 sampleSuffix : '' ,
@@ -334,7 +328,7 @@ export const HSM = () => {
334328 if ( hasButtons ) {
335329 const { buttons : buttonsVal } = getTemplateAndButtons ( templateButtonType , exampleValue , buttons ) ;
336330 setTemplateButtons ( buttonsVal ) ;
337- setTemplateType ( buttonOptions . find ( ( btn : any ) => btn . id === templateButtonType ) ) ;
331+ setTemplateType ( BUTTON_OPTIONS . find ( ( btn : any ) => btn . id === templateButtonType ) ) ;
338332 setIsAddButtonChecked ( hasButtons ) ;
339333 const parse = convertButtonsToTemplate ( buttonsVal , templateButtonType ) ;
340334 const parsedText = parse . length ? `| ${ parse . join ( ' | ' ) } ` : null ;
0 commit comments