@djb25/digit-ui-module-ekyc 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +3281 -4272
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
- package/src/Module.js +42 -31
- package/src/components/ConnectionDetailsView.js +5 -3
- package/src/components/DesktopInbox.js +68 -184
- package/src/components/EKYCCard.js +35 -27
- package/src/components/Filter.js +48 -53
- package/src/components/SearchFormFieldsComponent.js +55 -0
- package/src/components/StatusCards.js +7 -3
- package/src/config/config.js +69 -0
- package/src/hook/useInboxTableConfig.js +134 -0
- package/src/pages/citizen/index.js +1 -1
- package/src/pages/employee/AadhaarVerification.js +473 -609
- package/src/pages/employee/AddressDetails.js +508 -733
- package/src/pages/employee/ConsumerDetails.js +512 -0
- package/src/pages/employee/Create.js +5 -1
- package/src/pages/employee/Dashboard.js +43 -0
- package/src/pages/employee/EKYCForm.js +117 -0
- package/src/pages/employee/Inbox.js +248 -140
- package/src/pages/employee/Mapping.js +640 -6
- package/src/pages/employee/MeterDetails.js +481 -471
- package/src/pages/employee/PropertyInfo.js +472 -562
- package/src/pages/employee/Review.js +268 -540
- package/src/pages/employee/Update.js +9 -0
- package/src/pages/employee/index.js +59 -94
|
@@ -1,647 +1,511 @@
|
|
|
1
|
-
import React, { useState,
|
|
1
|
+
// import React, { useState, Fragment, useEffect, useRef } from "react";
|
|
2
|
+
// import {
|
|
3
|
+
// Card,
|
|
4
|
+
// CardLabel,
|
|
5
|
+
// TextInput,
|
|
6
|
+
// SubmitBar,
|
|
7
|
+
// CardHeader,
|
|
8
|
+
// RadioButtons,
|
|
9
|
+
// ActionBar,
|
|
10
|
+
// Loader,
|
|
11
|
+
// FormStep,
|
|
12
|
+
// } from "@djb25/digit-ui-react-components";
|
|
13
|
+
// import { useTranslation } from "react-i18next";
|
|
14
|
+
// import { useLocation, useHistory } from "react-router-dom";
|
|
15
|
+
// import { getSavedData } from "../../utils";
|
|
16
|
+
// import AddressDetails from "./AddressDetails";
|
|
17
|
+
|
|
18
|
+
// const AadhaarVerification = ({ config, onSelect, formData, t: tProps }) => {
|
|
19
|
+
// const { t } = useTranslation();
|
|
20
|
+
// const location = useLocation();
|
|
21
|
+
// const history = useHistory();
|
|
22
|
+
// const addressSectionRef = useRef(null);
|
|
23
|
+
|
|
24
|
+
// const flowState = location.state || {};
|
|
25
|
+
// const { isEditing, kNumber } = flowState;
|
|
26
|
+
|
|
27
|
+
// // Robust data extraction from formData
|
|
28
|
+
// const activeEdits = formData || {};
|
|
29
|
+
// const rawReviewData = formData?.reviewData || formData?.connectionDetails || {};
|
|
30
|
+
// const reviewWrapper = rawReviewData?.applicationReview || rawReviewData;
|
|
31
|
+
// const applicationData = (Array.isArray(reviewWrapper) ? reviewWrapper[0] : reviewWrapper) || {};
|
|
32
|
+
// const apiData = applicationData?.newData || applicationData;
|
|
33
|
+
// const apiConn = apiData?.connectionDetails || apiData || {};
|
|
34
|
+
|
|
35
|
+
// const initialData = {
|
|
36
|
+
// userName: apiConn.consumerName || "",
|
|
37
|
+
// mobileNumber: apiConn.phoneNumber || apiConn.mobileNo || "",
|
|
38
|
+
// whatsappNumber: apiConn.phoneNumber || apiConn.mobileNo || "",
|
|
39
|
+
// email: apiConn.email || "",
|
|
40
|
+
// noOfPersons: apiConn.noOfPerson || apiConn.noOfPersons || "",
|
|
41
|
+
// };
|
|
42
|
+
|
|
43
|
+
// const aadhaarData = activeEdits?.aadhaarData || {};
|
|
44
|
+
|
|
45
|
+
// const [aadhaarNumber, setAadhaarNumber] = useState(aadhaarData.aadhaarNumber || "");
|
|
46
|
+
// const [isAadhaarVerified, setIsAadhaarVerified] = useState(aadhaarData.isAadhaarVerified === true || isEditing); // Auto-verify if editing
|
|
47
|
+
// const [showOtpField, setShowOtpField] = useState(false);
|
|
48
|
+
// const [otp, setOtp] = useState("");
|
|
49
|
+
// const [otpError, setOtpError] = useState(false);
|
|
50
|
+
// const [nameCorrect, setNameCorrect] = useState(aadhaarData.nameCorrect || { code: "YES", name: "CORE_COMMON_YES" });
|
|
51
|
+
// const [userName, setUserName] = useState(aadhaarData.name || initialData.userName);
|
|
52
|
+
// const [mobileChange, setMobileChange] = useState(aadhaarData.mobileChange || { code: "YES", name: "CORE_COMMON_YES" });
|
|
53
|
+
// const [mobileNumber, setMobileNumber] = useState(aadhaarData.mobileNumber || initialData.mobileNumber);
|
|
54
|
+
// const [whatsappNumber, setWhatsappNumber] = useState(aadhaarData.whatsappNumber || initialData.whatsappNumber);
|
|
55
|
+
// const [email, setEmail] = useState(aadhaarData.email || initialData.email);
|
|
56
|
+
// const [noOfPersons, setNoOfPersons] = useState(aadhaarData.noOfPersons || initialData.noOfPersons);
|
|
57
|
+
// const [showAddressSection, setShowAddressSection] = useState(false);
|
|
58
|
+
|
|
59
|
+
// const getUpdatedData = () => ({
|
|
60
|
+
// aadhaarNumber,
|
|
61
|
+
// isAadhaarVerified,
|
|
62
|
+
// name: userName,
|
|
63
|
+
// nameCorrect,
|
|
64
|
+
// mobileChange,
|
|
65
|
+
// mobileNumber,
|
|
66
|
+
// whatsappNumber,
|
|
67
|
+
// email,
|
|
68
|
+
// noOfPersons,
|
|
69
|
+
// gender: "Male",
|
|
70
|
+
// dob: "01/01/1990",
|
|
71
|
+
// });
|
|
72
|
+
|
|
73
|
+
// const handleVerifyAadhaar = () => {
|
|
74
|
+
// if (aadhaarNumber.length === 12) setShowOtpField(true);
|
|
75
|
+
// };
|
|
76
|
+
|
|
77
|
+
// const handleVerifyOtp = () => {
|
|
78
|
+
// if (otp === "123456") {
|
|
79
|
+
// setIsAadhaarVerified(true);
|
|
80
|
+
// setShowOtpField(false);
|
|
81
|
+
// setShowAddressSection(true);
|
|
82
|
+
// if (onSelect) {
|
|
83
|
+
// onSelect(config.key, { ...getUpdatedData(), isAadhaarVerified: true });
|
|
84
|
+
// }
|
|
85
|
+
// } else {
|
|
86
|
+
// setOtpError(true);
|
|
87
|
+
// }
|
|
88
|
+
// };
|
|
89
|
+
|
|
90
|
+
// const onStepSelect = () => {
|
|
91
|
+
// const updatedData = getUpdatedData();
|
|
92
|
+
// if (onSelect) {
|
|
93
|
+
// onSelect(config.key, updatedData);
|
|
94
|
+
// } else {
|
|
95
|
+
// if (isEditing) {
|
|
96
|
+
// history.push("/digit-ui/employee/ekyc/review", { ...location.state, edits: { ...edits, aadhaarData: updatedData } });
|
|
97
|
+
// } else {
|
|
98
|
+
// history.push("/digit-ui/employee/ekyc/address-details", {
|
|
99
|
+
// ...location.state,
|
|
100
|
+
// edits: { ...edits, aadhaarData: updatedData }
|
|
101
|
+
// });
|
|
102
|
+
// }
|
|
103
|
+
// }
|
|
104
|
+
// };
|
|
105
|
+
|
|
106
|
+
// const handleUpdateAndReturn = () => {
|
|
107
|
+
// history.push("/digit-ui/employee/ekyc/review", { ...location.state, edits: { ...edits, aadhaarData: getUpdatedData() } });
|
|
108
|
+
// };
|
|
109
|
+
|
|
110
|
+
// const yesNoOptions = [
|
|
111
|
+
// { code: "YES", name: "CORE_COMMON_YES" },
|
|
112
|
+
// { code: "NO", name: "CORE_COMMON_NO" },
|
|
113
|
+
// ];
|
|
114
|
+
|
|
115
|
+
// return (
|
|
116
|
+
// <Fragment>
|
|
117
|
+
// <FormStep
|
|
118
|
+
// t={t}
|
|
119
|
+
// config={config || {}}
|
|
120
|
+
// onSelect={onStepSelect}
|
|
121
|
+
// isDisabled={!isAadhaarVerified || !userName || !mobileNumber}
|
|
122
|
+
// label={t(config?.texts?.submitBarLabel) || (isEditing ? t("EKYC_UPDATE_AND_RETURN") : t("ES_COMMON_CONTINUE"))}
|
|
123
|
+
// >
|
|
124
|
+
// <CardLabel>{t("EKYC_AADHAAR_NUMBER")} <span className="astericColor">*</span></CardLabel>
|
|
125
|
+
// <TextInput
|
|
126
|
+
// id="aadhaarNumber"
|
|
127
|
+
// name="aadhaarNumber"
|
|
128
|
+
// value={aadhaarNumber}
|
|
129
|
+
// onChange={(e) => setAadhaarNumber(e.target.value)}
|
|
130
|
+
// placeholder={t("EKYC_ENTER_AADHAAR_NUMBER")}
|
|
131
|
+
// maxLength={12}
|
|
132
|
+
// disabled={isAadhaarVerified}
|
|
133
|
+
// />
|
|
134
|
+
// {!isAadhaarVerified && !showOtpField && (
|
|
135
|
+
// <SubmitBar label={t("EKYC_VERIFY")} onSubmit={handleVerifyAadhaar} disabled={aadhaarNumber.length !== 12} />
|
|
136
|
+
// )}
|
|
137
|
+
|
|
138
|
+
// {showOtpField && (
|
|
139
|
+
// <Fragment>
|
|
140
|
+
// <CardLabel>{t("EKYC_ENTER_OTP")} <span className="astericColor">*</span></CardLabel>
|
|
141
|
+
// <TextInput
|
|
142
|
+
// id="otp"
|
|
143
|
+
// name="otp"
|
|
144
|
+
// value={otp}
|
|
145
|
+
// onChange={(e) => setOtp(e.target.value)}
|
|
146
|
+
// placeholder="123456"
|
|
147
|
+
// maxLength={6}
|
|
148
|
+
// />
|
|
149
|
+
// {otpError && <div style={{ color: "red", fontSize: "12px" }}>{t("EKYC_INVALID_OTP")}</div>}
|
|
150
|
+
// <SubmitBar label={t("EKYC_VERIFY_OTP")} onSubmit={handleVerifyOtp} disabled={otp.length !== 6} />
|
|
151
|
+
// </Fragment>
|
|
152
|
+
// )}
|
|
153
|
+
|
|
154
|
+
// {isAadhaarVerified && (
|
|
155
|
+
// <Fragment>
|
|
156
|
+
// <CardLabel>{t("EKYC_IS_NAME_CORRECT")}</CardLabel>
|
|
157
|
+
// <RadioButtons
|
|
158
|
+
// options={yesNoOptions}
|
|
159
|
+
// optionsKey="name"
|
|
160
|
+
// selectedOption={nameCorrect}
|
|
161
|
+
// onSelect={setNameCorrect}
|
|
162
|
+
// />
|
|
163
|
+
// <CardLabel>{t("EKYC_USER_NAME")} <span className="astericColor">*</span></CardLabel>
|
|
164
|
+
// <TextInput
|
|
165
|
+
// id="userName"
|
|
166
|
+
// name="userName"
|
|
167
|
+
// value={userName}
|
|
168
|
+
// onChange={(e) => setUserName(e.target.value)}
|
|
169
|
+
// disabled={nameCorrect.code === "NO"}
|
|
170
|
+
// />
|
|
171
|
+
|
|
172
|
+
// <CardLabel>{t("EKYC_CHANGE_MOBILE")}</CardLabel>
|
|
173
|
+
// <RadioButtons
|
|
174
|
+
// options={yesNoOptions}
|
|
175
|
+
// optionsKey="name"
|
|
176
|
+
// selectedOption={mobileChange}
|
|
177
|
+
// onSelect={setMobileChange}
|
|
178
|
+
// />
|
|
179
|
+
// <CardLabel>{t("EKYC_MOBILE_NUMBER")} <span className="astericColor">*</span></CardLabel>
|
|
180
|
+
// <TextInput
|
|
181
|
+
// id="mobileNumber"
|
|
182
|
+
// name="mobileNumber"
|
|
183
|
+
// value={mobileNumber}
|
|
184
|
+
// onChange={(e) => setMobileNumber(e.target.value)}
|
|
185
|
+
// disabled={mobileChange.code === "NO"}
|
|
186
|
+
// />
|
|
187
|
+
|
|
188
|
+
// <CardLabel>{t("EKYC_WHATSAPP_NUMBER")}</CardLabel>
|
|
189
|
+
// <TextInput
|
|
190
|
+
// id="whatsappNumber"
|
|
191
|
+
// name="whatsappNumber"
|
|
192
|
+
// value={whatsappNumber}
|
|
193
|
+
// onChange={(e) => setWhatsappNumber(e.target.value)}
|
|
194
|
+
// />
|
|
195
|
+
|
|
196
|
+
// <CardLabel>{t("EKYC_EMAIL_ID")}</CardLabel>
|
|
197
|
+
// <TextInput
|
|
198
|
+
// id="email"
|
|
199
|
+
// name="email"
|
|
200
|
+
// value={email}
|
|
201
|
+
// onChange={(e) => setEmail(e.target.value)}
|
|
202
|
+
// />
|
|
203
|
+
|
|
204
|
+
// <CardLabel>{t("EKYC_NO_OF_PERSONS")}</CardLabel>
|
|
205
|
+
// <TextInput
|
|
206
|
+
// id="noOfPersons"
|
|
207
|
+
// name="noOfPersons"
|
|
208
|
+
// value={noOfPersons}
|
|
209
|
+
// onChange={(e) => setNoOfPersons(e.target.value)}
|
|
210
|
+
// />
|
|
211
|
+
// </Fragment>
|
|
212
|
+
// )}
|
|
213
|
+
// </FormStep>
|
|
214
|
+
// {isEditing && !onSelect && (
|
|
215
|
+
// <ActionBar style={{ position: "static", marginTop: "20px" }}>
|
|
216
|
+
// <SubmitBar label={t("EKYC_UPDATE_AND_RETURN")} onSubmit={handleUpdateAndReturn} />
|
|
217
|
+
// </ActionBar>
|
|
218
|
+
// )}
|
|
219
|
+
// </Fragment>
|
|
220
|
+
// );
|
|
221
|
+
// };
|
|
222
|
+
|
|
223
|
+
// export default AadhaarVerification;
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
import React, { useState, Fragment } from "react";
|
|
2
228
|
import {
|
|
3
|
-
Card,
|
|
4
|
-
LabelFieldPair,
|
|
5
229
|
CardLabel,
|
|
6
230
|
TextInput,
|
|
7
|
-
|
|
8
|
-
|
|
231
|
+
Dropdown,
|
|
232
|
+
UploadFile,
|
|
9
233
|
RadioButtons,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
ConnectingCheckPoints,
|
|
13
|
-
CheckPoint,
|
|
234
|
+
Toast,
|
|
235
|
+
FormStep,
|
|
14
236
|
} from "@djb25/digit-ui-react-components";
|
|
15
|
-
import { useTranslation } from "react-i18next";
|
|
16
|
-
import { useLocation, useHistory } from "react-router-dom";
|
|
17
|
-
import { getSavedData } from "../../utils";
|
|
18
|
-
import AddressDetails from "./AddressDetails";
|
|
19
|
-
|
|
20
|
-
// ─── Icons ───────────────────────────────────────────────────────────────────
|
|
21
|
-
|
|
22
|
-
const LockIcon = ({ size = 16 }) => (
|
|
23
|
-
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round">
|
|
24
|
-
<rect x="3" y="11" width="18" height="11" rx="2" />
|
|
25
|
-
<path d="M7 11V7a5 5 0 0 1 10 0v4" />
|
|
26
|
-
</svg>
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
const UserIcon = ({ size = 16, color = "currentColor" }) => (
|
|
30
|
-
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="1.8" strokeLinecap="round">
|
|
31
|
-
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" />
|
|
32
|
-
<circle cx="12" cy="7" r="4" />
|
|
33
|
-
</svg>
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
const PhoneIcon = ({ size = 16, color = "currentColor" }) => (
|
|
37
|
-
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="1.8" strokeLinecap="round">
|
|
38
|
-
<path d="M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-5.37-5.37 19.79 19.79 0 01-3.07-8.63A2 2 0 014.82 0h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L8.91 7.91a16 16 0 006.16 6.16l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 16.92z" />
|
|
39
|
-
</svg>
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
const WhatsappIcon = ({ size = 16 }) => (
|
|
43
|
-
<svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
44
|
-
<path
|
|
45
|
-
d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413z"
|
|
46
|
-
fill="#25D366"
|
|
47
|
-
/>
|
|
48
|
-
<path
|
|
49
|
-
d="M12 2C6.477 2 2 6.477 2 12c0 1.89.525 3.66 1.438 5.168L2 22l4.832-1.438A9.96 9.96 0 0012 22c5.523 0 10-4.477 10-10S17.523 2 12 2z"
|
|
50
|
-
stroke="#25D366" strokeWidth="1.8" strokeLinecap="round"
|
|
51
|
-
/>
|
|
52
|
-
</svg>
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
const MailIcon = ({ size = 16, color = "currentColor" }) => (
|
|
56
|
-
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="1.8" strokeLinecap="round">
|
|
57
|
-
<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" />
|
|
58
|
-
<path d="M22 6l-10 7L2 6" />
|
|
59
|
-
</svg>
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
const UsersIcon = ({ size = 16, color = "currentColor" }) => (
|
|
63
|
-
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="1.8" strokeLinecap="round">
|
|
64
|
-
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" />
|
|
65
|
-
<circle cx="9" cy="7" r="4" />
|
|
66
|
-
<path d="M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75" />
|
|
67
|
-
</svg>
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
const CheckIcon = ({ size = 15, color = "#1D9E75" }) => (
|
|
71
|
-
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="2.8" strokeLinecap="round">
|
|
72
|
-
<polyline points="20 6 9 17 4 12" />
|
|
73
|
-
</svg>
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
// ─── Reusable: Icon-prefixed input wrapper ────────────────────────────────────
|
|
77
|
-
|
|
78
|
-
const IconInput = ({ icon, rightIcon, inputStyle = {}, ...props }) => (
|
|
79
|
-
<div style={{ position: "relative", width: "100%" }}>
|
|
80
|
-
<div style={{
|
|
81
|
-
position: "absolute", left: "10px", top: "50%",
|
|
82
|
-
transform: "translateY(-50%)", zIndex: 1, opacity: 0.45,
|
|
83
|
-
display: "flex", pointerEvents: "none",
|
|
84
|
-
}}>
|
|
85
|
-
{icon}
|
|
86
|
-
</div>
|
|
87
|
-
<TextInput
|
|
88
|
-
textInputStyle={{ paddingLeft: "36px", paddingRight: rightIcon ? "36px" : "12px", ...inputStyle }}
|
|
89
|
-
{...props}
|
|
90
|
-
/>
|
|
91
|
-
{rightIcon && (
|
|
92
|
-
<div style={{
|
|
93
|
-
position: "absolute", right: "10px", top: "50%",
|
|
94
|
-
transform: "translateY(-50%)", display: "flex",
|
|
95
|
-
}}>
|
|
96
|
-
{rightIcon}
|
|
97
|
-
</div>
|
|
98
|
-
)}
|
|
99
|
-
</div>
|
|
100
|
-
);
|
|
101
|
-
|
|
102
|
-
// ─── Reusable: Section heading with inline rule ───────────────────────────────
|
|
103
|
-
|
|
104
|
-
const SectionHead = ({ icon, label }) => (
|
|
105
|
-
<div style={{
|
|
106
|
-
display: "flex", alignItems: "center", gap: "8px",
|
|
107
|
-
marginBottom: "16px", marginTop: "4px",
|
|
108
|
-
}}>
|
|
109
|
-
<div style={{ opacity: 0.5, display: "flex" }}>{icon}</div>
|
|
110
|
-
<span style={{ fontSize: "15px", fontWeight: "600", color: "#0B0C0C", whiteSpace: "nowrap" }}>
|
|
111
|
-
{label}
|
|
112
|
-
</span>
|
|
113
|
-
<div style={{ flex: 1, height: "1px", background: "#EAECF0" }} />
|
|
114
|
-
</div>
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
// ─── Reusable: Radio toggle row ───────────────────────────────────────────────
|
|
118
|
-
|
|
119
|
-
const RadioToggleRow = ({ label, selected, onSelect, t, options }) => (
|
|
120
|
-
<div style={{
|
|
121
|
-
display: "flex", alignItems: "center",
|
|
122
|
-
justifyContent: "space-between", marginBottom: "8px",
|
|
123
|
-
}}>
|
|
124
|
-
<CardLabel style={{ fontWeight: "500", marginBottom: 0, fontSize: "13px", color: "#505A5F" }}>
|
|
125
|
-
{label}
|
|
126
|
-
</CardLabel>
|
|
127
|
-
<RadioButtons
|
|
128
|
-
options={options}
|
|
129
|
-
optionsKey="name"
|
|
130
|
-
selectedOption={selected}
|
|
131
|
-
onSelect={onSelect}
|
|
132
|
-
t={t}
|
|
133
|
-
innerStyles={{ display: "flex", gap: "20px", alignItems: "center" }}
|
|
134
|
-
style={{ display: "flex", gap: "20px", marginBottom: 0 }}
|
|
135
|
-
/>
|
|
136
|
-
</div>
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
// ─── Main Component ───────────────────────────────────────────────────────────
|
|
140
|
-
|
|
141
|
-
const AadhaarVerification = () => {
|
|
142
|
-
const { t } = useTranslation();
|
|
143
|
-
const location = useLocation();
|
|
144
|
-
const history = useHistory();
|
|
145
|
-
const addressSectionRef = useRef(null);
|
|
146
|
-
const { kNumber, selectedOption, connectionDetails } = location.state || {
|
|
147
|
-
kNumber: "EKYC-1234567890",
|
|
148
|
-
selectedOption: { code: "SELF", name: "EKYC_SELF" },
|
|
149
|
-
connectionDetails: {
|
|
150
|
-
connectionDetailsInfo: {
|
|
151
|
-
consumerName: "Rajesh Kumar Singh",
|
|
152
|
-
address: "House No. 45, Sector 12, New Delhi - 110001",
|
|
153
|
-
phoneNumber: "9876543210",
|
|
154
|
-
email: "rajesh.singh@example.com",
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
};
|
|
158
237
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
const [
|
|
194
|
-
const [
|
|
195
|
-
const [
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
const [
|
|
199
|
-
const [
|
|
200
|
-
const [
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
const [
|
|
204
|
-
|
|
205
|
-
const [
|
|
206
|
-
const [
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
sessionStorage.setItem("EKYC_MOBILE_CHANGE", JSON.stringify(mobileChange));
|
|
216
|
-
sessionStorage.setItem("EKYC_MOBILE_NUMBER", mobileNumber);
|
|
217
|
-
sessionStorage.setItem("EKYC_WHATSAPP_NUMBER", whatsappNumber);
|
|
218
|
-
sessionStorage.setItem("EKYC_EMAIL", email);
|
|
219
|
-
sessionStorage.setItem("EKYC_NO_OF_PERSONS", noOfPersons);
|
|
220
|
-
sessionStorage.setItem("EKYC_CURRENT_STEP", "AADHAAR");
|
|
221
|
-
}, [aadhaarLastFour, isAadhaarVerified, nameCorrect, userName, mobileChange, mobileNumber, whatsappNumber, email, noOfPersons]);
|
|
222
|
-
const [showAddressSection, setShowAddressSection] = useState(false);
|
|
223
|
-
const [addressData, setAddressData] = useState(null);
|
|
224
|
-
|
|
225
|
-
const yesNoOptions = [
|
|
226
|
-
{ code: "YES", name: "CORE_COMMON_YES" },
|
|
227
|
-
{ code: "NO", name: "CORE_COMMON_NO" },
|
|
238
|
+
const AadhaarVerification = ({ config, onSelect }) => {
|
|
239
|
+
|
|
240
|
+
// 🔹 STATES
|
|
241
|
+
const [kno, setKno] = useState("");
|
|
242
|
+
const [consumerType, setConsumerType] = useState(null);
|
|
243
|
+
const [occupantType, setOccupantType] = useState(null);
|
|
244
|
+
const [categoryType, setCategoryType] = useState(null);
|
|
245
|
+
|
|
246
|
+
const [consumerName, setConsumerName] = useState("");
|
|
247
|
+
const [firstName, setFirstName] = useState("");
|
|
248
|
+
const [middleName, setMiddleName] = useState("");
|
|
249
|
+
const [lastName, setLastName] = useState("");
|
|
250
|
+
|
|
251
|
+
const [gender, setGender] = useState(null);
|
|
252
|
+
const [relation, setRelation] = useState("");
|
|
253
|
+
|
|
254
|
+
const [mobile, setMobile] = useState("");
|
|
255
|
+
const [whatsapp, setWhatsapp] = useState("");
|
|
256
|
+
const [email, setEmail] = useState("");
|
|
257
|
+
const [residents, setResidents] = useState("");
|
|
258
|
+
|
|
259
|
+
// Tenant
|
|
260
|
+
const [documentProof, setDocumentProof] = useState(null);
|
|
261
|
+
const [documentId, setDocumentId] = useState(null);
|
|
262
|
+
const [ownerMobile, setOwnerMobile] = useState("");
|
|
263
|
+
const [tenantVerification, setTenantVerification] = useState("");
|
|
264
|
+
|
|
265
|
+
// Govt
|
|
266
|
+
const [designation, setDesignation] = useState("");
|
|
267
|
+
const [department, setDepartment] = useState("");
|
|
268
|
+
const [employeeId, setEmployeeId] = useState("");
|
|
269
|
+
const [landline, setLandline] = useState("");
|
|
270
|
+
|
|
271
|
+
// Other Entity
|
|
272
|
+
const [entityRelation, setEntityRelation] = useState("");
|
|
273
|
+
const [contactPerson, setContactPerson] = useState("");
|
|
274
|
+
const [entityName, setEntityName] = useState("");
|
|
275
|
+
|
|
276
|
+
// Identity
|
|
277
|
+
const [idProof, setIdProof] = useState(null);
|
|
278
|
+
const [idNumber, setIdNumber] = useState("");
|
|
279
|
+
const [idFile, setIdFile] = useState(null);
|
|
280
|
+
|
|
281
|
+
// Consent
|
|
282
|
+
const [consent, setConsent] = useState(false);
|
|
283
|
+
const [informantIsConsumer, setInformantIsConsumer] = useState(true);
|
|
284
|
+
const [informantName, setInformantName] = useState("");
|
|
285
|
+
const [informantRelation, setInformantRelation] = useState("");
|
|
286
|
+
|
|
287
|
+
const [toast, setToast] = useState(null);
|
|
288
|
+
|
|
289
|
+
// 🔹 OPTIONS
|
|
290
|
+
const consumerTypeOptions = [
|
|
291
|
+
{ name: "Individual" },
|
|
292
|
+
{ name: "Govt" },
|
|
293
|
+
{ name: "Company_Society_Org" },
|
|
228
294
|
];
|
|
229
295
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
setTimeout(() => {
|
|
235
|
-
setIsVerifying(false);
|
|
236
|
-
setShowOtpField(true);
|
|
237
|
-
}, 1200);
|
|
238
|
-
};
|
|
296
|
+
const occupantOptions = [
|
|
297
|
+
{ name: "Self" },
|
|
298
|
+
{ name: "Tenanted" },
|
|
299
|
+
];
|
|
239
300
|
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
301
|
+
const genderOptions = [
|
|
302
|
+
{ name: "Male" },
|
|
303
|
+
{ name: "Female" },
|
|
304
|
+
{ name: "Others" },
|
|
305
|
+
{ name: "Not prefer to say" },
|
|
306
|
+
];
|
|
307
|
+
|
|
308
|
+
const yesNo = [{ name: "Yes" }, { name: "No" }];
|
|
309
|
+
|
|
310
|
+
// 🔹 FILE UPLOAD
|
|
311
|
+
const uploadFile = async (e, setter, idSetter) => {
|
|
312
|
+
const file = e.target.files[0];
|
|
313
|
+
if (!file) return;
|
|
314
|
+
|
|
315
|
+
try {
|
|
316
|
+
const res = await Digit.UploadServices.Filestorage("EKYC", file);
|
|
317
|
+
const id = res?.data?.files?.[0]?.fileStoreId;
|
|
318
|
+
if (id) {
|
|
319
|
+
setter(file.name);
|
|
320
|
+
idSetter(id);
|
|
321
|
+
}
|
|
322
|
+
} catch {
|
|
323
|
+
setToast({ type: "error", message: "Upload failed" });
|
|
252
324
|
}
|
|
253
325
|
};
|
|
254
326
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
327
|
+
// 🔹 VALIDATION
|
|
328
|
+
const isValid = () => {
|
|
329
|
+
if (!kno) return false;
|
|
330
|
+
if (!consumerType) return false;
|
|
331
|
+
if (!occupantType) return false;
|
|
332
|
+
if (!categoryType) return false;
|
|
333
|
+
if (!firstName) return false;
|
|
334
|
+
if (!mobile) return false;
|
|
335
|
+
if (!residents || Number(residents) <= 0) return false;
|
|
336
|
+
|
|
337
|
+
if (occupantType?.name === "Tenanted" && !documentId && !ownerMobile)
|
|
338
|
+
return false;
|
|
261
339
|
|
|
262
|
-
|
|
263
|
-
setAddressData(addressDetails);
|
|
264
|
-
history.push("/digit-ui/employee/ekyc/property-info", {
|
|
265
|
-
kNumber,
|
|
266
|
-
selectedOption,
|
|
267
|
-
connectionDetails,
|
|
268
|
-
aadhaarDetails: {
|
|
269
|
-
aadhaarLastFour,
|
|
270
|
-
isAadhaarVerified,
|
|
271
|
-
userName,
|
|
272
|
-
mobileNumber,
|
|
273
|
-
whatsappNumber,
|
|
274
|
-
email,
|
|
275
|
-
noOfPersons,
|
|
276
|
-
},
|
|
277
|
-
addressDetails,
|
|
278
|
-
initialData: initialData, // Pass the initial snapshot
|
|
279
|
-
});
|
|
340
|
+
return consent;
|
|
280
341
|
};
|
|
281
342
|
|
|
282
|
-
//
|
|
283
|
-
const
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
padding: "1px 7px",
|
|
324
|
-
marginLeft: "6px",
|
|
325
|
-
fontWeight: "400",
|
|
326
|
-
},
|
|
343
|
+
// 🔹 SUBMIT
|
|
344
|
+
const onStepSelect = () => {
|
|
345
|
+
if (!isValid()) {
|
|
346
|
+
setToast({ type: "error", message: "Fill required fields" });
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
const data = {
|
|
351
|
+
kno,
|
|
352
|
+
consumerType: consumerType?.name,
|
|
353
|
+
occupantType: occupantType?.name,
|
|
354
|
+
categoryType: categoryType?.name,
|
|
355
|
+
consumerName,
|
|
356
|
+
firstName,
|
|
357
|
+
middleName,
|
|
358
|
+
lastName,
|
|
359
|
+
gender: gender?.name,
|
|
360
|
+
relation,
|
|
361
|
+
mobile,
|
|
362
|
+
whatsapp,
|
|
363
|
+
email,
|
|
364
|
+
residents,
|
|
365
|
+
documentId,
|
|
366
|
+
ownerMobile,
|
|
367
|
+
tenantVerification,
|
|
368
|
+
designation,
|
|
369
|
+
department,
|
|
370
|
+
employeeId,
|
|
371
|
+
landline,
|
|
372
|
+
entityRelation,
|
|
373
|
+
contactPerson,
|
|
374
|
+
entityName,
|
|
375
|
+
idProof: idProof?.name,
|
|
376
|
+
idNumber,
|
|
377
|
+
consent,
|
|
378
|
+
informantIsConsumer,
|
|
379
|
+
informantName,
|
|
380
|
+
informantRelation,
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
onSelect(config.key, data);
|
|
327
384
|
};
|
|
328
385
|
|
|
329
386
|
return (
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
}
|
|
336
|
-
@keyframes pulseGreen {
|
|
337
|
-
0%, 100% { box-shadow: 0 0 0 0 rgba(29,158,117,0.35); }
|
|
338
|
-
50% { box-shadow: 0 0 0 6px rgba(29,158,117,0); }
|
|
339
|
-
}
|
|
340
|
-
.ekyc-sidebar-step { display: flex; gap: 10px; align-items: flex-start; position: relative; padding-bottom: 18px; }
|
|
341
|
-
.ekyc-sidebar-step:last-child { padding-bottom: 0; }
|
|
342
|
-
.ekyc-step-line { position: absolute; left: 10px; top: 22px; width: 1px; height: calc(100% - 10px); background: #EAECF0; }
|
|
343
|
-
.ekyc-step-dot { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #D0D5DD; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 500; color: #98A2B3; background: #fff; flex-shrink: 0; margin-top: 1px; }
|
|
344
|
-
.ekyc-step-dot.active { border-color: #185FA5; color: #185FA5; background: #E6F1FB; }
|
|
345
|
-
.ekyc-step-dot.done { border-color: #0F6E56; background: #0F6E56; color: #fff; }
|
|
346
|
-
.ekyc-step-label { font-size: 12px; color: #667085; padding-top: 2px; }
|
|
347
|
-
.ekyc-step-label.active { color: #0B0C0C; font-weight: 600; }
|
|
348
|
-
.ekyc-step-label.done { color: #0F6E56; }
|
|
349
|
-
.ekyc-field-label { font-size: 11px; font-weight: 600; color: #667085; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
|
|
350
|
-
`}</style>
|
|
351
|
-
|
|
352
|
-
{/* ── Sidebar ── */}
|
|
353
|
-
<div className="filters-container">
|
|
354
|
-
<Card style={{ display: "flex", alignItems: "center", padding: "12px 16px", marginBottom: "12px", borderRadius: "8px" }}>
|
|
355
|
-
<div style={{ color: "#185FA5", marginRight: "10px", display: "flex" }}>
|
|
356
|
-
<HomeIcon style={{ width: "20px", height: "20px" }} />
|
|
357
|
-
</div>
|
|
358
|
-
<div style={{ fontWeight: "600", fontSize: "15px", color: "#0B0C0C" }}>
|
|
359
|
-
{t("EKYC_PROCESS") || "eKYC Process"}
|
|
360
|
-
</div>
|
|
361
|
-
</Card>
|
|
362
|
-
|
|
363
|
-
<div style={{ background: "#fff", padding: "16px 14px", borderRadius: "8px", border: "1px solid #EAECF0" }}>
|
|
364
|
-
{[
|
|
365
|
-
{ label: t("EKYC_STEP_AADHAAR") || "Aadhaar", done: showAddressSection, active: !showAddressSection },
|
|
366
|
-
{ label: t("EKYC_STEP_ADDRESS") || "Address", done: addressData !== null, active: showAddressSection && addressData === null },
|
|
367
|
-
{ label: t("EKYC_STEP_PROPERTY") || "Property", done: false, active: false },
|
|
368
|
-
{ label: t("EKYC_STEP_METER") || "Meter", done: false, active: false },
|
|
369
|
-
{ label: t("EKYC_STEP_REVIEW") || "Review", done: false, active: false },
|
|
370
|
-
].map((step, i) => (
|
|
371
|
-
<div className="ekyc-sidebar-step" key={i}>
|
|
372
|
-
<div className={`ekyc-step-dot${step.done ? " done" : step.active ? " active" : ""}`}>
|
|
373
|
-
{step.done
|
|
374
|
-
? <CheckIcon size={11} color="#fff" />
|
|
375
|
-
: i + 1}
|
|
376
|
-
</div>
|
|
377
|
-
{i < 4 && <div className="ekyc-step-line" />}
|
|
378
|
-
<div className={`ekyc-step-label${step.done ? " done" : step.active ? " active" : ""}`}>
|
|
379
|
-
{step.label}
|
|
380
|
-
</div>
|
|
381
|
-
</div>
|
|
382
|
-
))}
|
|
383
|
-
</div>
|
|
387
|
+
<Fragment>
|
|
388
|
+
<FormStep onSelect={onStepSelect} config={config}>
|
|
389
|
+
<div>
|
|
390
|
+
<CardLabel>K Number *</CardLabel>
|
|
391
|
+
<TextInput value={kno} onChange={(e) => setKno(e.target.value)} />
|
|
384
392
|
</div>
|
|
385
393
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
<
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
394
|
+
<div>
|
|
395
|
+
<CardLabel>Consumer Type *</CardLabel>
|
|
396
|
+
<Dropdown option={consumerTypeOptions} selected={consumerType} select={setConsumerType} />
|
|
397
|
+
</div>
|
|
398
|
+
|
|
399
|
+
<div>
|
|
400
|
+
<CardLabel>Occupant Type *</CardLabel>
|
|
401
|
+
<Dropdown option={occupantOptions} selected={occupantType} select={setOccupantType} />
|
|
402
|
+
</div>
|
|
403
|
+
|
|
404
|
+
<div>
|
|
405
|
+
<CardLabel>Category Type *</CardLabel>
|
|
406
|
+
<Dropdown option={[]} selected={categoryType} select={setCategoryType} />
|
|
407
|
+
</div>
|
|
408
|
+
|
|
409
|
+
<div>
|
|
410
|
+
<CardLabel>First Name *</CardLabel>
|
|
411
|
+
<TextInput value={firstName} onChange={(e) => setFirstName(e.target.value)} />
|
|
412
|
+
</div>
|
|
413
|
+
|
|
414
|
+
<div>
|
|
415
|
+
<CardLabel>Middle Name</CardLabel>
|
|
416
|
+
<TextInput value={middleName} onChange={(e) => setMiddleName(e.target.value)} />
|
|
417
|
+
</div>
|
|
418
|
+
|
|
419
|
+
<div>
|
|
420
|
+
<CardLabel>Last Name</CardLabel>
|
|
421
|
+
<TextInput value={lastName} onChange={(e) => setLastName(e.target.value)} />
|
|
422
|
+
</div>
|
|
401
423
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
424
|
+
<div>
|
|
425
|
+
<CardLabel>Gender</CardLabel>
|
|
426
|
+
<Dropdown option={genderOptions} selected={gender} select={setGender} />
|
|
427
|
+
</div>
|
|
428
|
+
|
|
429
|
+
<div>
|
|
430
|
+
<CardLabel>Mobile *</CardLabel>
|
|
431
|
+
<TextInput value={mobile} onChange={(e) => setMobile(e.target.value)} />
|
|
432
|
+
</div>
|
|
433
|
+
|
|
434
|
+
<div>
|
|
435
|
+
<CardLabel>WhatsApp</CardLabel>
|
|
436
|
+
<TextInput value={whatsapp} onChange={(e) => setWhatsapp(e.target.value)} />
|
|
437
|
+
</div>
|
|
438
|
+
|
|
439
|
+
<div>
|
|
440
|
+
<CardLabel>Email</CardLabel>
|
|
441
|
+
<TextInput value={email} onChange={(e) => setEmail(e.target.value)} />
|
|
442
|
+
</div>
|
|
407
443
|
|
|
408
|
-
|
|
409
|
-
|
|
444
|
+
<div>
|
|
445
|
+
<CardLabel>No. of Residents *</CardLabel>
|
|
446
|
+
<TextInput value={residents} onChange={(e) => setResidents(e.target.value)} />
|
|
447
|
+
</div>
|
|
448
|
+
|
|
449
|
+
{/* TENANT LOGIC */}
|
|
450
|
+
{occupantType?.name === "Tenanted" && (
|
|
451
|
+
<Fragment>
|
|
452
|
+
<div>
|
|
453
|
+
<CardLabel>Document Proof</CardLabel>
|
|
454
|
+
<UploadFile onUpload={(e) => uploadFile(e, setDocumentProof, setDocumentId)} />
|
|
410
455
|
</div>
|
|
411
|
-
<LabelFieldPair>
|
|
412
|
-
<div className="field">
|
|
413
|
-
<IconInput
|
|
414
|
-
icon={<LockIcon size={15} />}
|
|
415
|
-
rightIcon={isAadhaarVerified ? <CheckIcon size={15} /> : null}
|
|
416
|
-
value={aadhaarLastFour}
|
|
417
|
-
onChange={(e) => {
|
|
418
|
-
const val = e.target.value;
|
|
419
|
-
if (val.length <= 12 && /^\d*$/.test(val)) setAadhaarLastFour(val);
|
|
420
|
-
}}
|
|
421
|
-
placeholder={t("EKYC_ENTER_LAST_4_DIGIT") || "Enter 12 digits"}
|
|
422
|
-
maxLength={12}
|
|
423
|
-
disabled={isAadhaarVerified}
|
|
424
|
-
inputStyle={isAadhaarVerified ? styles.verifiedInput : {}}
|
|
425
|
-
/>
|
|
426
|
-
</div>
|
|
427
|
-
</LabelFieldPair>
|
|
428
|
-
|
|
429
|
-
{!isAadhaarVerified && !showOtpField && (
|
|
430
|
-
<SubmitBar
|
|
431
|
-
label={isVerifying
|
|
432
|
-
? t("EKYC_VERIFYING") || "Verifying..."
|
|
433
|
-
: t("EKYC_VERIFY_AADHAAR_BTN") || "Verify Aadhaar"}
|
|
434
|
-
onSubmit={handleVerifyAadhaar}
|
|
435
|
-
disabled={aadhaarLastFour.length !== 12 || isVerifying}
|
|
436
|
-
style={{ marginTop: "12px" }}
|
|
437
|
-
/>
|
|
438
|
-
)}
|
|
439
456
|
|
|
440
|
-
{!
|
|
457
|
+
{!documentId && (
|
|
441
458
|
<Fragment>
|
|
442
|
-
<div
|
|
443
|
-
|
|
459
|
+
<div>
|
|
460
|
+
<CardLabel>Owner Mobile *</CardLabel>
|
|
461
|
+
<TextInput value={ownerMobile} onChange={(e) => setOwnerMobile(e.target.value)} />
|
|
444
462
|
</div>
|
|
445
|
-
<LabelFieldPair>
|
|
446
|
-
<div className="field">
|
|
447
|
-
<IconInput
|
|
448
|
-
icon={<LockIcon size={15} />}
|
|
449
|
-
value={otp}
|
|
450
|
-
onChange={(e) => {
|
|
451
|
-
const val = e.target.value;
|
|
452
|
-
if (/^\d*$/.test(val)) {
|
|
453
|
-
setOtp(val);
|
|
454
|
-
if (otpError) setOtpError(false);
|
|
455
|
-
}
|
|
456
|
-
}}
|
|
457
|
-
placeholder={t("EKYC_ENTER_OTP_PLACEHOLDER") || "Enter 123456"}
|
|
458
|
-
maxLength={6}
|
|
459
|
-
/>
|
|
460
|
-
</div>
|
|
461
|
-
</LabelFieldPair>
|
|
462
|
-
{otpError && (
|
|
463
|
-
<div style={{ color: "#D4351C", fontSize: "12px", marginTop: "4px" }}>
|
|
464
|
-
{t("EKYC_INVALID_OTP") || "Invalid OTP. Please enter 123456."}
|
|
465
|
-
</div>
|
|
466
|
-
)}
|
|
467
|
-
<SubmitBar
|
|
468
|
-
label={t("EKYC_VERIFY_OTP_BTN") || "Verify OTP"}
|
|
469
|
-
onSubmit={handleVerifyOtp}
|
|
470
|
-
disabled={otp.length !== 6}
|
|
471
|
-
style={{ marginTop: "12px" }}
|
|
472
|
-
/>
|
|
473
|
-
</Fragment>
|
|
474
|
-
)}
|
|
475
463
|
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
<div style={{
|
|
480
|
-
width: "24px", height: "24px", borderRadius: "50%",
|
|
481
|
-
background: "#9FE1CB", display: "flex", alignItems: "center",
|
|
482
|
-
justifyContent: "center", animation: "pulseGreen 2s ease infinite",
|
|
483
|
-
flexShrink: 0,
|
|
484
|
-
}}>
|
|
485
|
-
<CheckIcon size={13} color="#085041" />
|
|
486
|
-
</div>
|
|
487
|
-
<span style={{ fontWeight: "600", color: "#085041", fontSize: "14px" }}>
|
|
488
|
-
{t("EKYC_AADHAAR_VERIFIED_SUCCESS") || "Aadhaar Verified Successfully"}
|
|
489
|
-
</span>
|
|
490
|
-
</div>
|
|
491
|
-
<div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: "12px" }}>
|
|
492
|
-
<div>
|
|
493
|
-
<div style={styles.infoLabel}>{t("EKYC_NAME") || "Name"}</div>
|
|
494
|
-
<div style={styles.infoValue}>{initialDetails.consumerName}</div>
|
|
495
|
-
</div>
|
|
496
|
-
<div>
|
|
497
|
-
<div style={styles.infoLabel}>{t("EKYC_AADHAAR") || "Aadhaar"}</div>
|
|
498
|
-
<div style={styles.infoValue}>{aadhaarLastFour}</div>
|
|
499
|
-
</div>
|
|
500
|
-
<div style={{ gridColumn: "span 2" }}>
|
|
501
|
-
<div style={styles.infoLabel}>{t("EKYC_ADDRESS") || "Address"}</div>
|
|
502
|
-
<div style={{ ...styles.infoValue, fontSize: "13px" }}>{initialDetails.address}</div>
|
|
503
|
-
</div>
|
|
464
|
+
<div>
|
|
465
|
+
<CardLabel>Tenant Verification</CardLabel>
|
|
466
|
+
<TextInput value={tenantVerification} onChange={(e) => setTenantVerification(e.target.value)} />
|
|
504
467
|
</div>
|
|
505
|
-
</
|
|
468
|
+
</Fragment>
|
|
506
469
|
)}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
{/* Name */}
|
|
517
|
-
<RadioToggleRow
|
|
518
|
-
label={`${t("EKYC_USER_NAME")} (${t("EKYC_NAME_CORRECT_HINT")})`}
|
|
519
|
-
selected={nameCorrect}
|
|
520
|
-
onSelect={setNameCorrect}
|
|
521
|
-
options={yesNoOptions}
|
|
522
|
-
sty
|
|
523
|
-
t={t}
|
|
524
|
-
/>
|
|
525
|
-
<LabelFieldPair>
|
|
526
|
-
<div className="field">
|
|
527
|
-
<IconInput
|
|
528
|
-
icon={<UserIcon size={15} color={nameCorrect.code === "YES" ? "#64748b" : "#94a3b8"} />}
|
|
529
|
-
style={{ marginBottom: "12px" }}
|
|
530
|
-
value={userName}
|
|
531
|
-
onChange={(e) => setUserName(e.target.value)}
|
|
532
|
-
placeholder={t("EKYC_ENTER_NAME_PLACEHOLDER") || "Enter full name"}
|
|
533
|
-
disabled={nameCorrect.code !== "YES"}
|
|
534
|
-
/>
|
|
535
|
-
</div>
|
|
536
|
-
</LabelFieldPair>
|
|
537
|
-
|
|
538
|
-
{/* Mobile */}
|
|
539
|
-
<RadioToggleRow
|
|
540
|
-
label={`${t("EKYC_USER_MOBILE_NUMBER")} (${t("EKYC_UPDATE_MOBILE_HINT")})`}
|
|
541
|
-
selected={mobileChange}
|
|
542
|
-
onSelect={setMobileChange}
|
|
543
|
-
options={yesNoOptions}
|
|
544
|
-
t={t}
|
|
545
|
-
/>
|
|
546
|
-
<LabelFieldPair>
|
|
547
|
-
<div className="field">
|
|
548
|
-
<IconInput
|
|
549
|
-
icon={<PhoneIcon size={15} color={mobileChange.code === "YES" ? "#64748b" : "#94a3b8"} />}
|
|
550
|
-
style={{ marginBottom: "12px" }}
|
|
551
|
-
value={mobileNumber}
|
|
552
|
-
onChange={(e) => setMobileNumber(e.target.value)}
|
|
553
|
-
placeholder="+91 XXXXX XXXXX"
|
|
554
|
-
disabled={mobileChange.code !== "YES"}
|
|
555
|
-
/>
|
|
556
|
-
</div>
|
|
557
|
-
</LabelFieldPair>
|
|
558
|
-
|
|
559
|
-
{/* WhatsApp + Email */}
|
|
560
|
-
<div style={styles.twoCol}>
|
|
561
|
-
<div>
|
|
562
|
-
<div className="ekyc-field-label">
|
|
563
|
-
{t("EKYC_WHATSAPP_NUMBER") || "WhatsApp Number"}
|
|
564
|
-
<span style={styles.optionalTag}>{t("EKYC_OPTIONAL") || "Optional"}</span>
|
|
565
|
-
</div>
|
|
566
|
-
<IconInput
|
|
567
|
-
icon={<WhatsappIcon size={15} />}
|
|
568
|
-
value={whatsappNumber}
|
|
569
|
-
onChange={(e) => setWhatsappNumber(e.target.value)}
|
|
570
|
-
placeholder="+91 XXXXX XXXXX"
|
|
571
|
-
/>
|
|
572
|
-
</div>
|
|
573
|
-
<div>
|
|
574
|
-
<div className="ekyc-field-label">
|
|
575
|
-
{t("EKYC_EMAIL_ADDRESS") || "Email Address"}
|
|
576
|
-
<span style={styles.optionalTag}>{t("EKYC_OPTIONAL") || "Optional"}</span>
|
|
577
|
-
</div>
|
|
578
|
-
<IconInput
|
|
579
|
-
icon={<MailIcon size={15} />}
|
|
580
|
-
value={email}
|
|
581
|
-
onChange={(e) => setEmail(e.target.value)}
|
|
582
|
-
placeholder={t("EKYC_EMAIL_ADDRESS_PLACEHOLDER") || "example@email.com"}
|
|
583
|
-
/>
|
|
584
|
-
</div>
|
|
470
|
+
</Fragment>
|
|
471
|
+
)}
|
|
472
|
+
|
|
473
|
+
{/* GOVT */}
|
|
474
|
+
{consumerType?.name === "Govt" && (
|
|
475
|
+
<Fragment>
|
|
476
|
+
<div>
|
|
477
|
+
<CardLabel>Designation</CardLabel>
|
|
478
|
+
<TextInput value={designation} onChange={(e) => setDesignation(e.target.value)} />
|
|
585
479
|
</div>
|
|
586
480
|
|
|
587
|
-
<
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
<SectionHead
|
|
591
|
-
icon={<UsersIcon size={16} />}
|
|
592
|
-
label={t("EKYC_FAMILY_DETAILS_HEADER") || "Family Details"}
|
|
593
|
-
/>
|
|
594
|
-
|
|
595
|
-
<div className="ekyc-field-label">
|
|
596
|
-
{t("EKYC_NO_OF_PERSONS") || "Number of Family Members"}
|
|
481
|
+
<div>
|
|
482
|
+
<CardLabel>Department</CardLabel>
|
|
483
|
+
<TextInput value={department} onChange={(e) => setDepartment(e.target.value)} />
|
|
597
484
|
</div>
|
|
598
|
-
<LabelFieldPair>
|
|
599
|
-
<div className="field">
|
|
600
|
-
<IconInput
|
|
601
|
-
icon={<UsersIcon size={15} />}
|
|
602
|
-
value={noOfPersons}
|
|
603
|
-
onChange={(e) => {
|
|
604
|
-
if (/^\d*$/.test(e.target.value)) setNoOfPersons(e.target.value);
|
|
605
|
-
}}
|
|
606
|
-
placeholder={t("EKYC_ENTER_NO_OF_PERSONS") || "Enter total number of persons"}
|
|
607
|
-
/>
|
|
608
|
-
</div>
|
|
609
|
-
</LabelFieldPair>
|
|
610
|
-
|
|
611
|
-
{/* Save & Continue (Non-sticky, at form end) */}
|
|
612
|
-
{!showAddressSection && (
|
|
613
|
-
<div style={{ marginTop: "24px" }}>
|
|
614
|
-
<SubmitBar
|
|
615
|
-
label={t("ES_COMMON_SAVE_CONTINUE") || "Save & Continue"}
|
|
616
|
-
onSubmit={handleSaveAndContinue}
|
|
617
|
-
/>
|
|
618
|
-
</div>
|
|
619
|
-
)}
|
|
620
|
-
|
|
621
|
-
{/* Address section (injected inline) */}
|
|
622
|
-
{showAddressSection && (
|
|
623
|
-
<div ref={addressSectionRef}>
|
|
624
|
-
<AddressDetails
|
|
625
|
-
isSection={true}
|
|
626
|
-
onComplete={handleCompleteAll}
|
|
627
|
-
parentState={{ kNumber, selectedOption, connectionDetails }}
|
|
628
|
-
/>
|
|
629
|
-
</div>
|
|
630
|
-
)}
|
|
631
485
|
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
486
|
+
<div>
|
|
487
|
+
<CardLabel>Employee ID</CardLabel>
|
|
488
|
+
<TextInput value={employeeId} onChange={(e) => setEmployeeId(e.target.value)} />
|
|
489
|
+
</div>
|
|
490
|
+
</Fragment>
|
|
491
|
+
)}
|
|
492
|
+
|
|
493
|
+
{/* OTHER ENTITY */}
|
|
494
|
+
{consumerType?.name === "Company_Society_Org" && (
|
|
495
|
+
<Fragment>
|
|
496
|
+
<div>
|
|
497
|
+
<CardLabel>Entity Name</CardLabel>
|
|
498
|
+
<TextInput value={entityName} onChange={(e) => setEntityName(e.target.value)} />
|
|
640
499
|
</div>
|
|
641
500
|
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
501
|
+
<div>
|
|
502
|
+
<CardLabel>Contact Person</CardLabel>
|
|
503
|
+
<TextInput value={contactPerson} onChange={(e) => setContactPerson(e.target.value)} />
|
|
504
|
+
</div>
|
|
505
|
+
</Fragment>
|
|
506
|
+
)}
|
|
507
|
+
</FormStep>
|
|
508
|
+
</Fragment>
|
|
645
509
|
);
|
|
646
510
|
};
|
|
647
511
|
|