@djb25/digit-ui-module-ekyc 1.0.0 → 1.0.2
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 -0
- package/dist/index.modern.js +3290 -0
- package/dist/index.modern.js.map +1 -0
- package/package.json +1 -1
- package/src/Module.js +7 -23
- package/src/components/ConnectionDetailsView.js +114 -0
- package/src/components/DesktopInbox.js +84 -84
- package/src/components/Filter.js +59 -0
- package/src/components/MobileInbox.js +73 -0
- package/src/components/SearchConsumer.js +122 -0
- package/src/components/StatusCards.js +13 -22
- package/src/pages/employee/AadhaarVerification.js +357 -0
- package/src/pages/employee/AddressDetails.js +452 -0
- package/src/pages/employee/Create.js +94 -0
- package/src/pages/employee/Inbox.js +37 -20
- package/src/pages/employee/PropertyInfo.js +405 -0
- package/src/pages/employee/Review.js +118 -0
- package/src/pages/employee/index.js +104 -0
- package/src/components/Search.js +0 -77
package/src/Module.js
CHANGED
|
@@ -1,28 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { useRouteMatch } from "react-router-dom";
|
|
3
3
|
import EKYCCard from "./components/EKYCCard";
|
|
4
|
-
// import EkycDashboard from "./components/Dashboard";
|
|
5
4
|
import Inbox from "./pages/employee/Inbox";
|
|
6
5
|
import DesktopInbox from "./components/DesktopInbox";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<Switch>
|
|
11
|
-
<Route path={`${path}/dashboard`}>
|
|
12
|
-
<Inbox />
|
|
13
|
-
</Route>
|
|
14
|
-
{/* <Route path={`${path}/inbox`}>
|
|
15
|
-
<Inbox />
|
|
16
|
-
</Route> */}
|
|
17
|
-
<Route path={`${path}/create-kyc`}>
|
|
18
|
-
<div>Create KYC Page Placeholder</div>
|
|
19
|
-
</Route>
|
|
20
|
-
<Route path={`${path}`}>
|
|
21
|
-
<Inbox />
|
|
22
|
-
</Route>
|
|
23
|
-
</Switch>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
6
|
+
import MobileInbox from "./components/MobileInbox";
|
|
7
|
+
import Filter from "./components/Filter";
|
|
8
|
+
import EmployeeApp from "./pages/employee";
|
|
26
9
|
|
|
27
10
|
export const EkycModule = ({ stateCode, userType, tenants }) => {
|
|
28
11
|
const { path, url } = useRouteMatch();
|
|
@@ -41,10 +24,11 @@ export const EkycModule = ({ stateCode, userType, tenants }) => {
|
|
|
41
24
|
|
|
42
25
|
const componentsToRegister = {
|
|
43
26
|
EKYCModule: EkycModule,
|
|
44
|
-
EKYCCard
|
|
45
|
-
// EkycDashboard: EkycDashboard,
|
|
27
|
+
EKYCCard,
|
|
46
28
|
EKYCInbox: Inbox,
|
|
47
29
|
EKYCDesktopInbox: DesktopInbox,
|
|
30
|
+
EKYCMobileInbox: MobileInbox,
|
|
31
|
+
EKYC_INBOX_FILTER: (props) => <Filter {...props} />,
|
|
48
32
|
};
|
|
49
33
|
|
|
50
34
|
export const initEkycComponents = () => {
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { Card, CardHeader, StatusTable, Row, ActionBar, Modal, RadioButtons, Loader, CardLabel, SubmitBar } from "@djb25/digit-ui-react-components";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import { useHistory, useRouteMatch } from "react-router-dom";
|
|
5
|
+
|
|
6
|
+
const ConnectionDetailsView = ({ kNumber, kName, connectionDetails, isLoading }) => {
|
|
7
|
+
const { t } = useTranslation();
|
|
8
|
+
const history = useHistory();
|
|
9
|
+
const { path } = useRouteMatch();
|
|
10
|
+
|
|
11
|
+
const [showModal, setShowModal] = useState(false);
|
|
12
|
+
const [selectedOption, setSelectedOption] = useState({ code: "SELF", name: "EKYC_SELF" });
|
|
13
|
+
|
|
14
|
+
const options = [
|
|
15
|
+
{ code: "SELF", name: "EKYC_SELF" },
|
|
16
|
+
{ code: "OTHER", name: "EKYC_OTHER" }
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
const handleStartVerification = () => {
|
|
20
|
+
setShowModal(true);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const onModalConfirm = () => {
|
|
24
|
+
// Correctly handle redirection from create-kyc or dashboard
|
|
25
|
+
const parentPath = path.includes("/create-kyc") ? path.replace("/create-kyc", "") : path.replace("/k-details", "");
|
|
26
|
+
history.push(`${parentPath}/aadhaar-verification`, { kNumber, selectedOption, connectionDetails });
|
|
27
|
+
setShowModal(false);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const handleRaiseCorrection = () => {
|
|
31
|
+
console.log("Raise Correction clicked");
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
if (isLoading) {
|
|
35
|
+
return <Loader />;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!connectionDetails) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<React.Fragment>
|
|
44
|
+
<Card className="ekyc-create-card" style={{ padding: "24px" }}>
|
|
45
|
+
<CardHeader>{t("EKYC_K_NUMBER_DETAILS")}</CardHeader>
|
|
46
|
+
<StatusTable>
|
|
47
|
+
<Row label={t("EKYC_K_NUMBER")} text={kNumber || t("CS_NA")} />
|
|
48
|
+
<Row label={t("EKYC_K_NAME")} text={kName || t("CS_NA")} />
|
|
49
|
+
</StatusTable>
|
|
50
|
+
|
|
51
|
+
<CardHeader style={{ marginTop: "24px" }}>{t("EKYC_CONNECTION_DETAILS")}</CardHeader>
|
|
52
|
+
{connectionDetails?.connectionDetailsInfo ? (
|
|
53
|
+
<StatusTable>
|
|
54
|
+
<Row label={t("EKYC_CONSUMER_NAME")} text={connectionDetails.connectionDetailsInfo.consumerName || t("CS_NA")} />
|
|
55
|
+
<Row label={t("EKYC_ADDRESS")} text={connectionDetails.connectionDetailsInfo.address || t("CS_NA")} />
|
|
56
|
+
<Row label={t("EKYC_CONNECTION_TYPE")} text={connectionDetails.connectionDetailsInfo.connectionType || t("CS_NA")} />
|
|
57
|
+
<Row label={t("EKYC_METER_NO")} text={connectionDetails.connectionDetailsInfo.meterNumber || t("CS_NA")} />
|
|
58
|
+
<Row label={t("EKYC_PHONE_NO")} text={connectionDetails.connectionDetailsInfo.phoneNumber || t("CS_NA")} />
|
|
59
|
+
<Row label={t("EKYC_EMAIL")} text={connectionDetails.connectionDetailsInfo.email || t("CS_NA")} />
|
|
60
|
+
<Row label={t("EKYC_STATUS")} text={connectionDetails.connectionDetailsInfo.statusflag || t("CS_NA")} />
|
|
61
|
+
</StatusTable>
|
|
62
|
+
) : (
|
|
63
|
+
<CardLabel>{t("EKYC_NO_CONNECTION_DETAILS_FOUND")}</CardLabel>
|
|
64
|
+
)}
|
|
65
|
+
|
|
66
|
+
<div style={{ display: "flex", justifyContent: "flex-end", marginTop: "16px" }}>
|
|
67
|
+
<SubmitBar label={t("EKYC_START_VERIFICATION")} onSubmit={handleStartVerification} style={{ borderRadius: "12px", margin: 0 }} />
|
|
68
|
+
</div>
|
|
69
|
+
{/* <button
|
|
70
|
+
className="submit-bar"
|
|
71
|
+
style={{
|
|
72
|
+
marginLeft: "10px",
|
|
73
|
+
background: "#f47738",
|
|
74
|
+
border: "none",
|
|
75
|
+
color: "#fff",
|
|
76
|
+
padding: "10px 24px",
|
|
77
|
+
borderRadius: "12px",
|
|
78
|
+
fontWeight: "600",
|
|
79
|
+
cursor: "pointer",
|
|
80
|
+
boxShadow: "0 2px 4px rgba(0,0,0,0.1)"
|
|
81
|
+
}}
|
|
82
|
+
onClick={handleRaiseCorrection}
|
|
83
|
+
>
|
|
84
|
+
{t("EKYC_RAISE_CORRECTION")}
|
|
85
|
+
</button> */}
|
|
86
|
+
</Card>
|
|
87
|
+
|
|
88
|
+
{showModal && (
|
|
89
|
+
<Modal
|
|
90
|
+
headerBarMain={t("EKYC_SELECT_VERIFICATION_TYPE")}
|
|
91
|
+
headerBarEnd={<span onClick={() => setShowModal(false)} style={{ cursor: "pointer", padding: "8px" }}>X</span>}
|
|
92
|
+
actionSaveLabel={t("ES_COMMON_CONFIRM")}
|
|
93
|
+
actionSaveOnSubmit={onModalConfirm}
|
|
94
|
+
actionCancelLabel={t("ES_COMMON_CANCEL")}
|
|
95
|
+
actionCancelOnSubmit={() => setShowModal(false)}
|
|
96
|
+
style={{ borderRadius: "12px" }}
|
|
97
|
+
>
|
|
98
|
+
<div style={{ padding: "24px" }}>
|
|
99
|
+
<RadioButtons
|
|
100
|
+
options={options}
|
|
101
|
+
optionsKey="name"
|
|
102
|
+
selectedOption={selectedOption}
|
|
103
|
+
onSelect={setSelectedOption}
|
|
104
|
+
style={{ display: "flex", flexDirection: "column", gap: "12px", buttonStyle: { borderRadius: "5px" } }}
|
|
105
|
+
t={t}
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
108
|
+
</Modal>
|
|
109
|
+
)}
|
|
110
|
+
</React.Fragment>
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export default ConnectionDetailsView;
|
|
@@ -1,40 +1,33 @@
|
|
|
1
1
|
import React, { useMemo } from "react";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
|
-
import { Table, SubmitBar, Header, Card } from "@djb25/digit-ui-react-components";
|
|
3
|
+
import { Table, SubmitBar, Header, Card, HomeIcon, PersonIcon } from "@djb25/digit-ui-react-components";
|
|
4
4
|
import { Link } from "react-router-dom";
|
|
5
|
-
import SearchApplication from "./Search";
|
|
6
5
|
import StatusCards from "./StatusCards";
|
|
7
6
|
|
|
8
7
|
const DesktopInbox = ({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
onNextPage,
|
|
13
|
-
onPrevPage,
|
|
14
|
-
currentPage,
|
|
15
|
-
pageSizeLimit,
|
|
16
|
-
onPageSizeChange,
|
|
17
|
-
parentRoute,
|
|
18
|
-
searchParams,
|
|
19
|
-
sortParams,
|
|
20
|
-
totalRecords,
|
|
21
|
-
countData,
|
|
22
|
-
onSearch,
|
|
23
|
-
searchFields,
|
|
8
|
+
tableConfig,
|
|
9
|
+
filterComponent,
|
|
10
|
+
...props
|
|
24
11
|
}) => {
|
|
12
|
+
const {
|
|
13
|
+
data,
|
|
14
|
+
isLoading,
|
|
15
|
+
onSort,
|
|
16
|
+
onNextPage,
|
|
17
|
+
onPrevPage,
|
|
18
|
+
currentPage,
|
|
19
|
+
pageSizeLimit,
|
|
20
|
+
onPageSizeChange,
|
|
21
|
+
parentRoute,
|
|
22
|
+
searchParams,
|
|
23
|
+
sortParams,
|
|
24
|
+
totalRecords,
|
|
25
|
+
countData,
|
|
26
|
+
onSearch,
|
|
27
|
+
searchFields,
|
|
28
|
+
} = props;
|
|
25
29
|
const { t } = useTranslation();
|
|
26
|
-
|
|
27
|
-
// Helper for Status Styles
|
|
28
|
-
const getStatusStyle = (status) => {
|
|
29
|
-
const styles = {
|
|
30
|
-
ALL: { bg: "#F4F4F4", text: "#505A5F" },
|
|
31
|
-
COMPLETED: { bg: "#E7F4E9", text: "#0B6623" },
|
|
32
|
-
PENDING: { bg: "#FFF5E6", text: "#945700" },
|
|
33
|
-
REJECTED: { bg: "#FBEAE9", text: "#AF1E11" },
|
|
34
|
-
DEFAULT: { bg: "#F4F4F4", text: "#505A5F" }
|
|
35
|
-
};
|
|
36
|
-
return styles[status] || styles.DEFAULT;
|
|
37
|
-
};
|
|
30
|
+
const [FilterComponent, setComp] = React.useState(() => Digit.ComponentRegistryService?.getComponent(filterComponent));
|
|
38
31
|
|
|
39
32
|
const columns = useMemo(
|
|
40
33
|
() => [
|
|
@@ -45,7 +38,7 @@ const DesktopInbox = ({
|
|
|
45
38
|
const applicationNumber = row.original?.applicationNumber || "NA";
|
|
46
39
|
return (
|
|
47
40
|
<Link to={`${parentRoute}/application-details/${applicationNumber}`}>
|
|
48
|
-
<span className="link"
|
|
41
|
+
<span className="ekyc-application-link">
|
|
49
42
|
{applicationNumber}
|
|
50
43
|
</span>
|
|
51
44
|
</Link>
|
|
@@ -67,17 +60,8 @@ const DesktopInbox = ({
|
|
|
67
60
|
accessor: "status",
|
|
68
61
|
Cell: ({ row }) => {
|
|
69
62
|
const status = row.original?.status || "DEFAULT";
|
|
70
|
-
const theme = getStatusStyle(status);
|
|
71
63
|
return (
|
|
72
|
-
<span
|
|
73
|
-
padding: "6px 12px",
|
|
74
|
-
borderRadius: "20px",
|
|
75
|
-
fontSize: "12px",
|
|
76
|
-
fontWeight: "600",
|
|
77
|
-
backgroundColor: theme.bg,
|
|
78
|
-
color: theme.text,
|
|
79
|
-
textTransform: "uppercase"
|
|
80
|
-
}}>
|
|
64
|
+
<span className={`ekyc-status-tag ${status}`}>
|
|
81
65
|
{t(`EKYC_STATUS_${status}`)}
|
|
82
66
|
</span>
|
|
83
67
|
);
|
|
@@ -92,54 +76,70 @@ const DesktopInbox = ({
|
|
|
92
76
|
}, [data]);
|
|
93
77
|
|
|
94
78
|
return (
|
|
95
|
-
<div className="inbox-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
79
|
+
<div className="inbox-container">
|
|
80
|
+
<div className="filters-container">
|
|
81
|
+
{/* Sidebar Title Card */}
|
|
82
|
+
<Card className="sidebar-title-card" style={{ display: "flex", alignItems: "center", padding: "16px", marginBottom: "16px", borderRadius: "4px" }}>
|
|
83
|
+
<div className="icon-container" style={{ color: "#F47738", marginRight: "12px" }}>
|
|
84
|
+
<HomeIcon style={{ width: "24px", height: "24px" }} />
|
|
85
|
+
</div>
|
|
86
|
+
<div style={{ fontWeight: "700", fontSize: "18px", color: "#0B0C0C" }}>
|
|
87
|
+
{t("ACTION_TEST_EKYC")}
|
|
88
|
+
</div>
|
|
89
|
+
</Card>
|
|
103
90
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
91
|
+
<div>
|
|
92
|
+
{FilterComponent && (
|
|
93
|
+
<FilterComponent
|
|
94
|
+
defaultSearchParams={props.defaultSearchParams}
|
|
95
|
+
onFilterChange={props.onSearch}
|
|
96
|
+
searchParams={searchParams}
|
|
97
|
+
type="desktop"
|
|
98
|
+
moduleCode="EKYC"
|
|
99
|
+
/>
|
|
100
|
+
)}
|
|
101
|
+
</div>
|
|
107
102
|
</div>
|
|
108
103
|
|
|
109
|
-
{
|
|
110
|
-
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
104
|
+
<div style={{ flex: 1, marginLeft: "16px" }}>
|
|
105
|
+
{/* Header Section (retaining for context/actions) */}
|
|
106
|
+
{/* <div className="ekyc-header-container module-header" style={{ marginBottom: "16px", display: "flex", justifyContent: "space-between", alignItems: "center" }}>
|
|
107
|
+
<Header className="title" style={{ margin: 0 }}>{t("EKYC_INBOX_HEADER")}</Header>
|
|
108
|
+
<Link to={`${parentRoute}/create-kyc`}>
|
|
109
|
+
<SubmitBar label={t("EKYC_CREATE_KYC")} style={{ borderRadius: "8px" }} />
|
|
110
|
+
</Link>
|
|
111
|
+
</div> */}
|
|
117
112
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
113
|
+
{/* Metrics Section (The Card) */}
|
|
114
|
+
<Card className="ekyc-metrics-card" style={{ marginBottom: "16px", padding: "16px" }}>
|
|
115
|
+
<StatusCards countData={countData} />
|
|
116
|
+
</Card>
|
|
117
|
+
|
|
118
|
+
{/* Table Section */}
|
|
119
|
+
<div className="result" style={{ flex: 1 }}>
|
|
120
|
+
<Card className="ekyc-table-card" style={{ padding: 0 }}>
|
|
121
|
+
<Table
|
|
122
|
+
t={t}
|
|
123
|
+
data={tableData}
|
|
124
|
+
columns={columns}
|
|
125
|
+
isLoading={isLoading}
|
|
126
|
+
onSort={onSort}
|
|
127
|
+
sortParams={sortParams}
|
|
128
|
+
totalRecords={totalRecords}
|
|
129
|
+
onNextPage={onNextPage}
|
|
130
|
+
onPrevPage={onPrevPage}
|
|
131
|
+
currentPage={currentPage}
|
|
132
|
+
pageSizeLimit={pageSizeLimit}
|
|
133
|
+
onPageSizeChange={onPageSizeChange}
|
|
134
|
+
getCellProps={(cellInfo) => {
|
|
135
|
+
return {
|
|
136
|
+
className: "ekyc-table-cell"
|
|
137
|
+
};
|
|
138
|
+
}}
|
|
139
|
+
/>
|
|
140
|
+
</Card>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
143
|
</div>
|
|
144
144
|
);
|
|
145
145
|
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import { Dropdown, FilterForm, FilterFormField } from "@djb25/digit-ui-react-components";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
|
|
5
|
+
const Filter = ({ searchParams, onFilterChange, defaultSearchParams, statusMap, moduleCode, ...props }) => {
|
|
6
|
+
const { t } = useTranslation();
|
|
7
|
+
|
|
8
|
+
const [_searchParams, setSearchParams] = useState(() => ({ ...searchParams }));
|
|
9
|
+
|
|
10
|
+
const localParamChange = (filterParam) => {
|
|
11
|
+
let keys_to_delete = filterParam.delete;
|
|
12
|
+
let _new = { ..._searchParams, ...filterParam };
|
|
13
|
+
if (keys_to_delete) keys_to_delete.forEach((key) => delete _new[key]);
|
|
14
|
+
delete filterParam.delete;
|
|
15
|
+
setSearchParams({ ..._new });
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const applyLocalFilters = () => {
|
|
19
|
+
onFilterChange(_searchParams);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const clearAll = () => {
|
|
23
|
+
setSearchParams({ ...defaultSearchParams });
|
|
24
|
+
onFilterChange({ ...defaultSearchParams });
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const onStatusChange = (value) => {
|
|
28
|
+
localParamChange({ status: value });
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<FilterForm
|
|
33
|
+
onSubmit={applyLocalFilters}
|
|
34
|
+
handleSubmit={(fn) => (e) => { e && e.preventDefault(); fn(); }}
|
|
35
|
+
onResetFilterForm={clearAll}
|
|
36
|
+
id="ekyc-filter-form"
|
|
37
|
+
onMobileExclusiveFilterPopupFormClose={props.onClose}
|
|
38
|
+
>
|
|
39
|
+
<FilterFormField>
|
|
40
|
+
<div className="filter-label" style={{ fontWeight: "normal" }}>
|
|
41
|
+
{t("EKYC_STATUS")}:
|
|
42
|
+
</div>
|
|
43
|
+
<Dropdown
|
|
44
|
+
option={[
|
|
45
|
+
{ label: t("EKYC_STATUS_ALL"), value: "" },
|
|
46
|
+
{ label: t("EKYC_STATUS_COMPLETED"), value: "COMPLETED" },
|
|
47
|
+
{ label: t("EKYC_STATUS_PENDING"), value: "PENDING" },
|
|
48
|
+
{ label: t("EKYC_STATUS_REJECTED"), value: "REJECTED" },
|
|
49
|
+
]}
|
|
50
|
+
optionKey="label"
|
|
51
|
+
select={onStatusChange}
|
|
52
|
+
selected={_searchParams?.status || { label: t("EKYC_STATUS_ALL"), value: "" }}
|
|
53
|
+
/>
|
|
54
|
+
</FilterFormField>
|
|
55
|
+
</FilterForm>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export default Filter;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useTranslation } from "react-i18next";
|
|
3
|
+
import { Header, Card, SubmitBar, DetailsCard, Loader } from "@djb25/digit-ui-react-components";
|
|
4
|
+
import { Link } from "react-router-dom";
|
|
5
|
+
import SearchConsumer from "./SearchConsumer";
|
|
6
|
+
import StatusCards from "./StatusCards";
|
|
7
|
+
|
|
8
|
+
const MobileInbox = ({
|
|
9
|
+
data,
|
|
10
|
+
isLoading,
|
|
11
|
+
onSearch,
|
|
12
|
+
searchParams,
|
|
13
|
+
parentRoute,
|
|
14
|
+
countData,
|
|
15
|
+
}) => {
|
|
16
|
+
const { t } = useTranslation();
|
|
17
|
+
|
|
18
|
+
const mobileData = data?.items?.map((item) => ({
|
|
19
|
+
[t("EKYC_APPLICATION_NO")]: item.applicationNumber,
|
|
20
|
+
[t("EKYC_CITIZEN_NAME")]: item.citizenName,
|
|
21
|
+
[t("EKYC_MOBILE_NO")]: item.mobileNumber,
|
|
22
|
+
[t("EKYC_STATUS")]: (
|
|
23
|
+
<span className={`ekyc-status-tag ${item.status}`}>
|
|
24
|
+
{t(`EKYC_STATUS_${item.status}`)}
|
|
25
|
+
</span>
|
|
26
|
+
),
|
|
27
|
+
})) || [];
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<div className="inbox-wrapper">
|
|
31
|
+
<div className="ekyc-header-container module-header">
|
|
32
|
+
<Header className="title">{t("EKYC_INBOX_HEADER")}</Header>
|
|
33
|
+
<Link to={`${parentRoute}/create-kyc`}>
|
|
34
|
+
<SubmitBar label={t("EKYC_CREATE_KYC")} />
|
|
35
|
+
</Link>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div className="ekyc-metrics-section">
|
|
39
|
+
<StatusCards countData={countData} />
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<SearchConsumer
|
|
43
|
+
onSearch={onSearch}
|
|
44
|
+
searchParams={searchParams}
|
|
45
|
+
/>
|
|
46
|
+
|
|
47
|
+
<div className="mobile-data-container">
|
|
48
|
+
{isLoading ? (
|
|
49
|
+
<Loader />
|
|
50
|
+
) : mobileData?.length > 0 ? (
|
|
51
|
+
<DetailsCard
|
|
52
|
+
data={mobileData}
|
|
53
|
+
t={t}
|
|
54
|
+
serviceRequestIdKey={t("EKYC_APPLICATION_NO")}
|
|
55
|
+
linkPrefix={`${parentRoute}/application-details/`}
|
|
56
|
+
/>
|
|
57
|
+
) : (
|
|
58
|
+
<Card>
|
|
59
|
+
{t("ES_COMMON_NO_DATA")
|
|
60
|
+
.split("\\n")
|
|
61
|
+
.map((text, index) => (
|
|
62
|
+
<p key={index} style={{ textAlign: "center" }}>
|
|
63
|
+
{text}
|
|
64
|
+
</p>
|
|
65
|
+
))}
|
|
66
|
+
</Card>
|
|
67
|
+
)}
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export default MobileInbox;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import React, { useState, Fragment } from "react";
|
|
2
|
+
import { TextInput, Card, SubmitBar, Header, HomeIcon } from "@djb25/digit-ui-react-components";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import StatusCards from "./StatusCards";
|
|
5
|
+
|
|
6
|
+
const SearchConsumer = ({ onSearch, searchParams, FilterComponent, children, ...props }) => {
|
|
7
|
+
const { t } = useTranslation();
|
|
8
|
+
const [_searchParams, setSearchParams] = useState(() => ({ ...searchParams }));
|
|
9
|
+
|
|
10
|
+
const onChange = (key, value) => {
|
|
11
|
+
setSearchParams((prev) => ({ ...prev, [key]: value }));
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const onSubmit = (e) => {
|
|
15
|
+
if (e && e.preventDefault) e.preventDefault();
|
|
16
|
+
onSearch(_searchParams);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const onClear = () => {
|
|
20
|
+
const cleared = { kNumber: "", kName: "" };
|
|
21
|
+
setSearchParams(cleared);
|
|
22
|
+
onSearch(cleared);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div className="inbox-container">
|
|
27
|
+
<div className="filters-container">
|
|
28
|
+
{/* Sidebar Title Card */}
|
|
29
|
+
<Card className="sidebar-title-card" style={{ display: "flex", alignItems: "center", padding: "16px", marginBottom: "16px", borderRadius: "4px" }}>
|
|
30
|
+
<div className="icon-container" style={{ color: "#F47738", marginRight: "12px" }}>
|
|
31
|
+
<HomeIcon style={{ width: "24px", height: "24px" }} />
|
|
32
|
+
</div>
|
|
33
|
+
<div style={{ fontWeight: "700", fontSize: "18px", color: "#0B0C0C" }}>
|
|
34
|
+
{t("ACTION_CREATE_EKYC")}
|
|
35
|
+
</div>
|
|
36
|
+
</Card>
|
|
37
|
+
|
|
38
|
+
<div>
|
|
39
|
+
{FilterComponent && (
|
|
40
|
+
<FilterComponent
|
|
41
|
+
defaultSearchParams={props.defaultSearchParams}
|
|
42
|
+
onFilterChange={props.onSearch}
|
|
43
|
+
searchParams={searchParams}
|
|
44
|
+
type="desktop"
|
|
45
|
+
moduleCode="EKYC"
|
|
46
|
+
/>
|
|
47
|
+
)}
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<div style={{ flex: 1, marginLeft: "16px" }}>
|
|
52
|
+
{/* <Card className="ekyc-metrics-card" style={{ marginBottom: "16px", padding: "16px" }}>
|
|
53
|
+
<StatusCards countData={props.countData} />
|
|
54
|
+
</Card> */}
|
|
55
|
+
|
|
56
|
+
<Card className="ekyc-search-card" style={{ padding: "24px", marginBottom: "24px", borderRadius: "12px", boxShadow: "0 4px 12px rgba(0,0,0,0.05)" }}>
|
|
57
|
+
<Header style={{ fontSize: "24px", marginBottom: "20px", fontWeight: "700", color: "#0B0C0C" }}>
|
|
58
|
+
{t("EKYC_SEARCH_CONSUMER_HEADER")}
|
|
59
|
+
</Header>
|
|
60
|
+
<form onSubmit={onSubmit}>
|
|
61
|
+
<div style={{ display: "flex", gap: "24px", alignItems: "flex-end", flexWrap: "wrap" }}>
|
|
62
|
+
<div style={{ flex: "1", minWidth: "250px" }}>
|
|
63
|
+
<div className="filter-label" style={{ fontWeight: "600", marginBottom: "8px", fontSize: "14px", color: "#505A5F" }}>
|
|
64
|
+
{t("EKYC_K_NUMBER")}
|
|
65
|
+
</div>
|
|
66
|
+
<div style={{ position: "relative" }}>
|
|
67
|
+
<TextInput
|
|
68
|
+
value={_searchParams?.kNumber}
|
|
69
|
+
onChange={(e) => onChange("kNumber", e.target.value)}
|
|
70
|
+
placeholder={t("EKYC_K_NUMBER_PLACEHOLDER")}
|
|
71
|
+
style={{ borderRadius: "8px", paddingLeft: "12px", height: "44px" }}
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<div style={{ flex: "1", minWidth: "250px" }}>
|
|
77
|
+
<div className="filter-label" style={{ fontWeight: "600", marginBottom: "8px", fontSize: "14px", color: "#505A5F" }}>
|
|
78
|
+
{t("EKYC_K_NAME")}
|
|
79
|
+
</div>
|
|
80
|
+
<div style={{ position: "relative" }}>
|
|
81
|
+
<TextInput
|
|
82
|
+
value={_searchParams?.kName}
|
|
83
|
+
onChange={(e) => onChange("kName", e.target.value)}
|
|
84
|
+
placeholder={t("EKYC_K_NAME_PLACEHOLDER")}
|
|
85
|
+
style={{ borderRadius: "8px", paddingLeft: "12px", height: "44px" }}
|
|
86
|
+
/>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<div style={{ display: "flex", gap: "12px", alignItems: "center" }}>
|
|
91
|
+
<button
|
|
92
|
+
type="button"
|
|
93
|
+
onClick={onClear}
|
|
94
|
+
style={{
|
|
95
|
+
background: "none",
|
|
96
|
+
border: "none",
|
|
97
|
+
color: "#0076f3ff",
|
|
98
|
+
fontWeight: "600",
|
|
99
|
+
cursor: "pointer",
|
|
100
|
+
fontSize: "14px",
|
|
101
|
+
padding: "10px",
|
|
102
|
+
|
|
103
|
+
}}
|
|
104
|
+
>
|
|
105
|
+
{t("ES_COMMON_CLEAR")}
|
|
106
|
+
</button>
|
|
107
|
+
<SubmitBar
|
|
108
|
+
label={t("ES_COMMON_SEARCH")}
|
|
109
|
+
onSubmit={onSubmit}
|
|
110
|
+
style={{ margin: 0, borderRadius: "8px", height: "44px", padding: "0 32px", marginTop: "-55px" }}
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</form>
|
|
115
|
+
</Card>
|
|
116
|
+
{children}
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export default SearchConsumer;
|