@djb25/digit-ui-module-ekyc 1.0.6 → 1.0.8
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 +1969 -737
- package/dist/index.modern.js.map +1 -1
- package/package.json +4 -2
- package/src/Module.js +17 -1
- package/src/components/ConnectionDetailsView.js +180 -59
- package/src/components/DesktopInbox.js +153 -7
- package/src/components/EKYCCard.js +4 -0
- package/src/components/SearchConsumer.js +104 -94
- package/src/components/StatusCards.js +145 -16
- package/src/pages/citizen/index.js +90 -0
- package/src/pages/employee/AadhaarVerification.js +324 -281
- package/src/pages/employee/AddressDetails.js +127 -102
- package/src/pages/employee/Create.js +10 -0
- package/src/pages/employee/Inbox.js +11 -4
- package/src/pages/employee/Mapping.js +11 -0
- package/src/pages/employee/MeterDetails.js +486 -0
- package/src/pages/employee/PropertyInfo.js +387 -323
- package/src/pages/employee/Review.js +371 -227
- package/src/pages/employee/index.js +14 -1
- package/src/utils/index.js +46 -0
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
import React, { useState, useRef, Fragment, useEffect } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Card,
|
|
4
|
+
CardLabel,
|
|
5
|
+
TextInput,
|
|
6
|
+
SubmitBar,
|
|
7
|
+
CardHeader,
|
|
8
|
+
ActionBar,
|
|
9
|
+
Dropdown,
|
|
10
|
+
InfoBannerIcon,
|
|
11
|
+
HomeIcon,
|
|
12
|
+
UploadFile,
|
|
13
|
+
Toast,
|
|
14
|
+
} from "@djb25/digit-ui-react-components";
|
|
15
|
+
import { useTranslation } from "react-i18next";
|
|
16
|
+
import { useHistory, useLocation } from "react-router-dom";
|
|
17
|
+
import { getPayloadDiff, getSavedData } from "../../utils";
|
|
18
|
+
|
|
19
|
+
// ─── Icons ────────────────────────────────────────────────────────────────────
|
|
20
|
+
|
|
21
|
+
const CheckIcon = ({ size = 11, color = "#fff" }) => (
|
|
22
|
+
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="3" strokeLinecap="round">
|
|
23
|
+
<polyline points="20 6 9 17 4 12" />
|
|
24
|
+
</svg>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const MeterIcon = ({ size = 16 }) => (
|
|
28
|
+
<svg width={size} height={size} viewBox="0 0 24 24" fill="currentColor">
|
|
29
|
+
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67V7z" />
|
|
30
|
+
</svg>
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const ConnectionIcon = ({ size = 16 }) => (
|
|
34
|
+
<svg width={size} height={size} viewBox="0 0 24 24" fill="currentColor">
|
|
35
|
+
<path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z" />
|
|
36
|
+
</svg>
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const CameraIcon = ({ size = 24 }) => (
|
|
40
|
+
<svg width={size} height={size} viewBox="0 0 24 24" fill="currentColor">
|
|
41
|
+
<path d="M9 2L7.17 4H4C2.9 4 2 4.9 2 6v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L13 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z" />
|
|
42
|
+
</svg>
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
// ─── Reusable: Section heading with inline rule ───────────────────────────────
|
|
46
|
+
|
|
47
|
+
const SectionHead = ({ icon, label }) => (
|
|
48
|
+
<div style={{
|
|
49
|
+
display: "flex", alignItems: "center", gap: "8px",
|
|
50
|
+
marginBottom: "16px", marginTop: "4px",
|
|
51
|
+
}}>
|
|
52
|
+
<div style={{ opacity: 0.5, display: "flex" }}>{icon}</div>
|
|
53
|
+
<span style={{ fontSize: "15px", fontWeight: "600", color: "#0B0C0C", whiteSpace: "nowrap" }}>
|
|
54
|
+
{label}
|
|
55
|
+
</span>
|
|
56
|
+
<div style={{ flex: 1, height: "1px", background: "#EAECF0" }} />
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
// ─── Reusable: Icon-prefixed input ────────────────────────────────────────────
|
|
61
|
+
|
|
62
|
+
const IconInput = ({ icon, ...props }) => (
|
|
63
|
+
<div style={{ position: "relative", width: "100%" }}>
|
|
64
|
+
<div style={{
|
|
65
|
+
position: "absolute", left: "10px",
|
|
66
|
+
top: "50%", transform: "translateY(-50%)",
|
|
67
|
+
zIndex: 1, opacity: 0.45, display: "flex", pointerEvents: "none",
|
|
68
|
+
}}>
|
|
69
|
+
{icon}
|
|
70
|
+
</div>
|
|
71
|
+
<TextInput textInputStyle={{ paddingLeft: "36px", paddingRight: "12px" }} {...props} />
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
// ─── Main Component ───────────────────────────────────────────────────────────
|
|
76
|
+
|
|
77
|
+
const MeterDetails = () => {
|
|
78
|
+
const { t } = useTranslation();
|
|
79
|
+
const history = useHistory();
|
|
80
|
+
const location = useLocation();
|
|
81
|
+
|
|
82
|
+
const flowState = location.state || {
|
|
83
|
+
kNumber: sessionStorage.getItem("EKYC_K_NUMBER") || "EKYC-1234567890",
|
|
84
|
+
initialData: getSavedData("EKYC_INITIAL_DATA", {})
|
|
85
|
+
};
|
|
86
|
+
const { kNumber } = flowState;
|
|
87
|
+
const initialData = flowState.initialData || getSavedData("EKYC_INITIAL_DATA", {});
|
|
88
|
+
|
|
89
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
90
|
+
|
|
91
|
+
// MDMS Hooks for Connection Details
|
|
92
|
+
const { data: dataV0 } = Digit.Hooks.ekyc.useGetPropertyType(tenantId);
|
|
93
|
+
const { data: dataConn } = Digit.Hooks.ekyc.useGetConnectionTypeV2(tenantId);
|
|
94
|
+
|
|
95
|
+
// ── Meter State ──
|
|
96
|
+
const [meterStatus, setMeterStatus] = useState(() =>
|
|
97
|
+
getSavedData("EKYC_METER_STATUS_DATA", initialData.meterStatus ? { label: t(`EKYC_METER_${initialData.meterStatus}`), value: initialData.meterStatus } : null)
|
|
98
|
+
);
|
|
99
|
+
const [meterPhoto, setMeterStatusPhoto] = useState(() => sessionStorage.getItem("EKYC_METER_PHOTO") || null);
|
|
100
|
+
const [meterPhotoFileStoreId, setMeterStatusPhotoFileStoreId] = useState(() => sessionStorage.getItem("EKYC_METER_PHOTO_FILESTORE_ID") || null);
|
|
101
|
+
const [workingStatus, setWorkingStatus] = useState(() =>
|
|
102
|
+
getSavedData("EKYC_METER_WORKING_STATUS_DATA", initialData.workingStatus ? { label: t(`EKYC_METER_${initialData.workingStatus}`), value: initialData.workingStatus } : null)
|
|
103
|
+
);
|
|
104
|
+
const [meterLocation, setMeterLocation] = useState(() => sessionStorage.getItem("EKYC_METER_LOCATION") || initialData.meterLocation || "");
|
|
105
|
+
const [lastBillRaised, setLastBillRaised] = useState(() =>
|
|
106
|
+
getSavedData("EKYC_LAST_BILL_RAISED_DATA", initialData.lastBillRaised ? { label: t(`EKYC_${initialData.lastBillRaised}`), value: initialData.lastBillRaised } : null)
|
|
107
|
+
);
|
|
108
|
+
const [noBillReason, setNoBillReason] = useState(() => sessionStorage.getItem("EKYC_REASON_FOR_NO_BILL") || initialData.noBillReason || "");
|
|
109
|
+
const [sewerConnection, setSewerConnection] = useState(() =>
|
|
110
|
+
getSavedData("EKYC_SEWER_CONNECTION_DATA", initialData.sewerConnection ? { label: t(`EKYC_${initialData.sewerConnection}`), value: initialData.sewerConnection } : null)
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
// ── Connection State (Moved from PropertyInfo) ──
|
|
114
|
+
const [connectionCategory, setConnectionCategory] = useState(() =>
|
|
115
|
+
getSavedData("EKYC_TYPE_OF_CONNECTION_DATA", initialData.typeOfConnection ? { label: t(initialData.typeOfConnection), value: initialData.typeOfConnection } : null)
|
|
116
|
+
);
|
|
117
|
+
const [connectionType, setConnectionType] = useState(() =>
|
|
118
|
+
getSavedData("EKYC_CONNECTION_CATEGORY_DATA", initialData.connectionCategory ? { label: t(initialData.connectionCategory), value: initialData.connectionCategory } : null)
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
const [filephoto, setFilephoto] = useState(null);
|
|
122
|
+
const [error, setError] = useState(null);
|
|
123
|
+
const [toast, setToast] = useState(null);
|
|
124
|
+
|
|
125
|
+
// Sync state to sessionStorage
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
sessionStorage.setItem("EKYC_METER_STATUS_DATA", JSON.stringify(meterStatus));
|
|
128
|
+
sessionStorage.setItem("EKYC_METER_WORKING_STATUS_DATA", JSON.stringify(workingStatus));
|
|
129
|
+
sessionStorage.setItem("EKYC_METER_LOCATION", meterLocation);
|
|
130
|
+
sessionStorage.setItem("EKYC_LAST_BILL_RAISED_DATA", JSON.stringify(lastBillRaised));
|
|
131
|
+
sessionStorage.setItem("EKYC_REASON_FOR_NO_BILL", noBillReason);
|
|
132
|
+
sessionStorage.setItem("EKYC_SEWER_CONNECTION_DATA", JSON.stringify(sewerConnection));
|
|
133
|
+
sessionStorage.setItem("EKYC_TYPE_OF_CONNECTION_DATA", JSON.stringify(connectionCategory));
|
|
134
|
+
sessionStorage.setItem("EKYC_CONNECTION_CATEGORY_DATA", JSON.stringify(connectionType));
|
|
135
|
+
if (meterPhoto) sessionStorage.setItem("EKYC_METER_PHOTO", meterPhoto);
|
|
136
|
+
if (meterPhotoFileStoreId) sessionStorage.setItem("EKYC_METER_PHOTO_FILESTORE_ID", meterPhotoFileStoreId);
|
|
137
|
+
sessionStorage.setItem("EKYC_CURRENT_STEP", "METER");
|
|
138
|
+
}, [meterStatus, workingStatus, meterLocation, lastBillRaised, noBillReason, sewerConnection, connectionCategory, connectionType, meterPhoto, meterPhotoFileStoreId]);
|
|
139
|
+
|
|
140
|
+
const uploadFile = async (file, tenantId) => {
|
|
141
|
+
if (!file) return null;
|
|
142
|
+
const res = await Digit.UploadServices.Filestorage("EKYC", file, tenantId);
|
|
143
|
+
return res?.data?.files?.[0]?.fileStoreId || null;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
(async () => {
|
|
148
|
+
setError(null);
|
|
149
|
+
if (filephoto) {
|
|
150
|
+
if (filephoto.size >= 2000000) {
|
|
151
|
+
setError(t("EKYC_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
|
|
152
|
+
setToast({ type: "error", message: t("EKYC_MAXIMUM_UPLOAD_SIZE_EXCEEDED") });
|
|
153
|
+
} else {
|
|
154
|
+
try {
|
|
155
|
+
setToast({ type: "info", message: t("EKYC_UPLOADING") });
|
|
156
|
+
const fileStoreId = await uploadFile(filephoto, tenantId);
|
|
157
|
+
if (fileStoreId) {
|
|
158
|
+
setMeterStatusPhotoFileStoreId(fileStoreId);
|
|
159
|
+
const reader = new FileReader();
|
|
160
|
+
reader.onloadend = () => setMeterStatusPhoto(reader.result);
|
|
161
|
+
reader.readAsDataURL(filephoto);
|
|
162
|
+
setToast({ type: "success", message: t("EKYC_UPLOAD_SUCCESS") });
|
|
163
|
+
} else {
|
|
164
|
+
setError(t("EKYC_FILE_UPLOAD_ERROR"));
|
|
165
|
+
setToast({ type: "error", message: t("EKYC_FILE_UPLOAD_ERROR") });
|
|
166
|
+
}
|
|
167
|
+
} catch (err) {
|
|
168
|
+
setError(t("EKYC_FILE_UPLOAD_ERROR"));
|
|
169
|
+
setToast({ type: "error", message: t("EKYC_FILE_UPLOAD_ERROR") });
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
})();
|
|
174
|
+
}, [filephoto]);
|
|
175
|
+
|
|
176
|
+
const handleSaveAndContinue = () => {
|
|
177
|
+
history.push("/digit-ui/employee/ekyc/review", {
|
|
178
|
+
...location.state,
|
|
179
|
+
meterDetails: {
|
|
180
|
+
meterStatus, meterPhoto, meterPhotoFileStoreId,
|
|
181
|
+
workingStatus, meterLocation, lastBillRaised,
|
|
182
|
+
noBillReason, sewerConnection,
|
|
183
|
+
connectionType, connectionCategory
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
function selectphoto(e) {
|
|
189
|
+
setMeterStatusPhotoFileStoreId(null);
|
|
190
|
+
setFilephoto(e.target.files[0]);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const meterStatusOptions = [
|
|
194
|
+
{ label: t("EKYC_METERED"), value: "Metered" },
|
|
195
|
+
{ label: t("EKYC_UNMETERED"), value: "Unmetered" },
|
|
196
|
+
];
|
|
197
|
+
|
|
198
|
+
const workingStatusOptions = [
|
|
199
|
+
{ label: t("EKYC_WORKING"), value: "Working" },
|
|
200
|
+
{ label: t("EKYC_NOT_WORKING"), value: "Not Working" },
|
|
201
|
+
];
|
|
202
|
+
|
|
203
|
+
const yesNoOptions = [
|
|
204
|
+
{ label: t("CORE_COMMON_YES"), value: "Yes" },
|
|
205
|
+
{ label: t("CORE_COMMON_NO"), value: "No" },
|
|
206
|
+
];
|
|
207
|
+
|
|
208
|
+
const connectionCategoryOptions =
|
|
209
|
+
dataV0?.["ws-services-calculation"]?.propertyTypeV2?.map((item) => ({
|
|
210
|
+
label: t(item.code), value: item.code,
|
|
211
|
+
})) || [];
|
|
212
|
+
|
|
213
|
+
const connectionTypeOptions =
|
|
214
|
+
dataConn?.["ws-services-calculation"]?.connectionTypeV2?.map((item) => ({
|
|
215
|
+
label: t(item.code), value: item.code,
|
|
216
|
+
})) || [];
|
|
217
|
+
|
|
218
|
+
return (
|
|
219
|
+
<div className="inbox-container">
|
|
220
|
+
<style>{`
|
|
221
|
+
@keyframes fadeSlideIn {
|
|
222
|
+
from { opacity: 0; transform: translateY(8px); }
|
|
223
|
+
to { opacity: 1; transform: translateY(0); }
|
|
224
|
+
}
|
|
225
|
+
`}</style>
|
|
226
|
+
|
|
227
|
+
{/* ── Sidebar ── */}
|
|
228
|
+
<div className="filters-container">
|
|
229
|
+
<Card style={{ display: "flex", alignItems: "center", padding: "12px 16px", marginBottom: "12px", borderRadius: "8px" }}>
|
|
230
|
+
<div style={{ color: "#185FA5", marginRight: "10px", display: "flex" }}>
|
|
231
|
+
<HomeIcon style={{ width: "20px", height: "20px" }} />
|
|
232
|
+
</div>
|
|
233
|
+
<div style={{ fontWeight: "600", fontSize: "15px", color: "#0B0C0C" }}>
|
|
234
|
+
{t("EKYC_PROCESS") || "eKYC Process"}
|
|
235
|
+
</div>
|
|
236
|
+
</Card>
|
|
237
|
+
|
|
238
|
+
<div style={{ background: "#fff", padding: "16px 14px", borderRadius: "8px", border: "1px solid #EAECF0" }}>
|
|
239
|
+
{[
|
|
240
|
+
{ label: t("EKYC_STEP_AADHAAR") || "Aadhaar", done: true, active: false },
|
|
241
|
+
{ label: t("EKYC_STEP_ADDRESS") || "Address", done: true, active: false },
|
|
242
|
+
{ label: t("EKYC_STEP_PROPERTY") || "Property", done: true, active: false },
|
|
243
|
+
{ label: t("EKYC_STEP_METER") || "Meter", done: false, active: true },
|
|
244
|
+
{ label: t("EKYC_STEP_REVIEW") || "Review", done: false, active: false },
|
|
245
|
+
].map((step, i) => (
|
|
246
|
+
<div key={i} style={{ display: "flex", gap: "10px", alignItems: "flex-start", position: "relative", paddingBottom: i < 4 ? "18px" : 0 }}>
|
|
247
|
+
{i < 4 && (
|
|
248
|
+
<div style={{ position: "absolute", left: "10px", top: "22px", width: "1px", height: "calc(100% - 10px)", background: "#EAECF0" }} />
|
|
249
|
+
)}
|
|
250
|
+
<div style={{
|
|
251
|
+
width: "20px", height: "20px", borderRadius: "50%", flexShrink: 0, marginTop: "1px",
|
|
252
|
+
border: step.done ? "none" : step.active ? "1.5px solid #185FA5" : "1.5px solid #D0D5DD",
|
|
253
|
+
background: step.done ? "#0F6E56" : step.active ? "#E6F1FB" : "#fff",
|
|
254
|
+
display: "flex", alignItems: "center", justifyContent: "center",
|
|
255
|
+
fontSize: "10px", fontWeight: "500",
|
|
256
|
+
color: step.done ? "#fff" : step.active ? "#185FA5" : "#98A2B3",
|
|
257
|
+
}}>
|
|
258
|
+
{step.done ? <CheckIcon size={11} color="#fff" /> : i + 1}
|
|
259
|
+
</div>
|
|
260
|
+
<div style={{
|
|
261
|
+
fontSize: "12px", paddingTop: "2px",
|
|
262
|
+
color: step.done ? "#0F6E56" : step.active ? "#0B0C0C" : "#667085",
|
|
263
|
+
fontWeight: step.done || step.active ? "600" : "400",
|
|
264
|
+
}}>
|
|
265
|
+
{step.label}
|
|
266
|
+
</div>
|
|
267
|
+
</div>
|
|
268
|
+
))}
|
|
269
|
+
</div>
|
|
270
|
+
</div>
|
|
271
|
+
|
|
272
|
+
{/* ── Main Content ── */}
|
|
273
|
+
<div style={{ flex: 1, marginLeft: "16px" }}>
|
|
274
|
+
<Card>
|
|
275
|
+
{/* Header */}
|
|
276
|
+
<div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "20px" }}>
|
|
277
|
+
<CardHeader style={{ margin: 0, fontSize: "18px" }}>
|
|
278
|
+
{t("EKYC_METER_DETAILS_HEADER") || "Meter Details"}
|
|
279
|
+
</CardHeader>
|
|
280
|
+
<div style={{
|
|
281
|
+
background: "#F9FAFB", border: "0.5px solid #EAECF0",
|
|
282
|
+
borderRadius: "20px", padding: "4px 14px",
|
|
283
|
+
fontSize: "12px", color: "#667085",
|
|
284
|
+
}}>
|
|
285
|
+
{t("EKYC_K_NUMBER") || "K Number"}:{" "}
|
|
286
|
+
<span style={{ color: "#0B0C0C", fontWeight: "600" }}>{kNumber}</span>
|
|
287
|
+
</div>
|
|
288
|
+
</div>
|
|
289
|
+
|
|
290
|
+
<div style={{ animation: "fadeSlideIn 0.3s ease" }}>
|
|
291
|
+
|
|
292
|
+
{/* ── Meter Details Section ── */}
|
|
293
|
+
<SectionHead
|
|
294
|
+
icon={<MeterIcon size={16} />}
|
|
295
|
+
label={t("EKYC_METER_DETAILS") || "Meter details"}
|
|
296
|
+
/>
|
|
297
|
+
|
|
298
|
+
<div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: "14px", marginBottom: "20px" }}>
|
|
299
|
+
<div>
|
|
300
|
+
<div style={{ fontSize: "11px", fontWeight: "600", color: "#667085", textTransform: "uppercase", letterSpacing: "0.04em", marginBottom: "6px" }}>
|
|
301
|
+
{t("EKYC_METER_STATUS") || "Meter status"}
|
|
302
|
+
</div>
|
|
303
|
+
<Dropdown
|
|
304
|
+
selected={meterStatus}
|
|
305
|
+
select={setMeterStatus}
|
|
306
|
+
option={meterStatusOptions}
|
|
307
|
+
optionKey="label"
|
|
308
|
+
t={t}
|
|
309
|
+
placeholder={t("EKYC_SELECT") || "Select"}
|
|
310
|
+
/>
|
|
311
|
+
</div>
|
|
312
|
+
{meterStatus?.value === "Metered" && (
|
|
313
|
+
<div>
|
|
314
|
+
<div style={{ fontSize: "11px", fontWeight: "600", color: "#667085", textTransform: "uppercase", letterSpacing: "0.04em", marginBottom: "6px" }}>
|
|
315
|
+
{t("EKYC_METER_WORKING_STATUS") || "Meter working status"}
|
|
316
|
+
</div>
|
|
317
|
+
<Dropdown
|
|
318
|
+
selected={workingStatus}
|
|
319
|
+
select={setWorkingStatus}
|
|
320
|
+
option={workingStatusOptions}
|
|
321
|
+
optionKey="label"
|
|
322
|
+
t={t}
|
|
323
|
+
placeholder={t("EKYC_SELECT") || "Select"}
|
|
324
|
+
/>
|
|
325
|
+
</div>
|
|
326
|
+
)}
|
|
327
|
+
</div>
|
|
328
|
+
|
|
329
|
+
{meterStatus?.value === "Metered" && (
|
|
330
|
+
<Fragment>
|
|
331
|
+
<div style={{ marginBottom: "20px" }}>
|
|
332
|
+
<div style={{ fontSize: "11px", fontWeight: "600", color: "#667085", textTransform: "uppercase", letterSpacing: "0.04em", marginBottom: "8px" }}>
|
|
333
|
+
{t("EKYC_CAPTURE_METER_IMAGE") || "Capture meter image"}
|
|
334
|
+
</div>
|
|
335
|
+
<UploadFile
|
|
336
|
+
id={"ekyc-meter-photo"}
|
|
337
|
+
extraStyleName={"propertyCreate"}
|
|
338
|
+
accept=".jpg,.png,.jpeg"
|
|
339
|
+
onUpload={selectphoto}
|
|
340
|
+
onDelete={() => {
|
|
341
|
+
setMeterStatusPhotoFileStoreId(null);
|
|
342
|
+
setMeterStatusPhoto(null);
|
|
343
|
+
setFilephoto(null);
|
|
344
|
+
}}
|
|
345
|
+
message={meterPhotoFileStoreId ? `1 ${t(`EKYC_ACTION_FILEUPLOADED`)}` : t(`EKYC_ACTION_NO_FILEUPLOADED`)}
|
|
346
|
+
error={error}
|
|
347
|
+
/>
|
|
348
|
+
{meterPhoto && (
|
|
349
|
+
<div style={{ marginTop: "10px", borderRadius: "8px", overflow: "hidden", border: "1px solid #EAECF0" }}>
|
|
350
|
+
<img src={meterPhoto} alt="Meter Preview" style={{ width: "100%", maxHeight: "150px", objectFit: "cover" }} />
|
|
351
|
+
</div>
|
|
352
|
+
)}
|
|
353
|
+
</div>
|
|
354
|
+
|
|
355
|
+
<div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: "14px", marginBottom: "20px" }}>
|
|
356
|
+
<div>
|
|
357
|
+
<div style={{ fontSize: "11px", fontWeight: "600", color: "#667085", textTransform: "uppercase", letterSpacing: "0.04em", marginBottom: "6px" }}>
|
|
358
|
+
{t("EKYC_METER_LOCATION") || "Meter location"}
|
|
359
|
+
</div>
|
|
360
|
+
<TextInput
|
|
361
|
+
value={meterLocation}
|
|
362
|
+
onChange={(e) => setMeterLocation(e.target.value)}
|
|
363
|
+
placeholder={t("EKYC_ENTER_METER_LOCATION") || "Enter location"}
|
|
364
|
+
/>
|
|
365
|
+
</div>
|
|
366
|
+
<div>
|
|
367
|
+
<div style={{ fontSize: "11px", fontWeight: "600", color: "#667085", textTransform: "uppercase", letterSpacing: "0.04em", marginBottom: "6px" }}>
|
|
368
|
+
{t("EKYC_LAST_BILL_RAISED") || "Last bill raised"}
|
|
369
|
+
</div>
|
|
370
|
+
<Dropdown
|
|
371
|
+
selected={lastBillRaised}
|
|
372
|
+
select={setLastBillRaised}
|
|
373
|
+
option={yesNoOptions}
|
|
374
|
+
optionKey="label"
|
|
375
|
+
t={t}
|
|
376
|
+
placeholder={t("EKYC_SELECT") || "Select"}
|
|
377
|
+
/>
|
|
378
|
+
</div>
|
|
379
|
+
</div>
|
|
380
|
+
|
|
381
|
+
{lastBillRaised?.value === "No" && (
|
|
382
|
+
<div style={{ marginBottom: "20px" }}>
|
|
383
|
+
<div style={{ fontSize: "11px", fontWeight: "600", color: "#667085", textTransform: "uppercase", letterSpacing: "0.04em", marginBottom: "6px" }}>
|
|
384
|
+
{t("EKYC_REASON_FOR_NO_BILL") || "Reason for no bill"}
|
|
385
|
+
</div>
|
|
386
|
+
<TextInput
|
|
387
|
+
value={noBillReason}
|
|
388
|
+
onChange={(e) => setNoBillReason(e.target.value)}
|
|
389
|
+
placeholder={t("EKYC_ENTER_REASON") || "Enter reason"}
|
|
390
|
+
/>
|
|
391
|
+
</div>
|
|
392
|
+
)}
|
|
393
|
+
</Fragment>
|
|
394
|
+
)}
|
|
395
|
+
|
|
396
|
+
<div style={{ marginBottom: "20px" }}>
|
|
397
|
+
<div style={{ fontSize: "11px", fontWeight: "600", color: "#667085", textTransform: "uppercase", letterSpacing: "0.04em", marginBottom: "6px" }}>
|
|
398
|
+
{t("EKYC_SEWER_CONNECTION") || "Sewer connection"}
|
|
399
|
+
</div>
|
|
400
|
+
<div style={{ width: "calc(50% - 7px)" }}>
|
|
401
|
+
<Dropdown
|
|
402
|
+
selected={sewerConnection}
|
|
403
|
+
select={setSewerConnection}
|
|
404
|
+
option={yesNoOptions}
|
|
405
|
+
optionKey="label"
|
|
406
|
+
t={t}
|
|
407
|
+
placeholder={t("EKYC_SELECT") || "Select"}
|
|
408
|
+
/>
|
|
409
|
+
</div>
|
|
410
|
+
</div>
|
|
411
|
+
|
|
412
|
+
<hr style={{ margin: "24px 0", border: 0, borderTop: "1px solid #EAECF0" }} />
|
|
413
|
+
|
|
414
|
+
{/* ── Property/Connection Details Section ── */}
|
|
415
|
+
<SectionHead
|
|
416
|
+
icon={<ConnectionIcon size={16} />}
|
|
417
|
+
label={t("EKYC_PROPERTY_CONNECTION_DETAILS") || "Property Connection Details"}
|
|
418
|
+
/>
|
|
419
|
+
|
|
420
|
+
<div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: "14px", marginBottom: "24px" }}>
|
|
421
|
+
<div>
|
|
422
|
+
<div style={{ fontSize: "11px", fontWeight: "600", color: "#667085", textTransform: "uppercase", letterSpacing: "0.04em", marginBottom: "6px" }}>
|
|
423
|
+
{t("EKYC_TYPE_OF_CONNECTION") || "Type of connection"}
|
|
424
|
+
</div>
|
|
425
|
+
<Dropdown
|
|
426
|
+
selected={connectionCategory}
|
|
427
|
+
select={setConnectionCategory}
|
|
428
|
+
option={connectionCategoryOptions}
|
|
429
|
+
optionKey="label"
|
|
430
|
+
t={t}
|
|
431
|
+
placeholder={t("EKYC_SELECT") || "Select"}
|
|
432
|
+
/>
|
|
433
|
+
</div>
|
|
434
|
+
<div>
|
|
435
|
+
<div style={{ fontSize: "11px", fontWeight: "600", color: "#667085", textTransform: "uppercase", letterSpacing: "0.04em", marginBottom: "6px" }}>
|
|
436
|
+
{t("EKYC_CONNECTION_CATEGORY") || "Connection category"}
|
|
437
|
+
</div>
|
|
438
|
+
<Dropdown
|
|
439
|
+
selected={connectionType}
|
|
440
|
+
select={setConnectionType}
|
|
441
|
+
option={connectionTypeOptions}
|
|
442
|
+
optionKey="label"
|
|
443
|
+
t={t}
|
|
444
|
+
placeholder={t("EKYC_SELECT") || "Select"}
|
|
445
|
+
/>
|
|
446
|
+
</div>
|
|
447
|
+
</div>
|
|
448
|
+
|
|
449
|
+
</div>
|
|
450
|
+
|
|
451
|
+
{/* Submit */}
|
|
452
|
+
<div style={{ marginTop: "24px" }}>
|
|
453
|
+
<SubmitBar
|
|
454
|
+
label={t("EKYC_SAVE_AND_CONTINUE") || "Save & Continue"}
|
|
455
|
+
onSubmit={handleSaveAndContinue}
|
|
456
|
+
/>
|
|
457
|
+
</div>
|
|
458
|
+
|
|
459
|
+
{/* Secure notice */}
|
|
460
|
+
<div style={{
|
|
461
|
+
display: "flex", alignItems: "center", justifyContent: "center",
|
|
462
|
+
gap: "5px", marginTop: "16px",
|
|
463
|
+
fontSize: "11px", color: "#98A2B3",
|
|
464
|
+
}}>
|
|
465
|
+
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
|
|
466
|
+
<rect x="3" y="11" width="18" height="11" rx="2" />
|
|
467
|
+
<path d="M7 11V7a5 5 0 0 1 10 0v4" />
|
|
468
|
+
</svg>
|
|
469
|
+
{t("EKYC_SECURE_DATA_NOTICE") || "Your data is encrypted and secure"}
|
|
470
|
+
</div>
|
|
471
|
+
</Card>
|
|
472
|
+
</div>
|
|
473
|
+
{toast && (
|
|
474
|
+
<Toast
|
|
475
|
+
label={toast.message}
|
|
476
|
+
error={toast.type === "error"}
|
|
477
|
+
info={toast.type === "info"}
|
|
478
|
+
success={toast.type === "success"}
|
|
479
|
+
onClose={() => setToast(null)}
|
|
480
|
+
/>
|
|
481
|
+
)}
|
|
482
|
+
</div>
|
|
483
|
+
);
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
export default MeterDetails;
|