eleven-solutions-common-website-unique-web 23.0.18 → 24.0.0

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.
@@ -24,6 +24,7 @@ export const TaxonomyForm = ({ url }) => {
24
24
  const [isModalOpen, setIsModalOpen] = useState(false);
25
25
  const [newCode, setNewCode] = useState("");
26
26
  const [newValue, setNewValue] = useState("");
27
+ const [hiddenforUser, sethiddenforUser] = useState(false);
27
28
  const [subCode, setSubCode] = useState("");
28
29
  const [subValue, setSubValue] = useState("");
29
30
  const [isAddingSubType, setIsAddingSubType] = useState(false);
@@ -143,6 +144,7 @@ export const TaxonomyForm = ({ url }) => {
143
144
  setIsModalOpen(false);
144
145
  setNewCode("");
145
146
  setNewValue("");
147
+ sethiddenforUser(false);
146
148
  setSubCode("");
147
149
  setSubValue("");
148
150
  };
@@ -157,6 +159,7 @@ export const TaxonomyForm = ({ url }) => {
157
159
  setEditTaxonomyItem(item);
158
160
  setNewCode(item.code);
159
161
  setNewValue(item.value);
162
+ sethiddenforUser(item.isHiddenForUser);
160
163
  setIsModalOpen(true);
161
164
  };
162
165
  const handleAddSubType = (index, id) => {
@@ -215,11 +218,11 @@ export const TaxonomyForm = ({ url }) => {
215
218
  }
216
219
  try {
217
220
  if (editTaxonomyItem) {
218
- yield updateTaxonomyApi(url, selectedTaxonomyId, type, Number(newCode), newValue);
221
+ yield updateTaxonomyApi(url, selectedTaxonomyId, type, Number(newCode), newValue, hiddenforUser);
219
222
  toast.success("Taxonomy updated successfully");
220
223
  }
221
224
  else {
222
- yield addTaxonomyApi(url, type, Number(newCode), newValue);
225
+ yield addTaxonomyApi(url, type, Number(newCode), newValue, hiddenforUser);
223
226
  toast.success("Value added successfully");
224
227
  }
225
228
  const response = yield fetchTaxonomiessApi(url);
@@ -232,10 +235,12 @@ export const TaxonomyForm = ({ url }) => {
232
235
  toast.error(`Error while ${editTaxonomyItem ? "editing" : "adding"} SubType: ${errorMessage}`);
233
236
  setNewCode("");
234
237
  setNewValue("");
238
+ sethiddenforUser(false);
235
239
  }
236
240
  setIsModalOpen(false);
237
241
  setNewCode("");
238
242
  setNewValue("");
243
+ sethiddenforUser(false);
239
244
  });
240
245
  const handleDeleteClick = (id) => __awaiter(void 0, void 0, void 0, function* () {
241
246
  try {
@@ -102,5 +102,5 @@ export const UserForm = ({ url }) => {
102
102
  window.history.pushState({}, "", "/admin/users");
103
103
  window.dispatchEvent(new PopStateEvent("popstate"));
104
104
  };
105
- return (_jsx("div", { className: "max-w-4xl p-6 dark:bg-gray-800", children: _jsx("div", { children: loading ? (_jsx("div", { className: "flex justify-center items-center h-screen", children: _jsx("div", { className: "flex justify-center items-center h-12 w-12 animate-spin rounded-full border-4 border-solid border-current border-e-transparent align-[-0.125em] text-surface motion-reduce:animate-[spin_1.5s_linear_infinite] text-blue-600", role: "status", children: _jsx("span", { className: "!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]", children: "Loading..." }) }) })) : hasError ? (_jsx("div", { className: "flex justify-center items-center h-screen" })) : (_jsx("div", { children: _jsxs("form", { children: [_jsx("h1", { className: "text-3xl font-bold text-blue-600 capitalize dark:text-white mb-4", children: isEditMode ? "Edit User" : "Add User" }), _jsxs("div", { className: "mb-6 w-full", children: [_jsxs("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: ["Name ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsx("input", { required: true, value: userName, onChange: (e) => setUserName(e.target.value), type: "text", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Enter User Name" })] }), _jsxs("div", { className: "mb-6 w-full", children: [_jsxs("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: ["Email ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsx("input", { required: true, value: email, onChange: (e) => setEmail(e.target.value), type: "email", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Enter Email" })] }), _jsxs("div", { className: "mb-6 w-full", children: [_jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Mobile Number" }), _jsx("input", { required: true, value: mobile, onChange: (e) => setMobile(e.target.value), type: "number", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Enter Mobile Number" })] }), _jsxs("div", { className: "mb-6 w-full", children: [_jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Address" }), _jsx("input", { required: true, value: address, onChange: (e) => setAddress(e.target.value), type: "text", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Address" })] }), _jsxs("div", { className: "mb-6 w-full", children: [_jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Gender" }), _jsxs("select", { required: true, value: gender, onChange: (e) => setGender(e.target.value === "" ? null : e.target.value), className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", children: [_jsx("option", { value: "", children: "Select a Gender" }), _jsx("option", { value: "1", children: "Male" }), _jsx("option", { value: "2", children: "Female" })] })] }), _jsxs("div", { className: "mb-6 w-full", children: [_jsxs("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: ["Role Type ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsxs("select", { required: true, value: roleType, onChange: (e) => setRoleType(e.target.value), className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", children: [_jsx("option", { value: "", children: "Select a Role Type" }), _jsx("option", { value: "1", children: "Guest" }), _jsx("option", { value: "2", children: "Admin" })] })] }), _jsxs("div", { className: "flex space-x-4 mt-6 justify-start", children: [_jsx("button", { type: "submit", onClick: handleSubmit, className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: isEditMode ? "Edit" : "Save and Close" }), _jsx("button", { type: "button", onClick: handleCancelClick, className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: "Cancel" })] })] }) })) }) }));
105
+ return (_jsx("div", { className: "max-w-4xl p-6 dark:bg-gray-800", children: _jsx("div", { children: loading ? (_jsx("div", { className: "flex justify-center items-center h-screen", children: _jsx("div", { className: "flex justify-center items-center h-12 w-12 animate-spin rounded-full border-4 border-solid border-current border-e-transparent align-[-0.125em] text-surface motion-reduce:animate-[spin_1.5s_linear_infinite] text-blue-600", role: "status", children: _jsx("span", { className: "!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]", children: "Loading..." }) }) })) : hasError ? (_jsx("div", { className: "flex justify-center items-center h-screen" })) : (_jsx("div", { children: _jsxs("form", { children: [_jsx("h1", { className: "text-3xl font-bold text-blue-600 capitalize dark:text-white mb-4", children: isEditMode ? "Edit User" : "Add User" }), _jsxs("div", { className: "mb-6 w-full", children: [_jsxs("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: ["Name ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsx("input", { required: true, value: userName, onChange: (e) => setUserName(e.target.value), type: "text", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Enter User Name" })] }), _jsxs("div", { className: "mb-6 w-full", children: [_jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Email" }), _jsx("input", { required: true, value: email, onChange: (e) => setEmail(e.target.value), type: "email", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Enter Email" })] }), _jsxs("div", { className: "mb-6 w-full", children: [_jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Mobile Number" }), _jsx("input", { required: true, value: mobile, onChange: (e) => setMobile(e.target.value), type: "number", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Enter Mobile Number" })] }), _jsxs("div", { className: "mb-6 w-full", children: [_jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Address" }), _jsx("input", { required: true, value: address, onChange: (e) => setAddress(e.target.value), type: "text", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Address" })] }), _jsxs("div", { className: "mb-6 w-full", children: [_jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Gender" }), _jsxs("select", { required: true, value: gender, onChange: (e) => setGender(e.target.value === "" ? null : e.target.value), className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", children: [_jsx("option", { value: "", children: "Select a Gender" }), _jsx("option", { value: "1", children: "Male" }), _jsx("option", { value: "2", children: "Female" })] })] }), _jsxs("div", { className: "mb-6 w-full", children: [_jsxs("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: ["Role Type ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsxs("select", { required: true, value: roleType, onChange: (e) => setRoleType(e.target.value), className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", children: [_jsx("option", { value: "", children: "Select a Role Type" }), _jsx("option", { value: "1", children: "Guest" }), _jsx("option", { value: "2", children: "Admin" })] })] }), _jsxs("div", { className: "flex space-x-4 mt-6 justify-start", children: [_jsx("button", { type: "submit", onClick: handleSubmit, className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: isEditMode ? "Edit" : "Save and Close" }), _jsx("button", { type: "button", onClick: handleCancelClick, className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: "Cancel" })] })] }) })) }) }));
106
106
  };
@@ -94,22 +94,369 @@ export const Users = ({ url }) => {
94
94
  event.preventDefault();
95
95
  setCurrentPage(1);
96
96
  };
97
- return (_jsxs("div", { className: "container px-4 mx-auto mt-6", children: [_jsx("div", { className: "w-3/4", children: _jsx("h1", { className: "text-3xl font-bold text-blue-600 mb-5", children: "Users" }) }), _jsxs("div", { className: "flex items-center w-full", children: [_jsxs("form", { className: "flex-grow", onSubmit: handleSearchSubmit, children: [_jsx("label", { htmlFor: "default-search", className: "mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white", children: "Search" }), _jsxs("div", { className: "relative", children: [_jsx("div", { className: "absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none", children: _jsx("svg", { className: "w-4 h-4 text-gray-500 dark:text-gray-400", "aria-hidden": "true", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", children: _jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z" }) }) }), _jsx("input", { type: "search", id: "default-search", className: "w-full p-3 ps-10 outline-none text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500", placeholder: "Search by Name, Email or Mobile", value: searchTerm, onChange: handleSearchChange, required: true }), _jsx("button", { type: "button", className: "text-white absolute end-1.5 bottom-1.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800", children: "Search" })] })] }), _jsx("button", { onClick: () => setFilterModal(true), className: "ml-5 text-white bg-blue-700 hover:bg-blue-800 focus:ring-2 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800", "aria-label": "Toggle Menu", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "icon icon-tabler icons-tabler-outline icon-tabler-filter", children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z" })] }) })] }), _jsx("div", { className: "flex-grow ml-0 w-3/4", children: _jsx("form", { className: "w-auto" }) }), _jsxs("div", { className: "flex-grow ml-0 mt-4 w-full", children: [_jsx("div", { className: "overflow-hidden border border-gray-200 dark:border-gray-700 md:rounded-lg mt-6", children: _jsxs("table", { className: "min-w-full divide-y divide-gray-200 dark:divide-gray-700", children: [_jsx("thead", { className: "bg-gray-50 dark:bg-gray-800", children: _jsxs("tr", { children: [_jsx("th", { scope: "col", className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Actions" }), _jsx("th", { scope: "col", className: "py-3.5 px-4 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: _jsx("div", { className: "flex items-center gap-x-3", children: _jsx("span", { children: "Name" }) }) }), _jsx("th", { scope: "col", className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: _jsx("button", { className: "flex items-center gap-x-2", children: _jsx("span", { children: "Email" }) }) }), _jsx("th", { scope: "col", className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: _jsx("button", { className: "flex items-center gap-x-2", children: _jsx("span", { children: "Mobile" }) }) }), _jsx("th", { scope: "col", className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Address" }), _jsx("th", { scope: "col", className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Gender" }), _jsx("th", { scope: "col", className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Role Type" }), _jsx("th", { scope: "col", className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Registered On" })] }) }), _jsx("tbody", { className: "bg-white divide-y divide-gray-200 dark:divide-gray-700 dark:bg-gray-900", children: paginatedUsers.map((user, index) => (_jsxs("tr", { children: [_jsx("td", { className: "px-4 py-4 text-sm whitespace-nowrap", children: _jsxs("div", { className: "flex items-center gap-x-6", children: [_jsx("button", { onClick: () => handleDeleteClick(user.id), className: "text-gray-500 transition-colors duration-200 dark:hover:text-red-600 dark:text-gray-300 hover:text-red-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" }) }) }), _jsx("button", { onClick: (event) => handleEditClick(event, "/admin/users/userform?id=", user.id), className: "text-gray-500 transition-colors duration-200 dark:hover:text-yellow-500 dark:text-gray-300 hover:text-yellow-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10" }) }) })] }) }), _jsx("td", { className: "px-4 py-4 text-sm font-medium text-gray-700 whitespace-nowrap", children: _jsx("div", { className: "inline-flex items-center gap-x-3", children: _jsx("div", { className: "flex items-center gap-x-2", children: _jsx("div", { children: _jsx("h2", { className: " text-sm font-medium text-gray-800 dark:text-white ", children: user.name }) }) }) }) }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap", children: user.email }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap", children: user.mobile }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap", children: user.address }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap", children: user.gender != null
98
- ? user.gender === 1
99
- ? "Male"
100
- : "Female"
101
- : "Not Provided" }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap", children: user.roleType === 1 ? "Guest" : "Admin" }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap", children: new Date(user.createdOn).toLocaleDateString("en-GB", {
102
- day: "2-digit",
103
- month: "2-digit",
104
- year: "numeric",
105
- }) })] }, user.id || index))) })] }) }), _jsx("div", { className: "flex-grow ml-0 mt-4 w-0", children: _jsxs("button", { type: "button", onClick: (event) => handleNavigation(event, "/admin/users/userform"), className: "flex items-center justify-center px-6 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-blue-600 rounded-lg hover:bg-blue-500 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-80", children: [_jsx(FaPlus, { className: "mr-2 font-medium" }), "User"] }) }), _jsxs("div", { className: "flex items-center justify-between mt-6", children: [_jsxs("button", { disabled: currentPage === 1, onClick: () => setCurrentPage((prev) => Math.max(prev - 1, 1)), className: "flex items-center px-5 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 bg-white border rounded-md gap-x-2 hover:bg-gray-100 dark:bg-gray-900 dark:text-gray-200 dark:border-gray-700 dark:hover:bg-gray-800", children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5 rtl:-scale-x-100", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6.75 15.75L3 12m0 0l3.75-3.75M3 12h18" }) }), _jsx("span", { children: "Previous" })] }), _jsx("div", { className: "items-center hidden lg:flex gap-x-3", children: Array.from({ length: Math.min(10, totalPages) }, (_, index) => {
106
- const startPage = Math.max(1, currentPage - 5);
107
- const page = startPage + index;
108
- if (page > totalPages)
109
- return null;
110
- return (_jsx("button", { onClick: () => setCurrentPage(page), className: `px-2 py-1 text-sm ${currentPage === page
111
- ? "text-blue-500 bg-blue-100"
112
- : "text-gray-500 hover:bg-gray-100"} rounded-md`, children: page }, page));
113
- }) }), _jsxs("button", { onClick: () => setCurrentPage((prev) => Math.min(prev + 1, totalPages)), disabled: currentPage === totalPages, className: "flex items-center px-5 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 bg-white border rounded-md gap-x-2 hover:bg-gray-100 dark:bg-gray-900 dark:text-gray-200 dark:border-gray-700 dark:hover:bg-gray-800", children: [_jsx("span", { children: "Next" }), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5 rtl:-scale-x-100", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.25 8.25L21 12m0 0l-3.75 3.75M21 12H3" }) })] })] })] }), _jsx("div", { className: "inset-0 bg-gray-800 bg-opacity-50 z-50 transition-opacity duration-300", children: _jsxs("div", { className: `fixed top-0 right-0 h-full w-[300px] bg-white p-4 rounded-md shadow-lg transform transition-transform duration-500 ease-in-out
114
- ${filterModal ? "translate-x-0" : "translate-x-full"}`, children: [_jsx("h1", { className: "text-2xl md:text-3xl font-bold text-blue-600 mb-4 md:mb-6", children: "Filter" }), _jsx("button", { onClick: () => setFilterModal(false), className: "absolute top-1 right-3 text-gray-400 hover:text-gray-600 text-2xl", children: "\u00D7" }), _jsxs("div", { className: "flex flex-col", children: [_jsxs("div", { className: "mb-4 flex flex-col", children: [_jsx("label", { className: "block text-gray-700 mb-2", children: "Role Type" }), _jsx("div", { className: "w-full", children: _jsxs("select", { value: Number(selectedRoleType), onChange: handleRoleTypeChange, required: true, className: "w-full px-4 py-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", children: [_jsx("option", { value: "", children: "All" }), _jsx("option", { value: "1", children: "Guest" }), _jsx("option", { value: "2", children: "Admin" })] }) })] }), _jsx("div", { className: "flex flex-row gap-3", children: _jsx("button", { onClick: resetFilter, className: "mt-2 px-4 py-2 bg-blue-500 text-white rounded-md w-32", children: "Reset" }) })] })] }) })] }));
97
+ return (
98
+ // <div className="container px-4 mx-auto mt-6">
99
+ // <div className="w-3/4">
100
+ // <h1 className="text-3xl font-bold text-blue-600 mb-5">Users</h1>
101
+ // </div>
102
+ // <div className="flex items-center w-full">
103
+ // <form className="flex-grow" onSubmit={handleSearchSubmit}>
104
+ // <label
105
+ // htmlFor="default-search"
106
+ // className="mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"
107
+ // >
108
+ // Search
109
+ // </label>
110
+ // <div className="relative">
111
+ // <div className="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
112
+ // <svg
113
+ // className="w-4 h-4 text-gray-500 dark:text-gray-400"
114
+ // aria-hidden="true"
115
+ // xmlns="http://www.w3.org/2000/svg"
116
+ // fill="none"
117
+ // viewBox="0 0 20 20"
118
+ // >
119
+ // <path
120
+ // stroke="currentColor"
121
+ // strokeLinecap="round"
122
+ // strokeLinejoin="round"
123
+ // strokeWidth="2"
124
+ // d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"
125
+ // />
126
+ // </svg>
127
+ // </div>
128
+ // <input
129
+ // type="search"
130
+ // id="default-search"
131
+ // className="w-full p-3 ps-10 outline-none text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
132
+ // placeholder="Search by Name, Email or Mobile"
133
+ // value={searchTerm}
134
+ // onChange={handleSearchChange}
135
+ // required
136
+ // />
137
+ // <button
138
+ // type="button"
139
+ // className="text-white absolute end-1.5 bottom-1.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
140
+ // >
141
+ // Search
142
+ // </button>
143
+ // </div>
144
+ // </form>
145
+ // <button
146
+ // onClick={() => setFilterModal(true)}
147
+ // className="ml-5 text-white bg-blue-700 hover:bg-blue-800 focus:ring-2 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
148
+ // aria-label="Toggle Menu"
149
+ // >
150
+ // <svg
151
+ // xmlns="http://www.w3.org/2000/svg"
152
+ // width="24"
153
+ // height="24"
154
+ // viewBox="0 0 24 24"
155
+ // fill="none"
156
+ // stroke="currentColor"
157
+ // strokeWidth="2"
158
+ // strokeLinecap="round"
159
+ // strokeLinejoin="round"
160
+ // className="icon icon-tabler icons-tabler-outline icon-tabler-filter"
161
+ // >
162
+ // <path stroke="none" d="M0 0h24v24H0z" fill="none" />
163
+ // <path d="M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z" />
164
+ // </svg>
165
+ // </button>
166
+ // </div>
167
+ // <div className="flex-grow ml-0 w-3/4">
168
+ // <form className="w-auto">{/* Search Form */}</form>
169
+ // </div>
170
+ // <div className="flex-grow ml-0 mt-4 w-full">
171
+ // <div className="overflow-hidden border border-gray-200 dark:border-gray-700 md:rounded-lg mt-6">
172
+ // <table className="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
173
+ // <thead className="bg-gray-50 dark:bg-gray-800">
174
+ // <tr>
175
+ // <th
176
+ // scope="col"
177
+ // className="px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400"
178
+ // >
179
+ // Actions
180
+ // </th>
181
+ // <th
182
+ // scope="col"
183
+ // className="py-3.5 px-4 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400"
184
+ // >
185
+ // <div className="flex items-center gap-x-3">
186
+ // <span>Name</span>
187
+ // </div>
188
+ // </th>
189
+ // <th
190
+ // scope="col"
191
+ // className="px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400"
192
+ // >
193
+ // <button className="flex items-center gap-x-2">
194
+ // <span>Email</span>
195
+ // </button>
196
+ // </th>
197
+ // <th
198
+ // scope="col"
199
+ // className="px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400"
200
+ // >
201
+ // <button className="flex items-center gap-x-2">
202
+ // <span>Mobile</span>
203
+ // </button>
204
+ // </th>
205
+ // <th
206
+ // scope="col"
207
+ // className="px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400"
208
+ // >
209
+ // Address
210
+ // </th>
211
+ // <th
212
+ // scope="col"
213
+ // className="px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400"
214
+ // >
215
+ // Gender
216
+ // </th>
217
+ // <th
218
+ // scope="col"
219
+ // className="px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400"
220
+ // >
221
+ // Role Type
222
+ // </th>
223
+ // <th
224
+ // scope="col"
225
+ // className="px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400"
226
+ // >
227
+ // Registered On
228
+ // </th>
229
+ // </tr>
230
+ // </thead>
231
+ // <tbody className="bg-white divide-y divide-gray-200 dark:divide-gray-700 dark:bg-gray-900">
232
+ // {paginatedUsers.map((user, index) => (
233
+ // <tr key={user.id || index}>
234
+ // <td className="px-4 py-4 text-sm whitespace-nowrap">
235
+ // <div className="flex items-center gap-x-6">
236
+ // <button
237
+ // onClick={() => handleDeleteClick(user.id)}
238
+ // className="text-gray-500 transition-colors duration-200 dark:hover:text-red-600 dark:text-gray-300 hover:text-red-500 focus:outline-none"
239
+ // >
240
+ // <svg
241
+ // xmlns="http://www.w3.org/2000/svg"
242
+ // fill="none"
243
+ // viewBox="0 0 24 24"
244
+ // stroke-width="1.5"
245
+ // stroke="currentColor"
246
+ // className="w-5 h-5"
247
+ // >
248
+ // <path
249
+ // stroke-linecap="round"
250
+ // stroke-linejoin="round"
251
+ // d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"
252
+ // />
253
+ // </svg>
254
+ // </button>
255
+ // <button
256
+ // onClick={(event) =>
257
+ // handleEditClick(
258
+ // event,
259
+ // "/admin/users/userform?id=",
260
+ // user.id
261
+ // )
262
+ // }
263
+ // className="text-gray-500 transition-colors duration-200 dark:hover:text-yellow-500 dark:text-gray-300 hover:text-yellow-500 focus:outline-none"
264
+ // >
265
+ // <svg
266
+ // xmlns="http://www.w3.org/2000/svg"
267
+ // fill="none"
268
+ // viewBox="0 0 24 24"
269
+ // strokeWidth="1.5"
270
+ // stroke="currentColor"
271
+ // className="w-5 h-5"
272
+ // >
273
+ // <path
274
+ // strokeLinecap="round"
275
+ // strokeLinejoin="round"
276
+ // d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"
277
+ // />
278
+ // </svg>
279
+ // </button>
280
+ // </div>
281
+ // </td>
282
+ // <td className="px-4 py-4 text-sm font-medium text-gray-700 whitespace-nowrap">
283
+ // <div className="inline-flex items-center gap-x-3">
284
+ // <div className="flex items-center gap-x-2">
285
+ // <div>
286
+ // <h2 className=" text-sm font-medium text-gray-800 dark:text-white ">
287
+ // {user.name}
288
+ // </h2>
289
+ // </div>
290
+ // </div>
291
+ // </div>
292
+ // </td>
293
+ // <td className="px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap">
294
+ // {user.email}
295
+ // </td>
296
+ // <td className="px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap">
297
+ // {user.mobile}
298
+ // </td>
299
+ // <td className="px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap">
300
+ // {user.address}
301
+ // </td>
302
+ // <td className="px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap">
303
+ // {user.gender != null
304
+ // ? user.gender === 1
305
+ // ? "Male"
306
+ // : "Female"
307
+ // : "Not Provided"}
308
+ // </td>
309
+ // <td className="px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap">
310
+ // {user.roleType === 1 ? "Guest" : "Admin"}
311
+ // </td>
312
+ // <td className="px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap">
313
+ // {new Date(user.createdOn).toLocaleDateString("en-GB", {
314
+ // day: "2-digit",
315
+ // month: "2-digit",
316
+ // year: "numeric",
317
+ // })}
318
+ // </td>
319
+ // </tr>
320
+ // ))}
321
+ // </tbody>
322
+ // </table>
323
+ // </div>
324
+ // <div className="flex-grow ml-0 mt-4 w-0">
325
+ // <button
326
+ // type="button"
327
+ // onClick={(event) =>
328
+ // handleNavigation(event, "/admin/users/userform")
329
+ // }
330
+ // className="flex items-center justify-center px-6 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-blue-600 rounded-lg hover:bg-blue-500 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-80"
331
+ // >
332
+ // <FaPlus className="mr-2 font-medium" />
333
+ // User
334
+ // </button>
335
+ // </div>
336
+ // <div className="flex items-center justify-between mt-6">
337
+ // <button
338
+ // disabled={currentPage === 1}
339
+ // onClick={() => setCurrentPage((prev) => Math.max(prev - 1, 1))}
340
+ // className="flex items-center px-5 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 bg-white border rounded-md gap-x-2 hover:bg-gray-100 dark:bg-gray-900 dark:text-gray-200 dark:border-gray-700 dark:hover:bg-gray-800"
341
+ // >
342
+ // <svg
343
+ // xmlns="http://www.w3.org/2000/svg"
344
+ // fill="none"
345
+ // viewBox="0 0 24 24"
346
+ // strokeWidth="1.5"
347
+ // stroke="currentColor"
348
+ // className="w-5 h-5 rtl:-scale-x-100"
349
+ // >
350
+ // <path
351
+ // strokeLinecap="round"
352
+ // strokeLinejoin="round"
353
+ // d="M6.75 15.75L3 12m0 0l3.75-3.75M3 12h18"
354
+ // />
355
+ // </svg>
356
+ // <span>Previous</span>
357
+ // </button>
358
+ // <div className="items-center hidden lg:flex gap-x-3">
359
+ // {Array.from({ length: Math.min(10, totalPages) }, (_, index) => {
360
+ // const startPage = Math.max(1, currentPage - 5);
361
+ // const page = startPage + index;
362
+ // if (page > totalPages) return null;
363
+ // return (
364
+ // <button
365
+ // key={page}
366
+ // onClick={() => setCurrentPage(page)}
367
+ // className={`px-2 py-1 text-sm ${
368
+ // currentPage === page
369
+ // ? "text-blue-500 bg-blue-100"
370
+ // : "text-gray-500 hover:bg-gray-100"
371
+ // } rounded-md`}
372
+ // >
373
+ // {page}
374
+ // </button>
375
+ // );
376
+ // })}
377
+ // </div>
378
+ // <button
379
+ // onClick={() =>
380
+ // setCurrentPage((prev) => Math.min(prev + 1, totalPages))
381
+ // }
382
+ // disabled={currentPage === totalPages}
383
+ // className="flex items-center px-5 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 bg-white border rounded-md gap-x-2 hover:bg-gray-100 dark:bg-gray-900 dark:text-gray-200 dark:border-gray-700 dark:hover:bg-gray-800"
384
+ // >
385
+ // <span>Next</span>
386
+ // <svg
387
+ // xmlns="http://www.w3.org/2000/svg"
388
+ // fill="none"
389
+ // viewBox="0 0 24 24"
390
+ // strokeWidth="1.5"
391
+ // stroke="currentColor"
392
+ // className="w-5 h-5 rtl:-scale-x-100"
393
+ // >
394
+ // <path
395
+ // strokeLinecap="round"
396
+ // strokeLinejoin="round"
397
+ // d="M17.25 8.25L21 12m0 0l-3.75 3.75M21 12H3"
398
+ // />
399
+ // </svg>
400
+ // </button>
401
+ // </div>
402
+ // </div>
403
+ // <div className="inset-0 bg-gray-800 bg-opacity-50 z-50 transition-opacity duration-300">
404
+ // <div
405
+ // className={`fixed top-0 right-0 h-full w-[300px] bg-white p-4 rounded-md shadow-lg transform transition-transform duration-500 ease-in-out
406
+ // ${filterModal ? "translate-x-0" : "translate-x-full"}`}
407
+ // >
408
+ // <h1 className="text-2xl md:text-3xl font-bold text-blue-600 mb-4 md:mb-6">
409
+ // Filter
410
+ // </h1>
411
+ // <button
412
+ // onClick={() => setFilterModal(false)}
413
+ // className="absolute top-1 right-3 text-gray-400 hover:text-gray-600 text-2xl"
414
+ // >
415
+ // &times;
416
+ // </button>
417
+ // <div className="flex flex-col">
418
+ // <div className="mb-4 flex flex-col">
419
+ // <label className="block text-gray-700 mb-2">Role Type</label>
420
+ // <div className="w-full">
421
+ // <select
422
+ // value={Number(selectedRoleType)}
423
+ // onChange={handleRoleTypeChange}
424
+ // required
425
+ // className="w-full px-4 py-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring"
426
+ // >
427
+ // <option value="">All</option>
428
+ // <option value="1">Guest</option>
429
+ // <option value="2">Admin</option>
430
+ // </select>
431
+ // </div>
432
+ // </div>
433
+ // <div className="flex flex-row gap-3">
434
+ // <button
435
+ // onClick={resetFilter}
436
+ // className="mt-2 px-4 py-2 bg-blue-500 text-white rounded-md w-32"
437
+ // >
438
+ // Reset
439
+ // </button>
440
+ // </div>
441
+ // </div>
442
+ // </div>
443
+ // </div>
444
+ // </div>
445
+ _jsxs("div", { className: "container px-4 mx-auto mt-6", children: [_jsx("div", { className: "w-full md:w-3/4", children: _jsx("h1", { className: "text-2xl md:text-3xl font-bold text-blue-600 mb-5", children: "Users" }) }), _jsxs("div", { className: "flex flex-col md:flex-row items-center w-full gap-4 md:gap-0", children: [_jsxs("form", { className: "w-full md:flex-grow", onSubmit: handleSearchSubmit, children: [_jsx("label", { htmlFor: "default-search", className: "mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white", children: "Search" }), _jsxs("div", { className: "relative", children: [_jsx("div", { className: "absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none", children: _jsx("svg", { className: "w-4 h-4 text-gray-500 dark:text-gray-400", "aria-hidden": "true", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", children: _jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z" }) }) }), _jsx("input", { type: "search", id: "default-search", className: "w-full p-3 ps-10 outline-none text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500", placeholder: "Search by Name, Email or Mobile", value: searchTerm, onChange: handleSearchChange, required: true }), _jsx("button", { type: "button", className: "text-white absolute end-1.5 bottom-1.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800", children: "Search" })] })] }), _jsx("button", { onClick: () => setFilterModal(true), className: "w-full md:w-auto md:ml-5 text-white bg-blue-700 hover:bg-blue-800 focus:ring-2 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800", "aria-label": "Toggle Menu", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "icon icon-tabler icons-tabler-outline icon-tabler-filter", children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z" })] }) })] }), _jsx("div", { className: "overflow-x-auto mt-6", children: _jsxs("table", { className: "min-w-full divide-y divide-gray-200 dark:divide-gray-700", children: [_jsx("thead", { className: "bg-gray-50 dark:bg-gray-800", children: _jsxs("tr", { children: [_jsx("th", { scope: "col", className: "px-4 py-3.5 text-sm md:text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Actions" }), _jsx("th", { scope: "col", className: "py-3.5 px-4 text-sm md:text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: _jsx("div", { className: "flex items-center gap-x-3", children: _jsx("span", { children: "Name" }) }) }), _jsx("th", { scope: "col", className: "px-4 py-3.5 text-sm md:text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: _jsx("button", { className: "flex items-center gap-x-2", children: _jsx("span", { children: "Email" }) }) }), _jsx("th", { scope: "col", className: "px-4 py-3.5 text-sm md:text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: _jsx("button", { className: "flex items-center gap-x-2", children: _jsx("span", { children: "Mobile" }) }) }), _jsx("th", { scope: "col", className: "px-4 py-3.5 text-sm md:text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Address" }), _jsx("th", { scope: "col", className: "px-4 py-3.5 text-sm md:text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Gender" }), _jsx("th", { scope: "col", className: "px-4 py-3.5 text-sm md:text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Role Type" }), _jsx("th", { scope: "col", className: "px-4 py-3.5 text-sm md:text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Registered On" })] }) }), _jsx("tbody", { className: "bg-white divide-y divide-gray-200 dark:divide-gray-700 dark:bg-gray-900", children: paginatedUsers.map((user, index) => (_jsxs("tr", { children: [_jsx("td", { className: "px-4 py-4 text-sm whitespace-nowrap", children: _jsxs("div", { className: "flex items-center gap-x-6", children: [_jsx("button", { onClick: () => handleDeleteClick(user.id), className: "text-gray-500 transition-colors duration-200 dark:hover:text-red-600 dark:text-gray-300 hover:text-red-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" }) }) }), _jsx("button", { onClick: (event) => handleEditClick(event, "/admin/users/userform?id=", user.id), className: "text-gray-500 transition-colors duration-200 dark:hover:text-yellow-500 dark:text-gray-300 hover:text-yellow-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10" }) }) })] }) }), _jsx("td", { className: "px-4 py-4 text-sm font-medium text-gray-700 whitespace-nowrap", children: _jsx("div", { className: "inline-flex items-center gap-x-3", children: _jsx("div", { className: "flex items-center gap-x-2", children: _jsx("div", { children: _jsx("h2", { className: "text-sm font-medium text-gray-800 dark:text-white", children: user.name }) }) }) }) }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap", children: user.email }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap", children: user.mobile }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap", children: user.address }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap", children: user.gender != null
446
+ ? user.gender === 1
447
+ ? "Male"
448
+ : "Female"
449
+ : "Not Provided" }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap", children: user.roleType === 1 ? "Guest" : "Admin" }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap", children: new Date(user.createdOn).toLocaleDateString("en-GB", {
450
+ day: "2-digit",
451
+ month: "2-digit",
452
+ year: "numeric",
453
+ }) })] }, user.id || index))) })] }) }), _jsx("div", { className: "flex justify-center md:justify-start mt-4", children: _jsxs("button", { type: "button", onClick: (event) => handleNavigation(event, "/admin/users/userform"), className: "flex items-center justify-center px-6 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-blue-600 rounded-lg hover:bg-blue-500 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-80", children: [_jsx(FaPlus, { className: "mr-2 font-medium" }), "User"] }) }), _jsxs("div", { className: "flex flex-col md:flex-row items-center justify-between mt-6 gap-4", children: [_jsxs("button", { disabled: currentPage === 1, onClick: () => setCurrentPage((prev) => Math.max(prev - 1, 1)), className: "flex items-center px-5 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 bg-white border rounded-md gap-x-2 hover:bg-gray-100 dark:bg-gray-900 dark:text-gray-200 dark:border-gray-700 dark:hover:bg-gray-800", children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5 rtl:-scale-x-100", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6.75 15.75L3 12m0 0l3.75-3.75M3 12h18" }) }), _jsx("span", { children: "Previous" })] }), _jsx("div", { className: "flex items-center gap-x-3", children: Array.from({ length: Math.min(10, totalPages) }, (_, index) => {
454
+ const startPage = Math.max(1, currentPage - 5);
455
+ const page = startPage + index;
456
+ if (page > totalPages)
457
+ return null;
458
+ return (_jsx("button", { onClick: () => setCurrentPage(page), className: `px-2 py-1 text-sm ${currentPage === page
459
+ ? "text-blue-500 bg-blue-100"
460
+ : "text-gray-500 hover:bg-gray-100"} rounded-md`, children: page }, page));
461
+ }) }), _jsxs("button", { onClick: () => setCurrentPage((prev) => Math.min(prev + 1, totalPages)), disabled: currentPage === totalPages, className: "flex items-center px-5 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 bg-white border rounded-md gap-x-2 hover:bg-gray-100 dark:bg-gray-900 dark:text-gray-200 dark:border-gray-700 dark:hover:bg-gray-800", children: [_jsx("span", { children: "Next" }), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5 rtl:-scale-x-100", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.25 8.25L21 12m0 0l-3.75 3.75M21 12H3" }) })] })] }), _jsx("div", { className: "inset-0 bg-gray-800 bg-opacity-50 z-50 transition-opacity duration-300", children: _jsxs("div", { className: `fixed top-0 right-0 h-full w-full md:w-[300px] bg-white p-4 rounded-md shadow-lg transform transition-transform duration-500 ease-in-out ${filterModal ? "translate-x-0" : "translate-x-full"}`, children: [_jsx("h1", { className: "text-2xl md:text-3xl font-bold text-blue-600 mb-4 md:mb-6", children: "Filter" }), _jsx("button", { onClick: () => setFilterModal(false), className: "absolute top-1 right-3 text-gray-400 hover:text-gray-600 text-2xl", children: "\u00D7" }), _jsx("div", { className: "flex flex-col", children: _jsxs("div", { className: "mb-4 flex flex-col", children: [_jsx("label", { className: "block text-gray-700 mb-2", children: "Role Type" }), _jsx("div", { className: "w-full", children: _jsxs("select", { value: Number(selectedRoleType), onChange: handleRoleTypeChange, required: true, className: "w-full px-4 py-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", children: [_jsx("option", { value: "", children: "All" }), _jsx("option", { value: "1", children: "Guest" }), _jsx("option", { value: "2", children: "Admin" })] }) })] }) })] }) })] }));
115
462
  };
@@ -1,2 +1,3 @@
1
1
  export { registerApi, loginApi } from "./api";
2
2
  export { getProfileApi, updateProfileApi } from "./updateuser";
3
+ export { addUserApi } from "./user";
@@ -1,2 +1,3 @@
1
1
  export { registerApi, loginApi } from "./api";
2
2
  export { getProfileApi, updateProfileApi } from "./updateuser";
3
+ export { addUserApi } from "./user";
@@ -1,10 +1,10 @@
1
- export declare const addTaxonomyApi: (url: string, type: string, code: number, value: string) => Promise<Axios.AxiosXHR<unknown>>;
1
+ export declare const addTaxonomyApi: (url: string, type: string, code: number, value: string, hiddenforUser: boolean) => Promise<Axios.AxiosXHR<unknown>>;
2
2
  export declare const fetchTaxonomiessApi: (url: string) => Promise<unknown>;
3
3
  export declare const deleteTaxonomyApi: (url: string, id: string) => Promise<{
4
4
  id: string;
5
5
  }>;
6
6
  export declare const fetchTaxonomyByIdApi: (url: string, taxonomyId: string) => Promise<unknown>;
7
- export declare const updateTaxonomyApi: (url: string, id: string, type: string, code: number, value: string) => Promise<unknown>;
7
+ export declare const updateTaxonomyApi: (url: string, id: string, type: string, code: number, value: string, hiddenforUser?: boolean) => Promise<unknown>;
8
8
  export declare const addMultipleTaxonomiesApi: (url: string, taxonomies: {
9
9
  type: string;
10
10
  code: number;
@@ -11,13 +11,14 @@ import axios from "axios";
11
11
  import Cookies from "universal-cookie";
12
12
  const apiUrl = "http://localhost:5260";
13
13
  const cookies = new Cookies();
14
- export const addTaxonomyApi = (url, type, code, value) => __awaiter(void 0, void 0, void 0, function* () {
14
+ export const addTaxonomyApi = (url, type, code, value, hiddenforUser) => __awaiter(void 0, void 0, void 0, function* () {
15
15
  const token = cookies.get("authToken");
16
16
  try {
17
17
  const response = yield axios.post(`${url}/taxonomy/add`, {
18
18
  Type: type,
19
19
  Code: code,
20
20
  Value: value,
21
+ IsHiddenForUser: hiddenforUser
21
22
  }, {
22
23
  headers: {
23
24
  Authorization: `Bearer ${token}`,
@@ -82,7 +83,7 @@ export const fetchTaxonomyByIdApi = (url, taxonomyId) => __awaiter(void 0, void
82
83
  return false;
83
84
  }
84
85
  });
85
- export const updateTaxonomyApi = (url, id, type, code, value) => __awaiter(void 0, void 0, void 0, function* () {
86
+ export const updateTaxonomyApi = (url, id, type, code, value, hiddenforUser) => __awaiter(void 0, void 0, void 0, function* () {
86
87
  const token = cookies.get("authToken");
87
88
  try {
88
89
  const response = yield axios.post(`${url}/taxonomy/updatetaxonomy`, {
@@ -90,6 +91,7 @@ export const updateTaxonomyApi = (url, id, type, code, value) => __awaiter(void
90
91
  Type: type,
91
92
  Code: code,
92
93
  Value: value,
94
+ IsHiddenForUser: hiddenforUser
93
95
  }, {
94
96
  headers: {
95
97
  Authorization: `Bearer ${token}`,
@@ -1,23 +1,4 @@
1
1
  // Exports for components
2
- // export { default as Footer } from "./footer/Footer";
3
- // export { default as Terms } from "./footer/Terms";
4
- // export { default as Privacy } from "./footer/Privacy";
5
- // export { default as Login } from "./login/Login";
6
- // export { default as Header } from "./login/Header";
7
- // // export { default as Users } from "./admin/Users";
8
- // export { default as UserForm } from "./admin/UserForm";
9
- // export { default as Taxionomies } from "./admin/Taxionomies";
10
- // export { default as TaxonomyForm } from "./admin/TaxonomyForm";
11
- // export { default as Template } from "./admin/Template";
12
- // export { default as TemplateFrom } from "./admin/TemplateForm";
13
- // export { default as Editor } from "./admin/Editor";
14
- // export { default as AdminSideBar } from "./admin/Sidebar";
15
- // export { default as Dashboard } from "./admin/Dashboard";
16
- // export { registerApi, loginApi } from "./api/api";
17
- // export { default as userSlice } from "./redux/slices/userSlice";
18
- // export { clearProfileData } from "./redux/slices/userSlice";
19
- // export { getProfileApi, updateProfileApi } from "./api/updateuser";
20
- // export { default as UpdateUserDetails } from "./useraccount/UpdateUserDetails";
21
2
  export { default as Editor } from "./admin/Editor";
22
3
  export * from "./admin/index";
23
4
  export * from "./api/index";
@@ -1,3 +1 @@
1
- // export { default as userSlice } from "./userSlice";
2
- // export { clearProfileData } from "./userSlice";
3
1
  export * from "./userSlice";
package/package.json CHANGED
@@ -1,9 +1,7 @@
1
1
  {
2
2
  "name": "eleven-solutions-common-website-unique-web",
3
- "version": "23.0.18",
3
+ "version": "24.0.0",
4
4
  "main": "./dist/index.js",
5
- "module": "dist/index.esm.js",
6
- "types": "dist/index.d.ts",
7
5
  "files": [
8
6
  "dist"
9
7
  ],