@djb25/digit-ui-module-ekyc 1.0.7 → 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.
@@ -1,647 +1,511 @@
1
- import React, { useState, useRef, Fragment, useEffect } from "react";
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
- SubmitBar,
8
- CardHeader,
231
+ Dropdown,
232
+ UploadFile,
9
233
  RadioButtons,
10
- ActionBar,
11
- HomeIcon,
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
- // Normalize the nested data shape (API returns .connectionDetails, fallback uses .connectionDetailsInfo)
160
- const initialDetails =
161
- connectionDetails?.connectionDetails ||
162
- connectionDetails?.connectionDetailsInfo ||
163
- {};
164
-
165
- // ── State ──
166
- const [initialData] = useState(() => getSavedData("EKYC_INITIAL_DATA", {
167
- userName: initialDetails.consumerName || "",
168
- mobileNumber: initialDetails.phoneNumber || "",
169
- whatsappNumber: initialDetails.phoneNumber || "",
170
- email: initialDetails.email || "",
171
- noOfPersons: connectionDetails?.addressDetails?.noOfPerson || "",
172
- // Property and Connection Info
173
- pidNumber: connectionDetails?.propertyDetails?.pidNumber || "",
174
- typeOfConnection: connectionDetails?.connectionDetails?.connectionType || "",
175
- connectionCategory: connectionDetails?.connectionDetails?.connectionCategory || "",
176
- userType: connectionDetails?.propertyDetails?.userType || "",
177
- noOfFloor: connectionDetails?.propertyDetails?.noOfFloor || null,
178
- // Address Info
179
- fullAddress: connectionDetails?.addressDetails?.fullAddress || "",
180
- flatNo: connectionDetails?.addressDetails?.flatHouseNumber || "",
181
- building: connectionDetails?.addressDetails?.buildingTower || "",
182
- landmark: connectionDetails?.addressDetails?.landmark || "",
183
- pincode: connectionDetails?.addressDetails?.pinCode || "",
184
- assembly: connectionDetails?.addressDetails?.assembly || "",
185
- ward: connectionDetails?.addressDetails?.ward || "",
186
- }));
187
-
188
- // Sync initial data snapshot
189
- useEffect(() => {
190
- sessionStorage.setItem("EKYC_INITIAL_DATA", JSON.stringify(initialData));
191
- }, [initialData]);
192
-
193
- const [aadhaarLastFour, setAadhaarLastFour] = useState(() => sessionStorage.getItem("EKYC_AADHAAR_LAST_FOUR") || "");
194
- const [isAadhaarVerified, setIsAadhaarVerified] = useState(() => sessionStorage.getItem("EKYC_AADHAAR_VERIFIED") === "true");
195
- const [isVerifying, setIsVerifying] = useState(false);
196
- const [showOtpField, setShowOtpField] = useState(false);
197
- const [otp, setOtp] = useState("");
198
- const [otpError, setOtpError] = useState(false);
199
- const [nameCorrect, setNameCorrect] = useState(() => getSavedData("EKYC_NAME_CORRECT", { code: "NO", name: "CORE_COMMON_NO" }));
200
- const [userName, setUserName] = useState(() => sessionStorage.getItem("EKYC_USER_NAME") || initialData.userName);
201
-
202
- const [mobileChange, setMobileChange] = useState(() => getSavedData("EKYC_MOBILE_CHANGE", { code: "NO", name: "CORE_COMMON_NO" }));
203
- const [mobileNumber, setMobileNumber] = useState(() => sessionStorage.getItem("EKYC_MOBILE_NUMBER") || initialData.mobileNumber);
204
-
205
- const [whatsappNumber, setWhatsappNumber] = useState(() => sessionStorage.getItem("EKYC_WHATSAPP_NUMBER") || initialData.whatsappNumber);
206
- const [email, setEmail] = useState(() => sessionStorage.getItem("EKYC_EMAIL") || initialData.email);
207
- const [noOfPersons, setNoOfPersons] = useState(() => sessionStorage.getItem("EKYC_NO_OF_PERSONS") || initialData.noOfPersons);
208
-
209
- // Sync current form state to sessionStorage
210
- useEffect(() => {
211
- sessionStorage.setItem("EKYC_AADHAAR_LAST_FOUR", aadhaarLastFour);
212
- sessionStorage.setItem("EKYC_AADHAAR_VERIFIED", isAadhaarVerified);
213
- sessionStorage.setItem("EKYC_NAME_CORRECT", JSON.stringify(nameCorrect));
214
- sessionStorage.setItem("EKYC_USER_NAME", userName);
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
- // ── Handlers ──
231
- const handleVerifyAadhaar = () => {
232
- if (aadhaarLastFour.length !== 12 || isVerifying) return;
233
- setIsVerifying(true);
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 handleVerifyOtp = () => {
241
- if (otp === "123456") {
242
- setIsAadhaarVerified(true);
243
- setShowOtpField(false);
244
- setOtpError(false);
245
- // Auto-expand address section upon verification
246
- setShowAddressSection(true);
247
- setTimeout(() => {
248
- addressSectionRef.current?.scrollIntoView({ behavior: "smooth", block: "start" });
249
- }, 100);
250
- } else {
251
- setOtpError(true);
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
- const handleSaveAndContinue = () => {
256
- setShowAddressSection(true);
257
- setTimeout(() => {
258
- addressSectionRef.current?.scrollIntoView({ behavior: "smooth", block: "start" });
259
- }, 100);
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
- const handleCompleteAll = (addressDetails) => {
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
- // ── Styles ──
283
- const styles = {
284
- verifiedInput: {
285
- borderColor: "#1D9E75",
286
- backgroundColor: "#E1F5EE",
287
- },
288
- verifiedCard: {
289
- backgroundColor: "#E1F5EE",
290
- border: "0.5px solid #5DCAA5",
291
- borderRadius: "8px",
292
- padding: "16px",
293
- marginTop: "14px",
294
- marginBottom: "4px",
295
- animation: "fadeSlideIn 0.35s ease",
296
- },
297
- infoLabel: {
298
- fontSize: "11px",
299
- fontWeight: "600",
300
- color: "#1D9E75",
301
- textTransform: "uppercase",
302
- letterSpacing: "0.05em",
303
- marginBottom: "3px",
304
- },
305
- infoValue: {
306
- fontSize: "14px",
307
- fontWeight: "500",
308
- color: "#04342C",
309
- },
310
- twoCol: {
311
- display: "grid",
312
- gridTemplateColumns: "1fr 1fr",
313
- gap: "14px",
314
- marginBottom: "20px",
315
- },
316
- optionalTag: {
317
- display: "inline-block",
318
- fontSize: "10px",
319
- background: "#F1EFE8",
320
- color: "#5F5E5A",
321
- border: "0.5px solid #D3D1C7",
322
- borderRadius: "10px",
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
- <div className="ground-container employee-app-container form-container">
331
- <div className="inbox-container">
332
- <style>{`
333
- @keyframes fadeSlideIn {
334
- from { opacity: 0; transform: translateY(6px); }
335
- to { opacity: 1; transform: translateY(0); }
336
- }
337
- @keyframes pulseGreen {
338
- 0%, 100% { box-shadow: 0 0 0 0 rgba(29,158,117,0.35); }
339
- 50% { box-shadow: 0 0 0 6px rgba(29,158,117,0); }
340
- }
341
- .ekyc-sidebar-step { display: flex; gap: 10px; align-items: flex-start; position: relative; padding-bottom: 18px; }
342
- .ekyc-sidebar-step:last-child { padding-bottom: 0; }
343
- .ekyc-step-line { position: absolute; left: 10px; top: 22px; width: 1px; height: calc(100% - 10px); background: #EAECF0; }
344
- .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; }
345
- .ekyc-step-dot.active { border-color: #185FA5; color: #185FA5; background: #E6F1FB; }
346
- .ekyc-step-dot.done { border-color: #0F6E56; background: #0F6E56; color: #fff; }
347
- .ekyc-step-label { font-size: 12px; color: #667085; padding-top: 2px; }
348
- .ekyc-step-label.active { color: #0B0C0C; font-weight: 600; }
349
- .ekyc-step-label.done { color: #0F6E56; }
350
- .ekyc-field-label { font-size: 11px; font-weight: 600; color: #667085; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
351
- `}</style>
352
-
353
- {/* ── Sidebar ── */}
354
- <div className="filters-container">
355
- <Card style={{ display: "flex", alignItems: "center", padding: "12px 16px", marginBottom: "12px", borderRadius: "8px" }}>
356
- <div style={{ color: "#185FA5", marginRight: "10px", display: "flex" }}>
357
- <HomeIcon style={{ width: "20px", height: "20px" }} />
358
- </div>
359
- <div style={{ fontWeight: "600", fontSize: "15px", color: "#0B0C0C" }}>
360
- {t("EKYC_PROCESS") || "eKYC Process"}
361
- </div>
362
- </Card>
363
-
364
- <div style={{ background: "#fff", padding: "16px 14px", borderRadius: "8px", border: "1px solid #EAECF0" }}>
365
- {[
366
- { label: t("EKYC_STEP_AADHAAR") || "Aadhaar", done: showAddressSection, active: !showAddressSection },
367
- { label: t("EKYC_STEP_ADDRESS") || "Address", done: addressData !== null, active: showAddressSection && addressData === null },
368
- { label: t("EKYC_STEP_PROPERTY") || "Property", 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 < 3 && <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
- {/* ── Main content ── */}
387
- <div style={{ flex: 1, marginLeft: "16px" }}>
388
- <Card>
389
-
390
- {/* K-Number badge */}
391
- <div style={{ display: "flex", justifyContent: "flex-end", marginBottom: "20px" }}>
392
- <div style={{
393
- background: "#F9FAFB", border: "0.5px solid #EAECF0",
394
- borderRadius: "20px", padding: "4px 14px",
395
- fontSize: "12px", color: "#667085",
396
- }}>
397
- {t("EKYC_K_NUMBER") || "K Number"}:{" "}
398
- <span style={{ color: "#0B0C0C", fontWeight: "600" }}>{kNumber}</span>
399
- </div>
400
- </div>
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
- {/* ── Section 1: Aadhaar ── */}
403
- <SectionHead
404
- icon={<LockIcon size={16} />}
405
- label={t("EKYC_AADHAAR_NUMBER_HEADER") || "Aadhaar Number"}
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
- <div className="ekyc-field-label">
409
- {t("EKYC_LAST_4_DIGIT_AADHAAR") || "Enter 12 digits of Aadhaar"}
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
- {!isAadhaarVerified && showOtpField && (
457
+ {!documentId && (
441
458
  <Fragment>
442
- <div className="ekyc-field-label" style={{ marginTop: "16px" }}>
443
- {t("EKYC_ENTER_OTP")}
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
- {isAadhaarVerified && (
477
- <div style={styles.verifiedCard}>
478
- <div style={{ display: "flex", alignItems: "center", gap: "8px", marginBottom: "14px" }}>
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
- </div>
468
+ </Fragment>
506
469
  )}
507
-
508
- <hr style={{ margin: "24px 0", border: 0, borderTop: "1px solid #EAECF0" }} />
509
-
510
- {/* ── Section 2: Contact Details ── */}
511
- <SectionHead
512
- icon={<UserIcon size={16} />}
513
- label={t("EKYC_CONTACT_DETAILS_HEADER") || "Contact Details"}
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
- </div>
565
- <IconInput
566
- icon={<WhatsappIcon size={15} />}
567
- value={whatsappNumber}
568
- onChange={(e) => setWhatsappNumber(e.target.value)}
569
- placeholder="+91 XXXXX XXXXX"
570
- />
571
- </div>
572
- <div>
573
- <div className="ekyc-field-label">
574
- {t("EKYC_EMAIL_ADDRESS") || "Email Address"}
575
- <span style={styles.optionalTag}>{t("EKYC_OPTIONAL") || "Optional"}</span>
576
- </div>
577
- <IconInput
578
- icon={<MailIcon size={15} />}
579
- value={email}
580
- onChange={(e) => setEmail(e.target.value)}
581
- placeholder={t("EKYC_EMAIL_ADDRESS_PLACEHOLDER") || "example@email.com"}
582
- />
583
- </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)} />
584
479
  </div>
585
480
 
586
- <hr style={{ margin: "24px 0", border: 0, borderTop: "1px solid #EAECF0" }} />
587
-
588
- {/* ── Section 3: Family Details ── */}
589
- <SectionHead
590
- icon={<UsersIcon size={16} />}
591
- label={t("EKYC_FAMILY_DETAILS_HEADER") || "Family Details"}
592
- />
593
-
594
- <div className="ekyc-field-label">
595
- {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)} />
596
484
  </div>
597
- <LabelFieldPair>
598
- <div className="field">
599
- <IconInput
600
- icon={<UsersIcon size={15} />}
601
- value={noOfPersons}
602
- onChange={(e) => {
603
- if (/^\d*$/.test(e.target.value)) setNoOfPersons(e.target.value);
604
- }}
605
- placeholder={t("EKYC_ENTER_NO_OF_PERSONS") || "Enter total number of persons"}
606
- />
607
- </div>
608
- </LabelFieldPair>
609
-
610
- {/* Save & Continue (Non-sticky, at form end) */}
611
- {!showAddressSection && (
612
- <div style={{ marginTop: "24px" }}>
613
- <SubmitBar
614
- label={t("ES_COMMON_SAVE_CONTINUE") || "Save & Continue"}
615
- onSubmit={handleSaveAndContinue}
616
- />
617
- </div>
618
- )}
619
-
620
- {/* Address section (injected inline) */}
621
- {showAddressSection && (
622
- <div ref={addressSectionRef}>
623
- <AddressDetails
624
- isSection={true}
625
- onComplete={handleCompleteAll}
626
- parentState={{ kNumber, selectedOption, connectionDetails }}
627
- />
628
- </div>
629
- )}
630
485
 
631
- {/* Secure notice */}
632
- <div style={{
633
- display: "flex", alignItems: "center", justifyContent: "center",
634
- gap: "5px", marginTop: "20px",
635
- fontSize: "11px", color: "#98A2B3",
636
- }}>
637
- <LockIcon size={11} />
638
- {t("EKYC_SECURE_DATA_NOTICE") || "Your data is encrypted and secure"}
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)} />
639
499
  </div>
640
500
 
641
- </Card>
642
- </div>
643
- </div>
644
- </div>
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