1
+ import React , { useEffect } from 'react' ;
2
+ import { Modal , Card , Row , Col , Typography , Divider } from 'antd' ;
3
+ import { CustomerServiceOutlined , CloudServerOutlined } from '@ant-design/icons' ;
4
+ import { useSelector , useDispatch } from 'react-redux' ;
5
+ import { getDeploymentId } from 'redux/selectors/configSelectors' ;
6
+ import { fetchDeploymentIdAction } from 'redux/reduxActions/configActions' ;
7
+ import { Environment } from '../types/environment.types' ;
8
+
9
+ const { Title, Text } = Typography ;
10
+
11
+ interface ContactLowcoderModalProps {
12
+ visible : boolean ;
13
+ onClose : ( ) => void ;
14
+ environment : Environment ;
15
+ }
16
+
17
+ /**
18
+ * Professional modal for contacting Lowcoder team with HubSpot form integration
19
+ */
20
+ const ContactLowcoderModal : React . FC < ContactLowcoderModalProps > = ( {
21
+ visible,
22
+ onClose,
23
+ environment
24
+ } ) => {
25
+ // Get deploymentId from Redux config provider
26
+ const deploymentId = useSelector ( getDeploymentId ) ;
27
+ const dispatch = useDispatch ( ) ;
28
+
29
+ // Fetch deployment ID when modal opens if not already available
30
+ useEffect ( ( ) => {
31
+ if ( visible && ! deploymentId ) {
32
+ dispatch ( fetchDeploymentIdAction ( ) ) ;
33
+ }
34
+ } , [ visible , deploymentId , dispatch ] ) ;
35
+
36
+ return (
37
+ < Modal
38
+ title = {
39
+ < div style = { { display : 'flex' , alignItems : 'center' , gap : '12px' } } >
40
+ < CustomerServiceOutlined style = { { fontSize : '20px' , color : '#1890ff' } } />
41
+ < span style = { { fontSize : '18px' , fontWeight : 600 } } > Contact Lowcoder Team</ span >
42
+ </ div >
43
+ }
44
+ open = { visible }
45
+ onCancel = { onClose }
46
+ footer = { null }
47
+ width = { 800 }
48
+ centered
49
+ style = { { top : 20 } }
50
+ bodyStyle = { { padding : '24px' } }
51
+ >
52
+ { /* Environment Context Section */ }
53
+ < Card
54
+ style = { {
55
+ marginBottom : '24px' ,
56
+ borderRadius : '8px' ,
57
+ background : '#fafafa' ,
58
+ border : '1px solid #f0f0f0'
59
+ } }
60
+ bodyStyle = { { padding : '16px' } }
61
+ >
62
+ < Row gutter = { [ 16 , 8 ] } align = "middle" >
63
+ < Col >
64
+ < CloudServerOutlined style = { { fontSize : '24px' , color : '#1890ff' } } />
65
+ </ Col >
66
+ < Col flex = { 1 } >
67
+ < div >
68
+ < Text strong style = { { fontSize : '16px' , color : '#262626' } } >
69
+ Environment: { environment . environmentName || 'Unnamed Environment' }
70
+ </ Text >
71
+ < br />
72
+ < Text style = { { fontSize : '14px' , color : '#8c8c8c' , fontFamily : 'monospace' } } >
73
+ Environment ID: { environment . environmentId }
74
+ </ Text >
75
+ < br />
76
+ < Text style = { { fontSize : '14px' , color : '#8c8c8c' , fontFamily : 'monospace' } } >
77
+ Deployment ID: { deploymentId || 'Loading...' }
78
+ </ Text >
79
+ </ div >
80
+ </ Col >
81
+ </ Row >
82
+ </ Card >
83
+
84
+ < Divider style = { { margin : '16px 0' } } />
85
+
86
+ { /* HubSpot Form Integration Section */ }
87
+ < div style = { { minHeight : '400px' , padding : '20px 0' } } >
88
+ < Title level = { 4 } style = { { textAlign : 'center' , marginBottom : '24px' , color : '#262626' } } >
89
+ Get in Touch
90
+ </ Title >
91
+
92
+ < Text style = { {
93
+ textAlign : 'center' ,
94
+ display : 'block' ,
95
+ marginBottom : '32px' ,
96
+ fontSize : '16px' ,
97
+ color : '#595959' ,
98
+ lineHeight : '1.6'
99
+ } } >
100
+ Our team is here to help you resolve licensing issues and get your environment up and running.
101
+ </ Text >
102
+
103
+ { /* HubSpot Form Container */ }
104
+ < div style = { {
105
+ minHeight : '300px' ,
106
+ display : 'flex' ,
107
+ alignItems : 'center' ,
108
+ justifyContent : 'center' ,
109
+ background : '#fdfdfd' ,
110
+ borderRadius : '8px' ,
111
+ border : '1px solid #f0f0f0'
112
+ } } >
113
+ { /* HubSpot form will be integrated here */ }
114
+ < div style = { {
115
+ textAlign : 'center' ,
116
+ color : '#8c8c8c' ,
117
+ fontSize : '14px'
118
+ } } >
119
+ < CustomerServiceOutlined style = { { fontSize : '48px' , marginBottom : '16px' , color : '#d9d9d9' } } />
120
+ < div > Contact form will be integrated here</ div >
121
+ </ div >
122
+ </ div >
123
+
124
+ { /* Environment data is available for form pre-filling */ }
125
+ { /* Data available: environment.environmentName, environment.environmentId, deploymentId,
126
+ environment.licenseStatus, environment.environmentType, environment.licenseError */ }
127
+ </ div >
128
+ </ Modal >
129
+ ) ;
130
+ } ;
131
+
132
+ export default ContactLowcoderModal ;
0 commit comments