@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.
@@ -3,31 +3,43 @@ import React from "react";
3
3
  import { useTranslation } from "react-i18next";
4
4
 
5
5
  const EKYCCard = () => {
6
- const { t } = useTranslation();
6
+ const { t } = useTranslation();
7
7
 
8
- const propsForModuleCard = {
9
- Icon: <PersonIcon />,
10
- moduleName: t("ACTION_TEST_EKYC"),
11
- kpis: [
12
- {
13
- count: "-",
14
- label: t("TOTAL_EKYC"),
15
- link: `/digit-ui/employee/ekyc/dashboard`
16
- }
17
- ],
18
- links: [
19
- {
20
- label: t("EKYC_DASHBOARD"),
21
- link: `/digit-ui/employee/ekyc/dashboard`
22
- },
23
- {
24
- label: t("EKYC_CREATE_KYC"),
25
- link: `/digit-ui/employee/ekyc/create-kyc`
26
- },
27
- ]
28
- }
8
+ const propsForModuleCard = {
9
+ Icon: <PersonIcon />,
10
+ moduleName: t("ACTION_TEST_EKYC"),
11
+ kpis: [
12
+ {
13
+ count: "-",
14
+ label: t("TOTAL_EKYC"),
15
+ link: `/digit-ui/employee/ekyc/dashboard`,
16
+ },
17
+ ],
18
+ links: [
19
+ {
20
+ label: t("EKYC_DASHBOARD"),
21
+ link: `/digit-ui/employee/ekyc/dashboard`,
22
+ },
23
+ {
24
+ label: t("EKYC_INBOX"),
25
+ link: `/digit-ui/employee/ekyc/inbox`,
26
+ },
27
+ // {
28
+ // label: t("EKYC_CREATE_KYC"),
29
+ // link: `/digit-ui/employee/ekyc/create-kyc`
30
+ // },
31
+ // {
32
+ // label: t("EKYC_UPDATE_KYC"),
33
+ // link: `/digit-ui/employee/ekyc/update-kyc`
34
+ // },
35
+ {
36
+ label: t("EKYC_MAPPING"),
37
+ link: `/digit-ui/employee/ekyc/mapping`,
38
+ },
39
+ ],
40
+ };
29
41
 
30
- return <EmployeeModuleCard {...propsForModuleCard} />
42
+ return <EmployeeModuleCard {...propsForModuleCard} />;
31
43
  };
32
44
 
33
45
  export default EKYCCard;
@@ -1,60 +1,55 @@
1
- import React, { useEffect, useState } from "react";
1
+ import React, { useState } from "react";
2
2
  import { Dropdown, FilterForm, FilterFormField } from "@djb25/digit-ui-react-components";
3
3
  import { useTranslation } from "react-i18next";
4
4
 
5
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
- const newParams = { ..._searchParams, status: value };
29
- setSearchParams(newParams);
30
- onFilterChange(newParams);
31
- };
32
-
33
- return (
34
- <FilterForm
35
- onSubmit={applyLocalFilters}
36
- handleSubmit={(fn) => (e) => { e && e.preventDefault(); fn(); }}
37
- onResetFilterForm={clearAll}
38
- id="ekyc-filter-form"
39
- onMobileExclusiveFilterPopupFormClose={props.onClose}
40
- >
41
- <FilterFormField>
42
- <div className="filter-label" style={{ fontWeight: "normal" }}>
43
- {t("EKYC_STATUS")}:
44
- </div>
45
- <Dropdown
46
- option={[
47
- { label: t("EKYC_STATUS_ALL"), value: "" },
48
- { label: t("EKYC_STATUS_ACTIVE"), value: "ACTIVE" },
49
- { label: t("EKYC_STATUS_PENDING"), value: "PENDING START" },
50
- ]}
51
- optionKey="label"
52
- select={onStatusChange}
53
- selected={_searchParams?.status || { label: t("EKYC_STATUS_ALL"), value: "" }}
54
- />
55
- </FilterFormField>
56
- </FilterForm>
57
- );
6
+ const { t } = useTranslation();
7
+
8
+ const [_searchParams, setSearchParams] = useState(() => ({ ...searchParams }));
9
+
10
+ const applyLocalFilters = () => {
11
+ onFilterChange(_searchParams);
12
+ };
13
+
14
+ const clearAll = () => {
15
+ setSearchParams({ ...defaultSearchParams });
16
+ onFilterChange({ ...defaultSearchParams });
17
+ };
18
+
19
+ const onStatusChange = (value) => {
20
+ const newParams = { ..._searchParams, status: value };
21
+ setSearchParams(newParams);
22
+ onFilterChange(newParams);
23
+ };
24
+
25
+ return (
26
+ <FilterForm
27
+ onSubmit={applyLocalFilters}
28
+ handleSubmit={(fn) => (e) => {
29
+ e && e.preventDefault();
30
+ fn();
31
+ }}
32
+ onResetFilterForm={clearAll}
33
+ id="ekyc-filter-form"
34
+ onMobileExclusiveFilterPopupFormClose={props.onClose}
35
+ >
36
+ <FilterFormField>
37
+ <div className="filter-label" style={{ fontWeight: "normal" }}>
38
+ {t("EKYC_STATUS")}:
39
+ </div>
40
+ <Dropdown
41
+ option={[
42
+ { label: t("EKYC_STATUS_ALL"), value: "" },
43
+ { label: t("EKYC_STATUS_ACTIVE"), value: "ACTIVE" },
44
+ { label: t("EKYC_STATUS_PENDING"), value: "PENDING START" },
45
+ ]}
46
+ optionKey="label"
47
+ select={onStatusChange}
48
+ selected={_searchParams?.status || { label: t("EKYC_STATUS_ALL"), value: "" }}
49
+ />
50
+ </FilterFormField>
51
+ </FilterForm>
52
+ );
58
53
  };
59
54
 
60
55
  export default Filter;
@@ -1,7 +1,6 @@
1
- import React, { useState, Fragment } from "react";
2
- import { TextInput, Card, SubmitBar, Header, HomeIcon } from "@djb25/digit-ui-react-components";
1
+ import React, { useState } from "react";
2
+ import { TextInput, Card, HomeIcon } from "@djb25/digit-ui-react-components";
3
3
  import { useTranslation } from "react-i18next";
4
- import StatusCards from "./StatusCards";
5
4
 
6
5
  const SearchConsumer = ({ onSearch, searchParams, FilterComponent, children, ...props }) => {
7
6
  const { t } = useTranslation();
@@ -23,110 +22,121 @@ const SearchConsumer = ({ onSearch, searchParams, FilterComponent, children, ...
23
22
  };
24
23
 
25
24
  return (
26
- <div className="inbox-container">
27
- <div className="filters-container">
28
- {/* Sidebar Title Card */}
29
- <Card
30
- className="sidebar-title-card"
31
- style={{ display: "flex", alignItems: "center", padding: "16px", marginBottom: "16px", borderRadius: "4px" }}
32
- >
33
- <div className="icon-container" style={{ color: "#3A8DCC", marginRight: "12px" }}>
34
- <HomeIcon style={{ width: "24px", height: "24px" }} />
35
- </div>
36
- <div style={{ fontWeight: "700", fontSize: "18px", color: "#0B0C0C" }}>{t("ACTION_CREATE_EKYC")}</div>
37
- </Card>
38
-
39
- <div>
40
- {FilterComponent && (
41
- <FilterComponent
42
- defaultSearchParams={props.defaultSearchParams}
43
- onFilterChange={props.onSearch}
44
- searchParams={searchParams}
45
- type="desktop"
46
- moduleCode="EKYC"
47
- />
48
- )}
25
+ <div className="ekyc-employee-container">
26
+ <div className="search-consumer-wrapper">
27
+ <div className="header-wrapper">
28
+ {/* Sidebar Title Card — flush top, full width */}
29
+ <Card className="sidebar-title-card">
30
+ <div className="icon-container">
31
+ <HomeIcon />
32
+ </div>
33
+ <div className="title-text">
34
+ {t("EKYC_SEARCH_CONSUMER_HEADER")}
35
+ </div>
36
+ </Card>
49
37
  </div>
50
- </div>
51
38
 
52
- <div style={{ flex: 1, marginLeft: "16px" }}>
53
- {/* <Card className="ekyc-metrics-card" style={{ marginBottom: "16px", padding: "16px" }}>
54
- <StatusCards countData={props.countData} />
55
- </Card> */}
56
-
57
- <Card
58
- className="ekyc-search-card"
59
- style={{ padding: "24px", marginBottom: "24px", borderRadius: "12px", boxShadow: "0 4px 12px rgba(0,0,0,0.05)" }}
60
- >
61
- <Header style={{ fontSize: "24px", marginBottom: "20px", fontWeight: "700", color: "#0B0C0C" }}>{t("EKYC_SEARCH_CONSUMER_HEADER")}</Header>
62
- <form onSubmit={onSubmit}>
63
- <div style={{ display: "flex", gap: "24px", alignItems: "flex-end", flexWrap: "wrap" }}>
64
- <div style={{ flex: "1", minWidth: "250px" }}>
65
- <div className="filter-label" style={{ fontWeight: "600", marginBottom: "8px", fontSize: "14px", color: "#505A5F" }}>
66
- {t("EKYC_K_NUMBER")}
67
- </div>
68
- <div style={{ position: "relative" }}>
69
- <TextInput
70
- value={_searchParams?.kNumber}
71
- onChange={(e) => onChange("kNumber", e.target.value)}
72
- placeholder={t("EKYC_K_NUMBER_PLACEHOLDER")}
73
- style={{ borderRadius: "8px", paddingLeft: "12px", height: "44px" }}
74
- />
39
+ {/* Main Content */}
40
+ <div className="main-content-wrapper">
41
+ {/* Top Row: Search Card + Stats Cards */}
42
+ <div className="search-stats-row">
43
+ {/* Identity Lookup Card */}
44
+ <div className="identity-lookup-card">
45
+ {/* Card Title */}
46
+ <div className="lookup-card-title">
47
+ <div className="lookup-icon-bg">
48
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="#3A7BD5" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
49
+ <circle cx="11" cy="11" r="8" />
50
+ <line x1="21" y1="21" x2="16.65" y2="16.65" />
51
+ </svg>
75
52
  </div>
53
+ <span className="lookup-title-text">
54
+ {t("EKYC_IDENTITY_LOOKUP") || "Identity Lookup"}
55
+ </span>
76
56
  </div>
77
57
 
78
- <div style={{ flex: "1", minWidth: "250px" }}>
79
- <div className="filter-label" style={{ fontWeight: "600", marginBottom: "8px", fontSize: "14px", color: "#505A5F" }}>
80
- {t("EKYC_K_NAME")}
58
+ {/* Inputs Row */}
59
+ <form onSubmit={onSubmit}>
60
+ <div className="inputs-row">
61
+ <div className="input-group">
62
+ <label>
63
+ {t("EKYC_K_NUMBER") || "K Number"}
64
+ <span className="info-badge">i</span>
65
+ </label>
66
+ <TextInput
67
+ value={_searchParams?.kNumber}
68
+ onChange={(e) => onChange("kNumber", e.target.value)}
69
+ placeholder={t("EKYC_K_NUMBER_PLACEHOLDER") || "e.g. 8234910234"}
70
+ />
71
+ </div>
72
+
73
+ <div className="input-group">
74
+ <label>
75
+ {t("EKYC_K_NAME") || "K Name"}
76
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#3A7BD5" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
77
+ <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" />
78
+ <circle cx="12" cy="7" r="4" />
79
+ </svg>
80
+ </label>
81
+ <TextInput
82
+ value={_searchParams?.kName}
83
+ onChange={(e) => onChange("kName", e.target.value)}
84
+ placeholder={t("EKYC_K_NAME_PLACEHOLDER") || "Consumer name search"}
85
+ />
86
+ </div>
81
87
  </div>
82
- <div style={{ position: "relative" }}>
83
- <TextInput
84
- value={_searchParams?.kName}
85
- onChange={(e) => onChange("kName", e.target.value)}
86
- placeholder={t("EKYC_K_NAME_PLACEHOLDER")}
87
- style={{ borderRadius: "8px", paddingLeft: "12px", height: "44px" }}
88
- />
88
+
89
+ {/* Actions Row */}
90
+ <div className="actions-row">
91
+ <button type="button" onClick={onClear} className="clear-btn">
92
+ {t("ES_COMMON_CLEAR") || "Clear"}
93
+ </button>
94
+ <button type="submit" className="search-btn">
95
+ {t("ES_COMMON_SEARCH") || "Execute Search"}
96
+ </button>
89
97
  </div>
90
- </div>
98
+ </form>
91
99
  </div>
92
- <div style={{ display: "flex", justifyContent: "flex-end", marginTop: "20px" }}>
93
- <div style={{ display: "flex", gap: "12px", alignItems: "center" }}>
94
- <button
95
- type="button"
96
- onClick={onClear}
97
- style={{
98
- background: "none",
99
- border: "none",
100
- color: "#0076f3ff",
101
- fontWeight: "600",
102
- cursor: "pointer",
103
- fontSize: "14px",
104
- padding: "10px",
105
- }}
106
- >
107
- {t("ES_COMMON_CLEAR")}
108
- </button>
109
100
 
110
- <SubmitBar
111
- label={t("ES_COMMON_SEARCH")}
112
- onSubmit={onSubmit}
113
- style={{
114
- margin: 0,
115
- borderRadius: "8px",
116
- height: "44px",
117
- padding: "0 32px",
118
- // remove this (it breaks alignment)
119
- // marginTop: "-55px"
120
- }}
121
- />
101
+ {/* Right Stats Column */}
102
+ <div className="stats-column">
103
+ {/* Today's Audits Card */}
104
+ <div className="audits-card">
105
+ <div className="audits-label">{t("EKYC_TODAYS_AUDITS") || "Today's Audits"}</div>
106
+ <div className="audits-count">{props.countData?.todaysAudits || 24}</div>
107
+ <div className="audits-change">
108
+ <span>↗</span>
109
+ {props.countData?.auditChange || "12% increase from yesterday"}
110
+ </div>
111
+ <div className="audits-watermark">M</div>
112
+ </div>
113
+
114
+ {/* Queue Status Card */}
115
+ <div className="queue-card">
116
+ <div className="queue-label">{t("EKYC_QUEUE_STATUS") || "Queue Status"}</div>
117
+ <div className="queue-content">
118
+ <div className="queue-status-text">
119
+ {props.countData?.pendingCount || 3} Pending
120
+ </div>
121
+ <div className="avatar-group">
122
+ {[0, 1].map((i) => (
123
+ <div key={i} className="avatar-item">
124
+ {String.fromCharCode(65 + i)}
125
+ </div>
126
+ ))}
127
+ <div className="avatar-more">+1</div>
128
+ </div>
129
+ </div>
122
130
  </div>
123
131
  </div>
124
- </form>
125
- </Card>
126
- {children}
132
+ </div>
133
+
134
+ {/* Children (ConnectionDetailsView or placeholder) */}
135
+ {children}
136
+ </div>
127
137
  </div>
128
138
  </div>
129
139
  );
130
140
  };
131
141
 
132
- export default SearchConsumer;
142
+ export default SearchConsumer;
@@ -0,0 +1,55 @@
1
+ import React from "react";
2
+ import { Controller } from "react-hook-form";
3
+ import { CardLabelError, TextInput, Tooltip, Label } from "@djb25/digit-ui-react-components";
4
+ import { useTranslation } from "react-i18next";
5
+
6
+ const SearchFormFieldsComponents = ({ searchFormState, controlSearchForm }) => {
7
+ const { t } = useTranslation();
8
+ const { errors } = searchFormState;
9
+
10
+ return (
11
+ <React.Fragment>
12
+ {/* K NUMBER */}
13
+ <span className="mobile-input">
14
+ <Label className="flex-roww flex-gap-2">
15
+ {t("EKYC_K_NUMBER") || "K Number"}
16
+ <Tooltip message={t("EKYC_K_NUMBER_MESSAGE")} />
17
+ </Label>
18
+
19
+ <Controller
20
+ name="kNumber"
21
+ control={controlSearchForm}
22
+ defaultValue=""
23
+ rules={{
24
+ pattern: {
25
+ value: /^[a-zA-Z0-9-_/]*$/,
26
+ message: t("ERR_INVALID_APPLICATION_NO"),
27
+ },
28
+ }}
29
+ render={({ onChange, value }) => <TextInput value={value || ""} onChange={(e) => onChange(e.target.value)} />}
30
+ />
31
+
32
+ {errors?.kNumber && <CardLabelError>{errors.kNumber.message}</CardLabelError>}
33
+ </span>
34
+
35
+ {/* K NAME */}
36
+ {/* <span className="mobile-input">
37
+ <Label className="flex-roww flex-gap-2">
38
+ {t("EKYC_K_NAME") || "K Name"}
39
+ <Tooltip message={t("EKYC_K_NAME_MESSAGE")} />
40
+ </Label>
41
+
42
+ <Controller
43
+ name="kName"
44
+ control={controlSearchForm}
45
+ defaultValue=""
46
+ render={({ onChange, value }) => <TextInput value={value || ""} onChange={(e) => onChange(e.target.value)} />}
47
+ />
48
+
49
+ {errors?.kName && <CardLabelError>{errors.kName.message}</CardLabelError>}
50
+ </span> */}
51
+ </React.Fragment>
52
+ );
53
+ };
54
+
55
+ export default SearchFormFieldsComponents;