warqadui 0.0.90 → 0.0.92
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 +307 -311
- package/dist/index.mjs +308 -312
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -8084,122 +8084,14 @@ import { useNavigate as useNavigate4, useParams } from "react-router-dom";
|
|
|
8084
8084
|
import { Cable, EllipsisVertical, FilePenLine, Trash2 as Trash22 } from "lucide-react";
|
|
8085
8085
|
import { useState as useState26 } from "react";
|
|
8086
8086
|
import { message as message4 } from "antd";
|
|
8087
|
-
|
|
8088
|
-
// src/components/ErrorPage/ErrorPage.tsx
|
|
8089
|
-
import { jsx as jsx43, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
8090
|
-
var ErrorPageBase = ({
|
|
8091
|
-
title,
|
|
8092
|
-
message: message16,
|
|
8093
|
-
statusCode,
|
|
8094
|
-
action,
|
|
8095
|
-
className = ""
|
|
8096
|
-
}) => {
|
|
8097
|
-
return /* @__PURE__ */ jsx43(
|
|
8098
|
-
"div",
|
|
8099
|
-
{
|
|
8100
|
-
className: `flex-1 m-auto h-full w-full min-h-[50vh] flex flex-col items-center justify-center p-6 text-zinc-900 dark:text-zinc-100 ${className}`,
|
|
8101
|
-
children: /* @__PURE__ */ jsxs33("div", { className: "relative flex flex-col items-center justify-center w-full max-w-2xl text-center", children: [
|
|
8102
|
-
statusCode && /* @__PURE__ */ jsx43("div", { className: "absolute inset-0 flex items-center justify-center z-0 select-none pointer-events-none opacity-[0.03] dark:opacity-5", children: /* @__PURE__ */ jsx43("span", { className: "text-[12rem] sm:text-[16rem] md:text-[20rem] font-bold leading-none tracking-tighter", children: statusCode }) }),
|
|
8103
|
-
/* @__PURE__ */ jsxs33("div", { className: "relative z-10 space-y-6", children: [
|
|
8104
|
-
statusCode && /* @__PURE__ */ jsxs33("h2", { className: "text-xl md:text-2xl font-semibold text-zinc-500 dark:text-zinc-400", children: [
|
|
8105
|
-
"Error ",
|
|
8106
|
-
statusCode
|
|
8107
|
-
] }),
|
|
8108
|
-
title && /* @__PURE__ */ jsx43("h1", { className: "text-4xl md:text-5xl font-extrabold tracking-tight drop-shadow-sm", children: title }),
|
|
8109
|
-
message16 && /* @__PURE__ */ jsx43("p", { className: "text-lg md:text-xl text-zinc-600 dark:text-zinc-400 max-w-md mx-auto", children: message16 }),
|
|
8110
|
-
action && /* @__PURE__ */ jsx43("div", { className: "pt-8", children: /* @__PURE__ */ jsx43(
|
|
8111
|
-
"button",
|
|
8112
|
-
{
|
|
8113
|
-
onClick: action.onClick,
|
|
8114
|
-
className: "px-8 py-3.5 rounded-full text-white font-semibold shadow-[0_4px_14px_0_rgba(0,0,0,0.1)] hover:shadow-[0_6px_20px_rgba(0,0,0,0.15)] transition-all hover:-translate-y-0.5 active:translate-y-0 focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
8115
|
-
style: { backgroundColor: "var(--primary-color, #3b82f6)" },
|
|
8116
|
-
children: action.label
|
|
8117
|
-
}
|
|
8118
|
-
) })
|
|
8119
|
-
] })
|
|
8120
|
-
] })
|
|
8121
|
-
}
|
|
8122
|
-
);
|
|
8123
|
-
};
|
|
8124
|
-
|
|
8125
|
-
// src/components/ErrorPage/ErrorPage.500.tsx
|
|
8126
|
-
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
8127
|
-
var ErrorPage500 = (props) => {
|
|
8128
|
-
return /* @__PURE__ */ jsx44(
|
|
8129
|
-
ErrorPageBase,
|
|
8130
|
-
{
|
|
8131
|
-
statusCode: 500,
|
|
8132
|
-
title: "Internal Server Error",
|
|
8133
|
-
message: "Oops, something went wrong on our end. Please try again later.",
|
|
8134
|
-
action: { label: "Go Home", onClick: () => window.location.href = "/" },
|
|
8135
|
-
...props
|
|
8136
|
-
}
|
|
8137
|
-
);
|
|
8138
|
-
};
|
|
8139
|
-
|
|
8140
|
-
// src/components/ErrorPage/ErrorPage.404.tsx
|
|
8141
|
-
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
8142
|
-
var ErrorPage404 = (props) => {
|
|
8143
|
-
return /* @__PURE__ */ jsx45(
|
|
8144
|
-
ErrorPageBase,
|
|
8145
|
-
{
|
|
8146
|
-
statusCode: 404,
|
|
8147
|
-
title: "Page Not Found",
|
|
8148
|
-
message: "The page you are looking for doesn't exist or has been moved.",
|
|
8149
|
-
action: { label: "Go Home", onClick: () => window.location.href = "/" },
|
|
8150
|
-
...props
|
|
8151
|
-
}
|
|
8152
|
-
);
|
|
8153
|
-
};
|
|
8154
|
-
|
|
8155
|
-
// src/components/ErrorPage/ErrorPage.401.tsx
|
|
8156
|
-
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
8157
|
-
var ErrorPage401 = (props) => {
|
|
8158
|
-
return /* @__PURE__ */ jsx46(
|
|
8159
|
-
ErrorPageBase,
|
|
8160
|
-
{
|
|
8161
|
-
statusCode: 401,
|
|
8162
|
-
title: "Unauthorized",
|
|
8163
|
-
message: "You don't have permission to access this page.",
|
|
8164
|
-
action: { label: "Go Home", onClick: () => window.location.href = "/" },
|
|
8165
|
-
...props
|
|
8166
|
-
}
|
|
8167
|
-
);
|
|
8168
|
-
};
|
|
8169
|
-
|
|
8170
|
-
// src/components/ErrorPage/ErrorPage.400.tsx
|
|
8171
|
-
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
8172
|
-
var ErrorPage400 = (props) => {
|
|
8173
|
-
return /* @__PURE__ */ jsx47(
|
|
8174
|
-
ErrorPageBase,
|
|
8175
|
-
{
|
|
8176
|
-
statusCode: 400,
|
|
8177
|
-
title: "Bad Request",
|
|
8178
|
-
message: "Your request could not be processed. Please try again.",
|
|
8179
|
-
action: { label: "Go Home", onClick: () => window.location.href = "/" },
|
|
8180
|
-
...props
|
|
8181
|
-
}
|
|
8182
|
-
);
|
|
8183
|
-
};
|
|
8184
|
-
|
|
8185
|
-
// src/components/ErrorPage/index.ts
|
|
8186
|
-
var ErrorPage = Object.assign(ErrorPageBase, {
|
|
8187
|
-
500: ErrorPage500,
|
|
8188
|
-
404: ErrorPage404,
|
|
8189
|
-
401: ErrorPage401,
|
|
8190
|
-
400: ErrorPage400
|
|
8191
|
-
});
|
|
8192
|
-
|
|
8193
|
-
// src/components/accounts/Accounts.tsx
|
|
8194
|
-
import { Fragment as Fragment9, jsx as jsx48, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
8195
|
-
var ErrorPage5002 = ErrorPage[500];
|
|
8087
|
+
import { Fragment as Fragment9, jsx as jsx43, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
8196
8088
|
function Accounts({ v, url }) {
|
|
8197
8089
|
const { enums } = useWarqadConfig();
|
|
8198
8090
|
const { branchId } = useParams();
|
|
8199
8091
|
const navigate = useNavigate4();
|
|
8200
8092
|
const { type } = useParams();
|
|
8201
8093
|
if (!enums.accountTypes.includes(type)) {
|
|
8202
|
-
|
|
8094
|
+
navigate(-1);
|
|
8203
8095
|
}
|
|
8204
8096
|
const [deleteAccount, setDeleteAccount] = useState26(null);
|
|
8205
8097
|
const { isLoading, remove } = useApis_default();
|
|
@@ -8213,17 +8105,17 @@ function Accounts({ v, url }) {
|
|
|
8213
8105
|
const items = (data2) => [
|
|
8214
8106
|
{
|
|
8215
8107
|
label: `Edit ${type}`,
|
|
8216
|
-
icon: /* @__PURE__ */
|
|
8108
|
+
icon: /* @__PURE__ */ jsx43(FilePenLine, { size: 16 }),
|
|
8217
8109
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
8218
8110
|
},
|
|
8219
8111
|
{
|
|
8220
8112
|
label: `Delete ${type}`,
|
|
8221
|
-
icon: /* @__PURE__ */
|
|
8113
|
+
icon: /* @__PURE__ */ jsx43(Trash22, { className: "text-red-500", size: 16 }),
|
|
8222
8114
|
onClick: () => setDeleteAccount(data2)
|
|
8223
8115
|
},
|
|
8224
8116
|
isEmployee && !data2?.user && {
|
|
8225
8117
|
label: `Link User`,
|
|
8226
|
-
icon: /* @__PURE__ */
|
|
8118
|
+
icon: /* @__PURE__ */ jsx43(Cable, { size: 16 }),
|
|
8227
8119
|
onClick: () => navigate(`link-user?id=${data2?._id}`)
|
|
8228
8120
|
}
|
|
8229
8121
|
].filter(Boolean);
|
|
@@ -8233,7 +8125,7 @@ function Accounts({ v, url }) {
|
|
|
8233
8125
|
header: "Name",
|
|
8234
8126
|
cell: ({ row }) => {
|
|
8235
8127
|
const account = row.original;
|
|
8236
|
-
return /* @__PURE__ */
|
|
8128
|
+
return /* @__PURE__ */ jsx43("span", { children: account?.name });
|
|
8237
8129
|
}
|
|
8238
8130
|
},
|
|
8239
8131
|
{
|
|
@@ -8241,7 +8133,7 @@ function Accounts({ v, url }) {
|
|
|
8241
8133
|
header: "Sex",
|
|
8242
8134
|
cell: ({ row }) => {
|
|
8243
8135
|
const account = row.original;
|
|
8244
|
-
return /* @__PURE__ */
|
|
8136
|
+
return /* @__PURE__ */ jsx43("span", { children: account?.sex });
|
|
8245
8137
|
}
|
|
8246
8138
|
},
|
|
8247
8139
|
{
|
|
@@ -8249,7 +8141,7 @@ function Accounts({ v, url }) {
|
|
|
8249
8141
|
header: "Email",
|
|
8250
8142
|
cell: ({ row }) => {
|
|
8251
8143
|
const account = row.original;
|
|
8252
|
-
return /* @__PURE__ */
|
|
8144
|
+
return /* @__PURE__ */ jsx43("span", { children: account?.email || "N/A" });
|
|
8253
8145
|
}
|
|
8254
8146
|
},
|
|
8255
8147
|
{
|
|
@@ -8257,7 +8149,7 @@ function Accounts({ v, url }) {
|
|
|
8257
8149
|
header: "Phone",
|
|
8258
8150
|
cell: ({ row }) => {
|
|
8259
8151
|
const account = row.original;
|
|
8260
|
-
return /* @__PURE__ */
|
|
8152
|
+
return /* @__PURE__ */ jsx43("span", { children: account?.phoneNumber || "N/A" });
|
|
8261
8153
|
}
|
|
8262
8154
|
},
|
|
8263
8155
|
isEmployee && {
|
|
@@ -8265,7 +8157,7 @@ function Accounts({ v, url }) {
|
|
|
8265
8157
|
header: "User",
|
|
8266
8158
|
cell: ({ row }) => {
|
|
8267
8159
|
const account = row.original;
|
|
8268
|
-
return /* @__PURE__ */
|
|
8160
|
+
return /* @__PURE__ */ jsx43(Badge, { variant: account?.user ? "success" : "danger", size: "sm", children: account?.user ? "Linked" : "Not Linked" });
|
|
8269
8161
|
}
|
|
8270
8162
|
},
|
|
8271
8163
|
{
|
|
@@ -8273,13 +8165,13 @@ function Accounts({ v, url }) {
|
|
|
8273
8165
|
header: "Actions",
|
|
8274
8166
|
cell: ({ row }) => {
|
|
8275
8167
|
const data2 = row.original;
|
|
8276
|
-
return /* @__PURE__ */
|
|
8168
|
+
return /* @__PURE__ */ jsx43(
|
|
8277
8169
|
Dropdown,
|
|
8278
8170
|
{
|
|
8279
8171
|
className: "cursor-pointer w-[150px]",
|
|
8280
8172
|
items: items(data2),
|
|
8281
8173
|
triggerMode: "hover",
|
|
8282
|
-
children: /* @__PURE__ */
|
|
8174
|
+
children: /* @__PURE__ */ jsx43(EllipsisVertical, {})
|
|
8283
8175
|
}
|
|
8284
8176
|
);
|
|
8285
8177
|
}
|
|
@@ -8297,9 +8189,9 @@ function Accounts({ v, url }) {
|
|
|
8297
8189
|
return error;
|
|
8298
8190
|
}
|
|
8299
8191
|
};
|
|
8300
|
-
return /* @__PURE__ */
|
|
8301
|
-
/* @__PURE__ */
|
|
8302
|
-
/* @__PURE__ */
|
|
8192
|
+
return /* @__PURE__ */ jsxs33(Fragment9, { children: [
|
|
8193
|
+
/* @__PURE__ */ jsx43(Modal2, {}),
|
|
8194
|
+
/* @__PURE__ */ jsx43(
|
|
8303
8195
|
ConfirmModal,
|
|
8304
8196
|
{
|
|
8305
8197
|
isOpen: !!deleteAccount,
|
|
@@ -8312,7 +8204,7 @@ function Accounts({ v, url }) {
|
|
|
8312
8204
|
children: null
|
|
8313
8205
|
}
|
|
8314
8206
|
),
|
|
8315
|
-
/* @__PURE__ */
|
|
8207
|
+
/* @__PURE__ */ jsx43(
|
|
8316
8208
|
TransactionViewComponent,
|
|
8317
8209
|
{
|
|
8318
8210
|
columns,
|
|
@@ -8405,7 +8297,7 @@ var Formats_default = Formats;
|
|
|
8405
8297
|
|
|
8406
8298
|
// src/hooks/useAccountBalance.tsx
|
|
8407
8299
|
import { useEffect as useEffect19, useState as useState27 } from "react";
|
|
8408
|
-
import { jsx as
|
|
8300
|
+
import { jsx as jsx44, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
8409
8301
|
var useAccountbalance = ({
|
|
8410
8302
|
url,
|
|
8411
8303
|
showBalance,
|
|
@@ -8439,15 +8331,15 @@ var useAccountbalance = ({
|
|
|
8439
8331
|
return null;
|
|
8440
8332
|
}
|
|
8441
8333
|
if (isLoading) {
|
|
8442
|
-
return /* @__PURE__ */
|
|
8334
|
+
return /* @__PURE__ */ jsx44("h2", { className: "text-gray-500", children: "Getting Balance..." });
|
|
8443
8335
|
}
|
|
8444
8336
|
if (error) {
|
|
8445
|
-
return /* @__PURE__ */
|
|
8337
|
+
return /* @__PURE__ */ jsxs34("h2", { className: "text-red-500", children: [
|
|
8446
8338
|
"Error: ",
|
|
8447
8339
|
error
|
|
8448
8340
|
] });
|
|
8449
8341
|
}
|
|
8450
|
-
return /* @__PURE__ */
|
|
8342
|
+
return /* @__PURE__ */ jsxs34(
|
|
8451
8343
|
"h2",
|
|
8452
8344
|
{
|
|
8453
8345
|
className: `${balance.startsWith("-") ? "text-red-500" : "text-green-500"}`,
|
|
@@ -8464,7 +8356,7 @@ var useAccountBalance_default = useAccountbalance;
|
|
|
8464
8356
|
|
|
8465
8357
|
// src/components/accounts/Feilds/Account.tsx
|
|
8466
8358
|
import { useParams as useParams3 } from "react-router-dom";
|
|
8467
|
-
import { jsx as
|
|
8359
|
+
import { jsx as jsx45, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
8468
8360
|
function Account({
|
|
8469
8361
|
name,
|
|
8470
8362
|
label,
|
|
@@ -8484,8 +8376,8 @@ function Account({
|
|
|
8484
8376
|
showBalance,
|
|
8485
8377
|
accountId
|
|
8486
8378
|
});
|
|
8487
|
-
return /* @__PURE__ */
|
|
8488
|
-
/* @__PURE__ */
|
|
8379
|
+
return /* @__PURE__ */ jsxs35("div", { className: "flex flex-col gap-2", children: [
|
|
8380
|
+
/* @__PURE__ */ jsx45(
|
|
8489
8381
|
Fields_default.SearchApi,
|
|
8490
8382
|
{
|
|
8491
8383
|
name,
|
|
@@ -8502,13 +8394,13 @@ function Account({
|
|
|
8502
8394
|
disabled
|
|
8503
8395
|
}
|
|
8504
8396
|
),
|
|
8505
|
-
/* @__PURE__ */
|
|
8397
|
+
/* @__PURE__ */ jsx45(BalanceView, {})
|
|
8506
8398
|
] });
|
|
8507
8399
|
}
|
|
8508
8400
|
var Account_default = Account;
|
|
8509
8401
|
|
|
8510
8402
|
// src/components/accounts/Feilds/Customers.tsx
|
|
8511
|
-
import { jsx as
|
|
8403
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
8512
8404
|
function Customer({
|
|
8513
8405
|
name = "customer",
|
|
8514
8406
|
label = "Customer",
|
|
@@ -8521,7 +8413,7 @@ function Customer({
|
|
|
8521
8413
|
disabled,
|
|
8522
8414
|
v
|
|
8523
8415
|
}) {
|
|
8524
|
-
return /* @__PURE__ */
|
|
8416
|
+
return /* @__PURE__ */ jsx46(
|
|
8525
8417
|
Account_default,
|
|
8526
8418
|
{
|
|
8527
8419
|
name,
|
|
@@ -8540,7 +8432,7 @@ function Customer({
|
|
|
8540
8432
|
var Customers_default = Customer;
|
|
8541
8433
|
|
|
8542
8434
|
// src/components/accounts/Feilds/Employee.tsx
|
|
8543
|
-
import { jsx as
|
|
8435
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
8544
8436
|
function Employee({
|
|
8545
8437
|
name = "employee",
|
|
8546
8438
|
label = "Employee",
|
|
@@ -8553,7 +8445,7 @@ function Employee({
|
|
|
8553
8445
|
disabled,
|
|
8554
8446
|
v
|
|
8555
8447
|
}) {
|
|
8556
|
-
return /* @__PURE__ */
|
|
8448
|
+
return /* @__PURE__ */ jsx47(
|
|
8557
8449
|
Account_default,
|
|
8558
8450
|
{
|
|
8559
8451
|
name,
|
|
@@ -8572,7 +8464,7 @@ function Employee({
|
|
|
8572
8464
|
var Employee_default = Employee;
|
|
8573
8465
|
|
|
8574
8466
|
// src/components/accounts/Feilds/Branches.tsx
|
|
8575
|
-
import { jsx as
|
|
8467
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
8576
8468
|
function Branches({
|
|
8577
8469
|
name = "branch",
|
|
8578
8470
|
label = "Branch",
|
|
@@ -8585,7 +8477,7 @@ function Branches({
|
|
|
8585
8477
|
v,
|
|
8586
8478
|
disabled
|
|
8587
8479
|
}) {
|
|
8588
|
-
return /* @__PURE__ */
|
|
8480
|
+
return /* @__PURE__ */ jsx48(
|
|
8589
8481
|
Account_default,
|
|
8590
8482
|
{
|
|
8591
8483
|
name,
|
|
@@ -8614,8 +8506,7 @@ var Feilds_default = AccountFields;
|
|
|
8614
8506
|
|
|
8615
8507
|
// src/components/accounts/AccountForm.tsx
|
|
8616
8508
|
import { useParams as useParams4 } from "react-router-dom";
|
|
8617
|
-
import { jsx as
|
|
8618
|
-
var ErrorPage5003 = ErrorPage[500];
|
|
8509
|
+
import { jsx as jsx49, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
8619
8510
|
function AccountForm() {
|
|
8620
8511
|
const { enums } = useWarqadConfig();
|
|
8621
8512
|
const { branchId } = useParams4();
|
|
@@ -8624,7 +8515,7 @@ function AccountForm() {
|
|
|
8624
8515
|
const type = getParams("type");
|
|
8625
8516
|
const isEdit = !!id;
|
|
8626
8517
|
if (!enums.accountTypes.includes(type)) {
|
|
8627
|
-
|
|
8518
|
+
navigate(-1);
|
|
8628
8519
|
}
|
|
8629
8520
|
const { post, put, isLoading } = useApis_default();
|
|
8630
8521
|
const { isLoading: isLoadingGet, get } = useApis_default();
|
|
@@ -8679,24 +8570,24 @@ function AccountForm() {
|
|
|
8679
8570
|
fetches();
|
|
8680
8571
|
}
|
|
8681
8572
|
}, [id]);
|
|
8682
|
-
return /* @__PURE__ */
|
|
8573
|
+
return /* @__PURE__ */ jsxs36(
|
|
8683
8574
|
Card,
|
|
8684
8575
|
{
|
|
8685
8576
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
8686
8577
|
isLoading: isLoadingGet,
|
|
8687
8578
|
loadingText: "Processing...",
|
|
8688
8579
|
children: [
|
|
8689
|
-
/* @__PURE__ */
|
|
8690
|
-
/* @__PURE__ */
|
|
8691
|
-
/* @__PURE__ */
|
|
8580
|
+
/* @__PURE__ */ jsxs36(Card.Header, { children: [
|
|
8581
|
+
/* @__PURE__ */ jsx49(Card.Title, { children: `${isEdit ? "Edit" : "Add"} ${type}` }),
|
|
8582
|
+
/* @__PURE__ */ jsx49(Card.Description, { children: isEdit ? `Update the details for this ${type}` : `Create a new ${type} and add it to your list` })
|
|
8692
8583
|
] }),
|
|
8693
|
-
/* @__PURE__ */
|
|
8584
|
+
/* @__PURE__ */ jsx49(Card.Content, { children: /* @__PURE__ */ jsxs36(
|
|
8694
8585
|
"form",
|
|
8695
8586
|
{
|
|
8696
8587
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
8697
8588
|
children: [
|
|
8698
|
-
/* @__PURE__ */
|
|
8699
|
-
/* @__PURE__ */
|
|
8589
|
+
/* @__PURE__ */ jsxs36("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
8590
|
+
/* @__PURE__ */ jsx49(
|
|
8700
8591
|
Fields_default.Input,
|
|
8701
8592
|
{
|
|
8702
8593
|
label: "Name",
|
|
@@ -8707,7 +8598,7 @@ function AccountForm() {
|
|
|
8707
8598
|
required: true
|
|
8708
8599
|
}
|
|
8709
8600
|
),
|
|
8710
|
-
/* @__PURE__ */
|
|
8601
|
+
/* @__PURE__ */ jsx49(
|
|
8711
8602
|
Fields_default.Select,
|
|
8712
8603
|
{
|
|
8713
8604
|
label: "Sex",
|
|
@@ -8716,7 +8607,7 @@ function AccountForm() {
|
|
|
8716
8607
|
enumName: "sex"
|
|
8717
8608
|
}
|
|
8718
8609
|
),
|
|
8719
|
-
/* @__PURE__ */
|
|
8610
|
+
/* @__PURE__ */ jsx49(
|
|
8720
8611
|
Fields_default.Input,
|
|
8721
8612
|
{
|
|
8722
8613
|
label: "Email",
|
|
@@ -8726,7 +8617,7 @@ function AccountForm() {
|
|
|
8726
8617
|
placeholder: "e.g maoo@exapmle.com"
|
|
8727
8618
|
}
|
|
8728
8619
|
),
|
|
8729
|
-
/* @__PURE__ */
|
|
8620
|
+
/* @__PURE__ */ jsx49(
|
|
8730
8621
|
Fields_default.PhoneInput,
|
|
8731
8622
|
{
|
|
8732
8623
|
label: "Phone Number",
|
|
@@ -8735,7 +8626,7 @@ function AccountForm() {
|
|
|
8735
8626
|
placeholder: "Enter phone number"
|
|
8736
8627
|
}
|
|
8737
8628
|
),
|
|
8738
|
-
!branchId && /* @__PURE__ */
|
|
8629
|
+
!branchId && /* @__PURE__ */ jsx49(
|
|
8739
8630
|
Feilds_default.Branches,
|
|
8740
8631
|
{
|
|
8741
8632
|
label: "Branch",
|
|
@@ -8746,7 +8637,7 @@ function AccountForm() {
|
|
|
8746
8637
|
}
|
|
8747
8638
|
)
|
|
8748
8639
|
] }),
|
|
8749
|
-
/* @__PURE__ */
|
|
8640
|
+
/* @__PURE__ */ jsx49("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx49(
|
|
8750
8641
|
Button,
|
|
8751
8642
|
{
|
|
8752
8643
|
isLoading,
|
|
@@ -8805,7 +8696,7 @@ import { useForm as useForm3 } from "react-hook-form";
|
|
|
8805
8696
|
import { zodResolver as zodResolver3 } from "@hookform/resolvers/zod";
|
|
8806
8697
|
import { message as message6 } from "antd";
|
|
8807
8698
|
import { useEffect as useEffect21 } from "react";
|
|
8808
|
-
import { jsx as
|
|
8699
|
+
import { jsx as jsx50, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
8809
8700
|
function LinkUser({ type: initialType = "employee" }) {
|
|
8810
8701
|
const { getQuery, navigate, getParams } = useApp_default();
|
|
8811
8702
|
const id = getQuery("id");
|
|
@@ -8861,26 +8752,26 @@ function LinkUser({ type: initialType = "employee" }) {
|
|
|
8861
8752
|
navigate(-1);
|
|
8862
8753
|
}
|
|
8863
8754
|
}, [id]);
|
|
8864
|
-
return /* @__PURE__ */
|
|
8755
|
+
return /* @__PURE__ */ jsxs37(
|
|
8865
8756
|
Card,
|
|
8866
8757
|
{
|
|
8867
8758
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
8868
8759
|
isLoading: isLoadingGet,
|
|
8869
8760
|
loadingText: "Processing...",
|
|
8870
8761
|
children: [
|
|
8871
|
-
/* @__PURE__ */
|
|
8872
|
-
/* @__PURE__ */
|
|
8873
|
-
/* @__PURE__ */
|
|
8762
|
+
/* @__PURE__ */ jsxs37(Card.Header, { children: [
|
|
8763
|
+
/* @__PURE__ */ jsx50(Card.Title, { children: `Link User ` }),
|
|
8764
|
+
/* @__PURE__ */ jsx50(Card.Description, { children: "Link User Employee and add it to your list" })
|
|
8874
8765
|
] }),
|
|
8875
|
-
/* @__PURE__ */
|
|
8766
|
+
/* @__PURE__ */ jsx50(Card.Content, { children: /* @__PURE__ */ jsxs37(
|
|
8876
8767
|
"form",
|
|
8877
8768
|
{
|
|
8878
8769
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
8879
8770
|
className: "space-y-4",
|
|
8880
8771
|
children: [
|
|
8881
|
-
/* @__PURE__ */
|
|
8772
|
+
/* @__PURE__ */ jsxs37("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
8882
8773
|
" ",
|
|
8883
|
-
/* @__PURE__ */
|
|
8774
|
+
/* @__PURE__ */ jsx50(
|
|
8884
8775
|
Fields_default.Input,
|
|
8885
8776
|
{
|
|
8886
8777
|
label: "Name",
|
|
@@ -8891,7 +8782,7 @@ function LinkUser({ type: initialType = "employee" }) {
|
|
|
8891
8782
|
disabled: true
|
|
8892
8783
|
}
|
|
8893
8784
|
),
|
|
8894
|
-
/* @__PURE__ */
|
|
8785
|
+
/* @__PURE__ */ jsx50(
|
|
8895
8786
|
Fields_default.Input,
|
|
8896
8787
|
{
|
|
8897
8788
|
label: "Email",
|
|
@@ -8902,7 +8793,7 @@ function LinkUser({ type: initialType = "employee" }) {
|
|
|
8902
8793
|
required: true
|
|
8903
8794
|
}
|
|
8904
8795
|
),
|
|
8905
|
-
/* @__PURE__ */
|
|
8796
|
+
/* @__PURE__ */ jsx50(
|
|
8906
8797
|
Fields_default.Select,
|
|
8907
8798
|
{
|
|
8908
8799
|
label: "Role",
|
|
@@ -8913,7 +8804,7 @@ function LinkUser({ type: initialType = "employee" }) {
|
|
|
8913
8804
|
}
|
|
8914
8805
|
)
|
|
8915
8806
|
] }),
|
|
8916
|
-
/* @__PURE__ */
|
|
8807
|
+
/* @__PURE__ */ jsx50("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx50(
|
|
8917
8808
|
Button,
|
|
8918
8809
|
{
|
|
8919
8810
|
isLoading,
|
|
@@ -8942,7 +8833,7 @@ import { useForm as useForm4 } from "react-hook-form";
|
|
|
8942
8833
|
import { zodResolver as zodResolver4 } from "@hookform/resolvers/zod";
|
|
8943
8834
|
import { message as message7, Statistic } from "antd";
|
|
8944
8835
|
import { useState as useState28, useEffect as useEffect22 } from "react";
|
|
8945
|
-
import { jsx as
|
|
8836
|
+
import { jsx as jsx51, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
8946
8837
|
var { Countdown } = Statistic;
|
|
8947
8838
|
function VerifyEmailForm({
|
|
8948
8839
|
data,
|
|
@@ -9010,9 +8901,9 @@ function VerifyEmailForm({
|
|
|
9010
8901
|
message7.error(error?.message || "Something went wrong");
|
|
9011
8902
|
}
|
|
9012
8903
|
};
|
|
9013
|
-
return /* @__PURE__ */
|
|
9014
|
-
/* @__PURE__ */
|
|
9015
|
-
oldEmail && /* @__PURE__ */
|
|
8904
|
+
return /* @__PURE__ */ jsxs38("form", { onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)), children: [
|
|
8905
|
+
/* @__PURE__ */ jsxs38("div", { className: "space-y-2", children: [
|
|
8906
|
+
oldEmail && /* @__PURE__ */ jsx51("div", { className: "border-b-2 pb-2", children: /* @__PURE__ */ jsx51(
|
|
9016
8907
|
Fields_default.Input,
|
|
9017
8908
|
{
|
|
9018
8909
|
label: "Current Email",
|
|
@@ -9022,7 +8913,7 @@ function VerifyEmailForm({
|
|
|
9022
8913
|
disabled: true
|
|
9023
8914
|
}
|
|
9024
8915
|
) }),
|
|
9025
|
-
/* @__PURE__ */
|
|
8916
|
+
/* @__PURE__ */ jsx51(
|
|
9026
8917
|
Fields_default.Input,
|
|
9027
8918
|
{
|
|
9028
8919
|
label: "New Email",
|
|
@@ -9033,7 +8924,7 @@ function VerifyEmailForm({
|
|
|
9033
8924
|
disabled: true
|
|
9034
8925
|
}
|
|
9035
8926
|
),
|
|
9036
|
-
/* @__PURE__ */
|
|
8927
|
+
/* @__PURE__ */ jsx51(
|
|
9037
8928
|
Fields_default.Input,
|
|
9038
8929
|
{
|
|
9039
8930
|
label: "Token",
|
|
@@ -9044,19 +8935,19 @@ function VerifyEmailForm({
|
|
|
9044
8935
|
}
|
|
9045
8936
|
)
|
|
9046
8937
|
] }),
|
|
9047
|
-
/* @__PURE__ */
|
|
9048
|
-
/* @__PURE__ */
|
|
8938
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-2 mt-2", children: [
|
|
8939
|
+
/* @__PURE__ */ jsxs38("h1", { className: "text-sm text-gray-600 dark:text-gray-400", children: [
|
|
9049
8940
|
"Didn't receive a verification token or expired?",
|
|
9050
8941
|
" "
|
|
9051
8942
|
] }),
|
|
9052
|
-
hasPassed || !threeMinutesLater ? /* @__PURE__ */
|
|
8943
|
+
hasPassed || !threeMinutesLater ? /* @__PURE__ */ jsx51(
|
|
9053
8944
|
"span",
|
|
9054
8945
|
{
|
|
9055
8946
|
onClick: resend,
|
|
9056
8947
|
className: "text-blue-600 cursor-pointer underline text-sm",
|
|
9057
8948
|
children: "Resend"
|
|
9058
8949
|
}
|
|
9059
|
-
) : /* @__PURE__ */
|
|
8950
|
+
) : /* @__PURE__ */ jsx51("span", { className: "text-blue-600 cursor-pointer underline text-sm", children: /* @__PURE__ */ jsx51(
|
|
9060
8951
|
Countdown,
|
|
9061
8952
|
{
|
|
9062
8953
|
styles: { content: { fontSize: 14, color: "#3b82f6" } },
|
|
@@ -9066,7 +8957,7 @@ function VerifyEmailForm({
|
|
|
9066
8957
|
threeMinutesLater
|
|
9067
8958
|
) })
|
|
9068
8959
|
] }),
|
|
9069
|
-
/* @__PURE__ */
|
|
8960
|
+
/* @__PURE__ */ jsx51("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx51(
|
|
9070
8961
|
Button,
|
|
9071
8962
|
{
|
|
9072
8963
|
isLoading,
|
|
@@ -9084,7 +8975,7 @@ var VerifyEmailForm_default = VerifyEmailForm;
|
|
|
9084
8975
|
import { useForm as useForm5 } from "react-hook-form";
|
|
9085
8976
|
import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
|
|
9086
8977
|
import { message as message8 } from "antd";
|
|
9087
|
-
import { jsx as
|
|
8978
|
+
import { jsx as jsx52, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
9088
8979
|
function UpdateEmailForm({
|
|
9089
8980
|
data,
|
|
9090
8981
|
close,
|
|
@@ -9117,9 +9008,9 @@ function UpdateEmailForm({
|
|
|
9117
9008
|
message8.error(error?.message || "Something went wrong");
|
|
9118
9009
|
}
|
|
9119
9010
|
};
|
|
9120
|
-
return /* @__PURE__ */
|
|
9121
|
-
/* @__PURE__ */
|
|
9122
|
-
/* @__PURE__ */
|
|
9011
|
+
return /* @__PURE__ */ jsxs39("form", { onSubmit: handleSubmit(onSubmit), children: [
|
|
9012
|
+
/* @__PURE__ */ jsxs39("div", { className: "space-y-4", children: [
|
|
9013
|
+
/* @__PURE__ */ jsx52(
|
|
9123
9014
|
Fields_default.Input,
|
|
9124
9015
|
{
|
|
9125
9016
|
label: "Current Email",
|
|
@@ -9128,7 +9019,7 @@ function UpdateEmailForm({
|
|
|
9128
9019
|
disabled: true
|
|
9129
9020
|
}
|
|
9130
9021
|
),
|
|
9131
|
-
/* @__PURE__ */
|
|
9022
|
+
/* @__PURE__ */ jsx52(
|
|
9132
9023
|
Fields_default.Input,
|
|
9133
9024
|
{
|
|
9134
9025
|
label: "New Email Address",
|
|
@@ -9139,10 +9030,10 @@ function UpdateEmailForm({
|
|
|
9139
9030
|
required: true
|
|
9140
9031
|
}
|
|
9141
9032
|
),
|
|
9142
|
-
/* @__PURE__ */
|
|
9033
|
+
/* @__PURE__ */ jsx52("div", { className: "bg-blue-50 dark:bg-blue-900/10 border-l-4 border-blue-400 p-3 rounded", children: /* @__PURE__ */ jsx52("p", { className: "text-xs text-blue-700 dark:text-blue-400", children: "Note: You will need to verify the new email address before it becomes primary." }) })
|
|
9143
9034
|
] }),
|
|
9144
|
-
/* @__PURE__ */
|
|
9145
|
-
/* @__PURE__ */
|
|
9035
|
+
/* @__PURE__ */ jsxs39("footer", { className: "flex justify-end mt-6 gap-3", children: [
|
|
9036
|
+
/* @__PURE__ */ jsx52(
|
|
9146
9037
|
Button,
|
|
9147
9038
|
{
|
|
9148
9039
|
type: "button",
|
|
@@ -9152,7 +9043,7 @@ function UpdateEmailForm({
|
|
|
9152
9043
|
children: "Cancel"
|
|
9153
9044
|
}
|
|
9154
9045
|
),
|
|
9155
|
-
/* @__PURE__ */
|
|
9046
|
+
/* @__PURE__ */ jsx52(
|
|
9156
9047
|
Button,
|
|
9157
9048
|
{
|
|
9158
9049
|
isLoading,
|
|
@@ -9171,7 +9062,7 @@ var UpdateEmailForm_default = UpdateEmailForm;
|
|
|
9171
9062
|
import { useForm as useForm6 } from "react-hook-form";
|
|
9172
9063
|
import { message as message9, Statistic as Statistic2 } from "antd";
|
|
9173
9064
|
import { useState as useState29, useEffect as useEffect23 } from "react";
|
|
9174
|
-
import { jsx as
|
|
9065
|
+
import { jsx as jsx53, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
9175
9066
|
var { Countdown: Countdown2 } = Statistic2;
|
|
9176
9067
|
function ResetPasswordForm({
|
|
9177
9068
|
data,
|
|
@@ -9226,9 +9117,9 @@ function ResetPasswordForm({
|
|
|
9226
9117
|
message9.error(error?.message || "Something went wrong");
|
|
9227
9118
|
}
|
|
9228
9119
|
};
|
|
9229
|
-
return /* @__PURE__ */
|
|
9230
|
-
/* @__PURE__ */
|
|
9231
|
-
/* @__PURE__ */
|
|
9120
|
+
return /* @__PURE__ */ jsxs40("form", { onSubmit: handleSubmit(onSubmit), children: [
|
|
9121
|
+
/* @__PURE__ */ jsxs40("div", { className: "space-y-4", children: [
|
|
9122
|
+
/* @__PURE__ */ jsx53("div", { className: "border-b-2 pb-4 dark:border-zinc-800", children: /* @__PURE__ */ jsx53(
|
|
9232
9123
|
Fields_default.Input,
|
|
9233
9124
|
{
|
|
9234
9125
|
label: "Target Email",
|
|
@@ -9237,10 +9128,10 @@ function ResetPasswordForm({
|
|
|
9237
9128
|
disabled: true
|
|
9238
9129
|
}
|
|
9239
9130
|
) }),
|
|
9240
|
-
/* @__PURE__ */
|
|
9241
|
-
!hasPassed && threeMinutesLater && /* @__PURE__ */
|
|
9242
|
-
/* @__PURE__ */
|
|
9243
|
-
/* @__PURE__ */
|
|
9131
|
+
/* @__PURE__ */ jsx53("div", { className: "bg-orange-50 dark:bg-orange-900/10 border-l-4 border-orange-400 p-4 rounded-xl", children: /* @__PURE__ */ jsx53("p", { className: "text-sm text-orange-700 dark:text-orange-300", children: "Click context below to send a secure password reset link to this user." }) }),
|
|
9132
|
+
!hasPassed && threeMinutesLater && /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-2 mt-2 bg-blue-50 dark:bg-blue-900/10 p-2 rounded-lg", children: [
|
|
9133
|
+
/* @__PURE__ */ jsx53("p", { className: "text-xs text-blue-600 dark:text-blue-400 font-medium", children: "You can request another link in:" }),
|
|
9134
|
+
/* @__PURE__ */ jsx53("span", { className: "text-blue-600 font-bold text-xs", children: /* @__PURE__ */ jsx53(
|
|
9244
9135
|
Countdown2,
|
|
9245
9136
|
{
|
|
9246
9137
|
styles: { content: { fontSize: 12, color: "#3b82f6" } },
|
|
@@ -9251,8 +9142,8 @@ function ResetPasswordForm({
|
|
|
9251
9142
|
) })
|
|
9252
9143
|
] })
|
|
9253
9144
|
] }),
|
|
9254
|
-
/* @__PURE__ */
|
|
9255
|
-
/* @__PURE__ */
|
|
9145
|
+
/* @__PURE__ */ jsxs40("footer", { className: "flex justify-end mt-8 gap-3", children: [
|
|
9146
|
+
/* @__PURE__ */ jsx53(
|
|
9256
9147
|
Button,
|
|
9257
9148
|
{
|
|
9258
9149
|
type: "button",
|
|
@@ -9262,7 +9153,7 @@ function ResetPasswordForm({
|
|
|
9262
9153
|
children: "Cancel"
|
|
9263
9154
|
}
|
|
9264
9155
|
),
|
|
9265
|
-
/* @__PURE__ */
|
|
9156
|
+
/* @__PURE__ */ jsx53(
|
|
9266
9157
|
Button,
|
|
9267
9158
|
{
|
|
9268
9159
|
isLoading,
|
|
@@ -9280,11 +9171,11 @@ var ResetPasswordForm_default = ResetPasswordForm;
|
|
|
9280
9171
|
// src/components/users/Activate.tsx
|
|
9281
9172
|
import { message as message10, Switch } from "antd";
|
|
9282
9173
|
import { useState as useState30 } from "react";
|
|
9283
|
-
import { Fragment as Fragment10, jsx as
|
|
9174
|
+
import { Fragment as Fragment10, jsx as jsx54 } from "react/jsx-runtime";
|
|
9284
9175
|
var ActivateUser = ({ data }) => {
|
|
9285
9176
|
const [checked, setChecked] = useState30(data?.isActive);
|
|
9286
9177
|
const { put, isLoading } = useApis_default();
|
|
9287
|
-
return /* @__PURE__ */
|
|
9178
|
+
return /* @__PURE__ */ jsx54(Fragment10, { children: /* @__PURE__ */ jsx54(
|
|
9288
9179
|
Switch,
|
|
9289
9180
|
{
|
|
9290
9181
|
onChange: async (e) => {
|
|
@@ -9312,7 +9203,7 @@ var Activate_default = ActivateUser;
|
|
|
9312
9203
|
|
|
9313
9204
|
// src/components/users/users.tsx
|
|
9314
9205
|
import { useNavigate as useNavigate6 } from "react-router-dom";
|
|
9315
|
-
import { Fragment as Fragment11, jsx as
|
|
9206
|
+
import { Fragment as Fragment11, jsx as jsx55, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
9316
9207
|
function Users() {
|
|
9317
9208
|
const navigate = useNavigate6();
|
|
9318
9209
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -9324,11 +9215,11 @@ function Users() {
|
|
|
9324
9215
|
const items = (data2) => [
|
|
9325
9216
|
{
|
|
9326
9217
|
label: `Reset Password`,
|
|
9327
|
-
icon: /* @__PURE__ */
|
|
9218
|
+
icon: /* @__PURE__ */ jsx55(Key, { size: 16 }),
|
|
9328
9219
|
onClick: () => openState({
|
|
9329
9220
|
title: "Request Password Reset",
|
|
9330
9221
|
type: "form",
|
|
9331
|
-
content: /* @__PURE__ */
|
|
9222
|
+
content: /* @__PURE__ */ jsx55(
|
|
9332
9223
|
ResetPasswordForm_default,
|
|
9333
9224
|
{
|
|
9334
9225
|
data: data2,
|
|
@@ -9341,11 +9232,11 @@ function Users() {
|
|
|
9341
9232
|
},
|
|
9342
9233
|
{
|
|
9343
9234
|
label: `Update Email`,
|
|
9344
|
-
icon: /* @__PURE__ */
|
|
9235
|
+
icon: /* @__PURE__ */ jsx55(Mail2, { size: 16 }),
|
|
9345
9236
|
onClick: () => openState({
|
|
9346
9237
|
title: "Update Email Address",
|
|
9347
9238
|
type: "form",
|
|
9348
|
-
content: /* @__PURE__ */
|
|
9239
|
+
content: /* @__PURE__ */ jsx55(
|
|
9349
9240
|
UpdateEmailForm_default,
|
|
9350
9241
|
{
|
|
9351
9242
|
data: data2,
|
|
@@ -9358,11 +9249,11 @@ function Users() {
|
|
|
9358
9249
|
},
|
|
9359
9250
|
data2?.emailVerification && {
|
|
9360
9251
|
label: `Verify Email`,
|
|
9361
|
-
icon: /* @__PURE__ */
|
|
9252
|
+
icon: /* @__PURE__ */ jsx55(ShieldCheck, {}),
|
|
9362
9253
|
onClick: () => openState({
|
|
9363
9254
|
title: "Verify Email",
|
|
9364
9255
|
type: "form",
|
|
9365
|
-
content: /* @__PURE__ */
|
|
9256
|
+
content: /* @__PURE__ */ jsx55(
|
|
9366
9257
|
VerifyEmailForm_default,
|
|
9367
9258
|
{
|
|
9368
9259
|
data: data2,
|
|
@@ -9383,16 +9274,16 @@ function Users() {
|
|
|
9383
9274
|
const data2 = row.original;
|
|
9384
9275
|
const emailVerification = data2?.emailVerification;
|
|
9385
9276
|
const newEmail = emailVerification?.email !== data2?.email ? emailVerification?.email : null;
|
|
9386
|
-
return /* @__PURE__ */
|
|
9387
|
-
/* @__PURE__ */
|
|
9277
|
+
return /* @__PURE__ */ jsxs41("div", { className: "space-y-1", children: [
|
|
9278
|
+
/* @__PURE__ */ jsxs41("section", { className: "flex items-center gap-2", children: [
|
|
9388
9279
|
" ",
|
|
9389
|
-
/* @__PURE__ */
|
|
9390
|
-
data2?.isEmailVerified && /* @__PURE__ */
|
|
9391
|
-
!data2?.isEmailVerified && /* @__PURE__ */
|
|
9280
|
+
/* @__PURE__ */ jsx55("p", { children: data2?.email }),
|
|
9281
|
+
data2?.isEmailVerified && /* @__PURE__ */ jsx55(Badge, { variant: "success", size: "sm", children: "Verified" }),
|
|
9282
|
+
!data2?.isEmailVerified && /* @__PURE__ */ jsx55(Badge, { variant: "warning", size: "sm", children: "Not Verified" })
|
|
9392
9283
|
] }),
|
|
9393
|
-
newEmail && /* @__PURE__ */
|
|
9394
|
-
/* @__PURE__ */
|
|
9395
|
-
/* @__PURE__ */
|
|
9284
|
+
newEmail && /* @__PURE__ */ jsxs41("section", { className: "flex items-center gap-2", children: [
|
|
9285
|
+
/* @__PURE__ */ jsx55(Info, { size: 16, className: "text-orange-600" }),
|
|
9286
|
+
/* @__PURE__ */ jsx55("p", { children: newEmail })
|
|
9396
9287
|
] })
|
|
9397
9288
|
] });
|
|
9398
9289
|
}
|
|
@@ -9402,7 +9293,7 @@ function Users() {
|
|
|
9402
9293
|
header: "Role",
|
|
9403
9294
|
cell: ({ row }) => {
|
|
9404
9295
|
const data2 = row.original;
|
|
9405
|
-
return /* @__PURE__ */
|
|
9296
|
+
return /* @__PURE__ */ jsx55(
|
|
9406
9297
|
Badge,
|
|
9407
9298
|
{
|
|
9408
9299
|
variant: data2?.role === "admin" ? "primary" : "warning",
|
|
@@ -9417,7 +9308,7 @@ function Users() {
|
|
|
9417
9308
|
header: "Employee Name",
|
|
9418
9309
|
cell: ({ row }) => {
|
|
9419
9310
|
const account = row.original?.account;
|
|
9420
|
-
return /* @__PURE__ */
|
|
9311
|
+
return /* @__PURE__ */ jsx55("span", { children: account?.name || "N/A" });
|
|
9421
9312
|
}
|
|
9422
9313
|
},
|
|
9423
9314
|
{
|
|
@@ -9425,7 +9316,7 @@ function Users() {
|
|
|
9425
9316
|
header: "Status",
|
|
9426
9317
|
cell: ({ row }) => {
|
|
9427
9318
|
const data2 = row.original;
|
|
9428
|
-
return /* @__PURE__ */
|
|
9319
|
+
return /* @__PURE__ */ jsx55(Activate_default, { data: data2 });
|
|
9429
9320
|
}
|
|
9430
9321
|
},
|
|
9431
9322
|
{
|
|
@@ -9433,13 +9324,13 @@ function Users() {
|
|
|
9433
9324
|
header: "Actions",
|
|
9434
9325
|
cell: ({ row }) => {
|
|
9435
9326
|
const data2 = row.original;
|
|
9436
|
-
return /* @__PURE__ */
|
|
9327
|
+
return /* @__PURE__ */ jsx55(
|
|
9437
9328
|
Dropdown,
|
|
9438
9329
|
{
|
|
9439
9330
|
className: "w-fit! cursor-pointer",
|
|
9440
9331
|
items: items(data2),
|
|
9441
9332
|
triggerMode: "hover",
|
|
9442
|
-
children: /* @__PURE__ */
|
|
9333
|
+
children: /* @__PURE__ */ jsx55(EllipsisVertical2, {})
|
|
9443
9334
|
}
|
|
9444
9335
|
);
|
|
9445
9336
|
}
|
|
@@ -9448,9 +9339,9 @@ function Users() {
|
|
|
9448
9339
|
[items]
|
|
9449
9340
|
);
|
|
9450
9341
|
const users = data?.data || [];
|
|
9451
|
-
return /* @__PURE__ */
|
|
9452
|
-
/* @__PURE__ */
|
|
9453
|
-
/* @__PURE__ */
|
|
9342
|
+
return /* @__PURE__ */ jsxs41(Fragment11, { children: [
|
|
9343
|
+
/* @__PURE__ */ jsx55(Modal2, {}),
|
|
9344
|
+
/* @__PURE__ */ jsx55(
|
|
9454
9345
|
TransactionViewComponent,
|
|
9455
9346
|
{
|
|
9456
9347
|
columns,
|
|
@@ -9471,7 +9362,7 @@ var users_default = Users;
|
|
|
9471
9362
|
import { useForm as useForm7 } from "react-hook-form";
|
|
9472
9363
|
import { zodResolver as zodResolver6 } from "@hookform/resolvers/zod";
|
|
9473
9364
|
import { message as message11 } from "antd";
|
|
9474
|
-
import { jsx as
|
|
9365
|
+
import { jsx as jsx56, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
9475
9366
|
function UserForm() {
|
|
9476
9367
|
const { navigate } = useApp_default();
|
|
9477
9368
|
const { post, isLoading } = useApis_default();
|
|
@@ -9496,14 +9387,14 @@ function UserForm() {
|
|
|
9496
9387
|
message11.error(error?.message || "Something went wrong");
|
|
9497
9388
|
}
|
|
9498
9389
|
};
|
|
9499
|
-
return /* @__PURE__ */
|
|
9500
|
-
/* @__PURE__ */
|
|
9501
|
-
/* @__PURE__ */
|
|
9502
|
-
/* @__PURE__ */
|
|
9390
|
+
return /* @__PURE__ */ jsxs42(Card, { className: "max-w-xl mx-auto mt-10 relative", children: [
|
|
9391
|
+
/* @__PURE__ */ jsxs42(Card.Header, { children: [
|
|
9392
|
+
/* @__PURE__ */ jsx56(Card.Title, { children: "Add User" }),
|
|
9393
|
+
/* @__PURE__ */ jsx56(Card.Description, { children: "Create a new user by providing their email and phone number." })
|
|
9503
9394
|
] }),
|
|
9504
|
-
/* @__PURE__ */
|
|
9505
|
-
/* @__PURE__ */
|
|
9506
|
-
/* @__PURE__ */
|
|
9395
|
+
/* @__PURE__ */ jsx56(Card.Content, { children: /* @__PURE__ */ jsxs42("form", { onSubmit: handleSubmit(onSubmit), children: [
|
|
9396
|
+
/* @__PURE__ */ jsxs42("div", { className: "space-y-4", children: [
|
|
9397
|
+
/* @__PURE__ */ jsx56(
|
|
9507
9398
|
Fields_default.Input,
|
|
9508
9399
|
{
|
|
9509
9400
|
label: "Email",
|
|
@@ -9514,7 +9405,7 @@ function UserForm() {
|
|
|
9514
9405
|
required: true
|
|
9515
9406
|
}
|
|
9516
9407
|
),
|
|
9517
|
-
/* @__PURE__ */
|
|
9408
|
+
/* @__PURE__ */ jsx56(
|
|
9518
9409
|
Fields_default.PhoneInput,
|
|
9519
9410
|
{
|
|
9520
9411
|
label: "Phone Number",
|
|
@@ -9523,7 +9414,7 @@ function UserForm() {
|
|
|
9523
9414
|
placeholder: "Enter phone number"
|
|
9524
9415
|
}
|
|
9525
9416
|
),
|
|
9526
|
-
/* @__PURE__ */
|
|
9417
|
+
/* @__PURE__ */ jsx56(
|
|
9527
9418
|
Fields_default.Select,
|
|
9528
9419
|
{
|
|
9529
9420
|
label: "Role",
|
|
@@ -9534,7 +9425,7 @@ function UserForm() {
|
|
|
9534
9425
|
}
|
|
9535
9426
|
)
|
|
9536
9427
|
] }),
|
|
9537
|
-
/* @__PURE__ */
|
|
9428
|
+
/* @__PURE__ */ jsx56("footer", { className: "flex justify-end mt-6", children: /* @__PURE__ */ jsx56(
|
|
9538
9429
|
Button,
|
|
9539
9430
|
{
|
|
9540
9431
|
isLoading,
|
|
@@ -9557,7 +9448,7 @@ import { useForm as useForm8 } from "react-hook-form";
|
|
|
9557
9448
|
import { zodResolver as zodResolver7 } from "@hookform/resolvers/zod";
|
|
9558
9449
|
import * as z4 from "zod";
|
|
9559
9450
|
import { message as message12, Spin } from "antd";
|
|
9560
|
-
import { Fragment as Fragment12, jsx as
|
|
9451
|
+
import { Fragment as Fragment12, jsx as jsx57, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
9561
9452
|
var resetPageSchema = z4.object({
|
|
9562
9453
|
password: z4.string().min(6, "Password must be at least 6 characters"),
|
|
9563
9454
|
confirmPassword: z4.string().min(6, "Password must be at least 6 characters")
|
|
@@ -9623,14 +9514,14 @@ function ResetPasswordPage() {
|
|
|
9623
9514
|
}
|
|
9624
9515
|
};
|
|
9625
9516
|
if (verifying) {
|
|
9626
|
-
return /* @__PURE__ */
|
|
9627
|
-
/* @__PURE__ */
|
|
9628
|
-
/* @__PURE__ */
|
|
9517
|
+
return /* @__PURE__ */ jsx57("div", { className: "h-screen w-full flex items-center justify-center bg-slate-50 dark:bg-[#0A0B10]", children: /* @__PURE__ */ jsxs43("div", { className: "text-center space-y-4", children: [
|
|
9518
|
+
/* @__PURE__ */ jsx57(Spin, { size: "large" }),
|
|
9519
|
+
/* @__PURE__ */ jsx57("p", { className: "text-slate-500 animate-pulse", children: "Verifying reset link..." })
|
|
9629
9520
|
] }) });
|
|
9630
9521
|
}
|
|
9631
|
-
return /* @__PURE__ */
|
|
9632
|
-
/* @__PURE__ */
|
|
9633
|
-
/* @__PURE__ */
|
|
9522
|
+
return /* @__PURE__ */ jsxs43("div", { className: "flex h-screen w-full overflow-hidden bg-white dark:bg-[#0A0B10]", children: [
|
|
9523
|
+
/* @__PURE__ */ jsxs43("div", { className: "hidden lg:flex lg:w-1/2 relative overflow-hidden bg-slate-900 border-r border-slate-800", children: [
|
|
9524
|
+
/* @__PURE__ */ jsx57(
|
|
9634
9525
|
"div",
|
|
9635
9526
|
{
|
|
9636
9527
|
className: "absolute inset-0 z-0 opacity-40 bg-cover bg-center",
|
|
@@ -9639,35 +9530,35 @@ function ResetPasswordPage() {
|
|
|
9639
9530
|
}
|
|
9640
9531
|
}
|
|
9641
9532
|
),
|
|
9642
|
-
/* @__PURE__ */
|
|
9643
|
-
/* @__PURE__ */
|
|
9644
|
-
/* @__PURE__ */
|
|
9645
|
-
/* @__PURE__ */
|
|
9646
|
-
/* @__PURE__ */
|
|
9533
|
+
/* @__PURE__ */ jsx57("div", { className: "absolute inset-0 bg-linear-to-tr from-[#0A0B10] via-transparent to-indigo-500/10 z-10" }),
|
|
9534
|
+
/* @__PURE__ */ jsxs43("div", { className: "relative z-20 p-12 flex flex-col justify-between w-full h-full", children: [
|
|
9535
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-3", children: [
|
|
9536
|
+
/* @__PURE__ */ jsx57("div", { className: "h-10 w-10 bg-indigo-600 rounded-lg flex items-center justify-center shadow-indigo-500/20 shadow-xl", children: /* @__PURE__ */ jsx57(Terminal2, { className: "text-white w-6 h-6" }) }),
|
|
9537
|
+
/* @__PURE__ */ jsx57("span", { className: "text-2xl font-bold text-white tracking-widest uppercase", children: "Warqad UI" })
|
|
9647
9538
|
] }),
|
|
9648
|
-
/* @__PURE__ */
|
|
9649
|
-
/* @__PURE__ */
|
|
9539
|
+
/* @__PURE__ */ jsxs43("div", { className: "max-w-md", children: [
|
|
9540
|
+
/* @__PURE__ */ jsxs43("h1", { className: "text-5xl font-extrabold text-white mb-6 leading-tight", children: [
|
|
9650
9541
|
"Secure ",
|
|
9651
|
-
/* @__PURE__ */
|
|
9542
|
+
/* @__PURE__ */ jsx57("span", { className: "text-indigo-400", children: "Access" }),
|
|
9652
9543
|
" ",
|
|
9653
|
-
/* @__PURE__ */
|
|
9544
|
+
/* @__PURE__ */ jsx57("br", {}),
|
|
9654
9545
|
" ",
|
|
9655
9546
|
"Simplified."
|
|
9656
9547
|
] }),
|
|
9657
|
-
/* @__PURE__ */
|
|
9548
|
+
/* @__PURE__ */ jsx57("p", { className: "text-slate-400 text-lg leading-relaxed", children: "Reset your credentials securely and regain access to your dashboard in minutes." })
|
|
9658
9549
|
] }),
|
|
9659
|
-
/* @__PURE__ */
|
|
9550
|
+
/* @__PURE__ */ jsx57("div", { className: "text-slate-500 text-sm italic", children: "Trusted by developers worldwide." })
|
|
9660
9551
|
] })
|
|
9661
9552
|
] }),
|
|
9662
|
-
/* @__PURE__ */
|
|
9663
|
-
/* @__PURE__ */
|
|
9664
|
-
/* @__PURE__ */
|
|
9665
|
-
/* @__PURE__ */
|
|
9666
|
-
/* @__PURE__ */
|
|
9667
|
-
/* @__PURE__ */
|
|
9668
|
-
/* @__PURE__ */
|
|
9553
|
+
/* @__PURE__ */ jsxs43("div", { className: "w-full lg:w-1/2 p-8 lg:p-16 flex flex-col justify-center bg-white dark:bg-[#0A0B10] relative", children: [
|
|
9554
|
+
/* @__PURE__ */ jsx57("div", { className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsx57(ThemeToggle, {}) }),
|
|
9555
|
+
/* @__PURE__ */ jsx57("div", { className: "max-w-md w-full mx-auto", children: !isVerified || error ? /* @__PURE__ */ jsxs43("div", { className: "text-center space-y-6", children: [
|
|
9556
|
+
/* @__PURE__ */ jsx57("div", { className: "mx-auto w-16 h-16 bg-red-100 dark:bg-red-900/20 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsx57(ShieldCheck2, { className: "text-red-600 dark:text-red-400 w-8 h-8" }) }),
|
|
9557
|
+
/* @__PURE__ */ jsxs43("div", { children: [
|
|
9558
|
+
/* @__PURE__ */ jsx57("h2", { className: "text-3xl font-bold text-slate-900 dark:text-white mb-2", children: "Link Invalid" }),
|
|
9559
|
+
/* @__PURE__ */ jsx57("p", { className: "text-slate-500 dark:text-slate-400", children: error || "The reset link is invalid or has already been used." })
|
|
9669
9560
|
] }),
|
|
9670
|
-
/* @__PURE__ */
|
|
9561
|
+
/* @__PURE__ */ jsx57(
|
|
9671
9562
|
Button,
|
|
9672
9563
|
{
|
|
9673
9564
|
onClick: () => navigate("/login"),
|
|
@@ -9675,22 +9566,22 @@ function ResetPasswordPage() {
|
|
|
9675
9566
|
children: "Back to Login"
|
|
9676
9567
|
}
|
|
9677
9568
|
)
|
|
9678
|
-
] }) : /* @__PURE__ */
|
|
9679
|
-
/* @__PURE__ */
|
|
9680
|
-
/* @__PURE__ */
|
|
9681
|
-
/* @__PURE__ */
|
|
9569
|
+
] }) : /* @__PURE__ */ jsxs43(Fragment12, { children: [
|
|
9570
|
+
/* @__PURE__ */ jsxs43("div", { className: "mb-10", children: [
|
|
9571
|
+
/* @__PURE__ */ jsx57("h2", { className: "text-3xl font-bold text-slate-900 dark:text-white mb-3 tracking-tight", children: "Reset Password" }),
|
|
9572
|
+
/* @__PURE__ */ jsxs43("p", { className: "text-slate-500 dark:text-slate-400", children: [
|
|
9682
9573
|
"Set a new, strong password for",
|
|
9683
9574
|
" ",
|
|
9684
|
-
/* @__PURE__ */
|
|
9575
|
+
/* @__PURE__ */ jsx57("span", { className: "text-indigo-600 font-medium", children: email })
|
|
9685
9576
|
] })
|
|
9686
9577
|
] }),
|
|
9687
|
-
/* @__PURE__ */
|
|
9578
|
+
/* @__PURE__ */ jsxs43(
|
|
9688
9579
|
"form",
|
|
9689
9580
|
{
|
|
9690
9581
|
onSubmit: methods.handleSubmit(onSubmit),
|
|
9691
9582
|
className: "space-y-6",
|
|
9692
9583
|
children: [
|
|
9693
|
-
/* @__PURE__ */
|
|
9584
|
+
/* @__PURE__ */ jsx57(
|
|
9694
9585
|
Fields_default.Input,
|
|
9695
9586
|
{
|
|
9696
9587
|
form: methods,
|
|
@@ -9699,11 +9590,11 @@ function ResetPasswordPage() {
|
|
|
9699
9590
|
type: "password",
|
|
9700
9591
|
placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
9701
9592
|
required: true,
|
|
9702
|
-
icon: /* @__PURE__ */
|
|
9593
|
+
icon: /* @__PURE__ */ jsx57(Lock2, { size: 18, className: "text-slate-400" }),
|
|
9703
9594
|
className: "bg-slate-50 dark:bg-slate-900/50 h-12"
|
|
9704
9595
|
}
|
|
9705
9596
|
),
|
|
9706
|
-
/* @__PURE__ */
|
|
9597
|
+
/* @__PURE__ */ jsx57(
|
|
9707
9598
|
Fields_default.Input,
|
|
9708
9599
|
{
|
|
9709
9600
|
form: methods,
|
|
@@ -9712,11 +9603,11 @@ function ResetPasswordPage() {
|
|
|
9712
9603
|
type: "password",
|
|
9713
9604
|
placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
9714
9605
|
required: true,
|
|
9715
|
-
icon: /* @__PURE__ */
|
|
9606
|
+
icon: /* @__PURE__ */ jsx57(ShieldCheck2, { size: 18, className: "text-slate-400" }),
|
|
9716
9607
|
className: "bg-slate-50 dark:bg-slate-900/50 h-12"
|
|
9717
9608
|
}
|
|
9718
9609
|
),
|
|
9719
|
-
/* @__PURE__ */
|
|
9610
|
+
/* @__PURE__ */ jsxs43(
|
|
9720
9611
|
Button,
|
|
9721
9612
|
{
|
|
9722
9613
|
type: "submit",
|
|
@@ -9724,7 +9615,7 @@ function ResetPasswordPage() {
|
|
|
9724
9615
|
className: "w-full h-12 bg-indigo-600 hover:bg-indigo-500 text-white font-semibold flex items-center justify-center gap-2",
|
|
9725
9616
|
children: [
|
|
9726
9617
|
"Update Password",
|
|
9727
|
-
!isLoading && /* @__PURE__ */
|
|
9618
|
+
!isLoading && /* @__PURE__ */ jsx57(ArrowRight2, { size: 18 })
|
|
9728
9619
|
]
|
|
9729
9620
|
}
|
|
9730
9621
|
)
|
|
@@ -9741,7 +9632,7 @@ var ResetPasswordPage_default = ResetPasswordPage;
|
|
|
9741
9632
|
import { LogOut, User as User2 } from "lucide-react";
|
|
9742
9633
|
import { useNavigate as useNavigate8 } from "react-router-dom";
|
|
9743
9634
|
import { message as message13 } from "antd";
|
|
9744
|
-
import { jsx as
|
|
9635
|
+
import { jsx as jsx58, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
9745
9636
|
var UserProfile = ({
|
|
9746
9637
|
items,
|
|
9747
9638
|
name,
|
|
@@ -9774,21 +9665,21 @@ var UserProfile = ({
|
|
|
9774
9665
|
const defaultItems = [
|
|
9775
9666
|
{
|
|
9776
9667
|
label: "My Profile",
|
|
9777
|
-
icon: /* @__PURE__ */
|
|
9668
|
+
icon: /* @__PURE__ */ jsx58(User2, { size: 18 }),
|
|
9778
9669
|
onClick: () => navigate("profile"),
|
|
9779
9670
|
className: "min-w-[150px]"
|
|
9780
9671
|
},
|
|
9781
9672
|
{
|
|
9782
9673
|
label: "Logout",
|
|
9783
|
-
icon: /* @__PURE__ */
|
|
9674
|
+
icon: /* @__PURE__ */ jsx58(LogOut, { size: 18 }),
|
|
9784
9675
|
onClick: logout,
|
|
9785
9676
|
className: "text-red-500 hover:bg-red-50 dark:hover:bg-red-950/20"
|
|
9786
9677
|
}
|
|
9787
9678
|
];
|
|
9788
|
-
return /* @__PURE__ */
|
|
9789
|
-
showThemeToggle && /* @__PURE__ */
|
|
9790
|
-
showThemeToggle && /* @__PURE__ */
|
|
9791
|
-
/* @__PURE__ */
|
|
9679
|
+
return /* @__PURE__ */ jsxs44("div", { className: "flex items-center gap-3", children: [
|
|
9680
|
+
showThemeToggle && /* @__PURE__ */ jsx58(ThemeToggle, {}),
|
|
9681
|
+
showThemeToggle && /* @__PURE__ */ jsx58("div", { className: "w-px h-6 mx-2 bg-gray-200 dark:bg-gray-800" }),
|
|
9682
|
+
/* @__PURE__ */ jsx58(
|
|
9792
9683
|
ProfileDropdown,
|
|
9793
9684
|
{
|
|
9794
9685
|
name: name || account?.name || "User",
|
|
@@ -9806,12 +9697,12 @@ var UserProfile_default = UserProfile;
|
|
|
9806
9697
|
// src/components/users/ProfilePage.tsx
|
|
9807
9698
|
import { useNavigate as useNavigate9 } from "react-router-dom";
|
|
9808
9699
|
import { ArrowLeft as ArrowLeft3 } from "lucide-react";
|
|
9809
|
-
import { jsx as
|
|
9700
|
+
import { jsx as jsx59, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
9810
9701
|
var ProfilePage = () => {
|
|
9811
9702
|
const navigate = useNavigate9();
|
|
9812
9703
|
const { user, account } = useAuth();
|
|
9813
9704
|
if (!user) {
|
|
9814
|
-
return /* @__PURE__ */
|
|
9705
|
+
return /* @__PURE__ */ jsx59("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ jsx59("h1", { children: "Please login to view your profile" }) });
|
|
9815
9706
|
}
|
|
9816
9707
|
const extraInfo = [
|
|
9817
9708
|
{
|
|
@@ -9830,19 +9721,19 @@ var ProfilePage = () => {
|
|
|
9830
9721
|
copiable: false
|
|
9831
9722
|
}
|
|
9832
9723
|
];
|
|
9833
|
-
return /* @__PURE__ */
|
|
9834
|
-
/* @__PURE__ */
|
|
9724
|
+
return /* @__PURE__ */ jsxs45("div", { className: "p-4 sm:p-8 space-y-6", children: [
|
|
9725
|
+
/* @__PURE__ */ jsx59("div", { className: "max-w-5xl mx-auto", children: /* @__PURE__ */ jsx59(
|
|
9835
9726
|
Button,
|
|
9836
9727
|
{
|
|
9837
9728
|
variant: "outline",
|
|
9838
9729
|
size: "sm",
|
|
9839
9730
|
onClick: () => navigate(-1),
|
|
9840
|
-
icon: /* @__PURE__ */
|
|
9731
|
+
icon: /* @__PURE__ */ jsx59(ArrowLeft3, { size: 16 }),
|
|
9841
9732
|
className: "rounded-full font-bold px-5",
|
|
9842
9733
|
children: "Back"
|
|
9843
9734
|
}
|
|
9844
9735
|
) }),
|
|
9845
|
-
/* @__PURE__ */
|
|
9736
|
+
/* @__PURE__ */ jsx59(
|
|
9846
9737
|
ProfileView,
|
|
9847
9738
|
{
|
|
9848
9739
|
name: account?.name || "User Account",
|
|
@@ -9862,7 +9753,7 @@ import { useNavigate as useNavigate10, useParams as useParams6 } from "react-rou
|
|
|
9862
9753
|
import { EllipsisVertical as EllipsisVertical3, FilePenLine as FilePenLine2, Trash2 as Trash23 } from "lucide-react";
|
|
9863
9754
|
import { useState as useState32 } from "react";
|
|
9864
9755
|
import { message as message14 } from "antd";
|
|
9865
|
-
import { Fragment as Fragment13, jsx as
|
|
9756
|
+
import { Fragment as Fragment13, jsx as jsx60, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
9866
9757
|
function Wallets({ v, url }) {
|
|
9867
9758
|
const { branchId } = useParams6();
|
|
9868
9759
|
const [deleteWallet, setDeleteWallet] = useState32(null);
|
|
@@ -9877,12 +9768,12 @@ function Wallets({ v, url }) {
|
|
|
9877
9768
|
const items = (data2) => [
|
|
9878
9769
|
{
|
|
9879
9770
|
label: `Edit Wallet`,
|
|
9880
|
-
icon: /* @__PURE__ */
|
|
9771
|
+
icon: /* @__PURE__ */ jsx60(FilePenLine2, { size: 16 }),
|
|
9881
9772
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
9882
9773
|
},
|
|
9883
9774
|
{
|
|
9884
9775
|
label: `Delete Wallet`,
|
|
9885
|
-
icon: /* @__PURE__ */
|
|
9776
|
+
icon: /* @__PURE__ */ jsx60(Trash23, { className: "text-red-500", size: 16 }),
|
|
9886
9777
|
onClick: () => setDeleteWallet(data2)
|
|
9887
9778
|
}
|
|
9888
9779
|
].filter(Boolean);
|
|
@@ -9892,7 +9783,7 @@ function Wallets({ v, url }) {
|
|
|
9892
9783
|
header: "Name",
|
|
9893
9784
|
cell: ({ row }) => {
|
|
9894
9785
|
const wallet = row.original;
|
|
9895
|
-
return /* @__PURE__ */
|
|
9786
|
+
return /* @__PURE__ */ jsx60("span", { children: wallet?.name });
|
|
9896
9787
|
}
|
|
9897
9788
|
},
|
|
9898
9789
|
{
|
|
@@ -9900,7 +9791,7 @@ function Wallets({ v, url }) {
|
|
|
9900
9791
|
header: "Type",
|
|
9901
9792
|
cell: ({ row }) => {
|
|
9902
9793
|
const wallet = row.original;
|
|
9903
|
-
return /* @__PURE__ */
|
|
9794
|
+
return /* @__PURE__ */ jsx60("span", { className: "capitalize", children: wallet?.type });
|
|
9904
9795
|
}
|
|
9905
9796
|
},
|
|
9906
9797
|
{
|
|
@@ -9908,7 +9799,7 @@ function Wallets({ v, url }) {
|
|
|
9908
9799
|
header: "Currency",
|
|
9909
9800
|
cell: ({ row }) => {
|
|
9910
9801
|
const wallet = row.original;
|
|
9911
|
-
return /* @__PURE__ */
|
|
9802
|
+
return /* @__PURE__ */ jsx60("span", { children: wallet?.currency });
|
|
9912
9803
|
}
|
|
9913
9804
|
},
|
|
9914
9805
|
{
|
|
@@ -9916,7 +9807,7 @@ function Wallets({ v, url }) {
|
|
|
9916
9807
|
header: "Account No",
|
|
9917
9808
|
cell: ({ row }) => {
|
|
9918
9809
|
const wallet = row.original;
|
|
9919
|
-
return /* @__PURE__ */
|
|
9810
|
+
return /* @__PURE__ */ jsx60("span", { children: wallet?.accountNo || "N/A" });
|
|
9920
9811
|
}
|
|
9921
9812
|
},
|
|
9922
9813
|
{
|
|
@@ -9924,13 +9815,13 @@ function Wallets({ v, url }) {
|
|
|
9924
9815
|
header: "Actions",
|
|
9925
9816
|
cell: ({ row }) => {
|
|
9926
9817
|
const data2 = row.original;
|
|
9927
|
-
return /* @__PURE__ */
|
|
9818
|
+
return /* @__PURE__ */ jsx60(
|
|
9928
9819
|
Dropdown,
|
|
9929
9820
|
{
|
|
9930
9821
|
className: "cursor-pointer w-[150px]",
|
|
9931
9822
|
items: items(data2),
|
|
9932
9823
|
triggerMode: "hover",
|
|
9933
|
-
children: /* @__PURE__ */
|
|
9824
|
+
children: /* @__PURE__ */ jsx60(EllipsisVertical3, {})
|
|
9934
9825
|
}
|
|
9935
9826
|
);
|
|
9936
9827
|
}
|
|
@@ -9948,9 +9839,9 @@ function Wallets({ v, url }) {
|
|
|
9948
9839
|
return error;
|
|
9949
9840
|
}
|
|
9950
9841
|
};
|
|
9951
|
-
return /* @__PURE__ */
|
|
9952
|
-
/* @__PURE__ */
|
|
9953
|
-
/* @__PURE__ */
|
|
9842
|
+
return /* @__PURE__ */ jsxs46(Fragment13, { children: [
|
|
9843
|
+
/* @__PURE__ */ jsx60(Modal2, {}),
|
|
9844
|
+
/* @__PURE__ */ jsx60(
|
|
9954
9845
|
ConfirmModal,
|
|
9955
9846
|
{
|
|
9956
9847
|
isOpen: !!deleteWallet,
|
|
@@ -9963,7 +9854,7 @@ function Wallets({ v, url }) {
|
|
|
9963
9854
|
children: null
|
|
9964
9855
|
}
|
|
9965
9856
|
),
|
|
9966
|
-
/* @__PURE__ */
|
|
9857
|
+
/* @__PURE__ */ jsx60(
|
|
9967
9858
|
TransactionViewComponent,
|
|
9968
9859
|
{
|
|
9969
9860
|
columns,
|
|
@@ -9997,7 +9888,7 @@ import { zodResolver as zodResolver8 } from "@hookform/resolvers/zod";
|
|
|
9997
9888
|
import { message as message15 } from "antd";
|
|
9998
9889
|
import { useEffect as useEffect25 } from "react";
|
|
9999
9890
|
import { useParams as useParams7 } from "react-router-dom";
|
|
10000
|
-
import { jsx as
|
|
9891
|
+
import { jsx as jsx61, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
10001
9892
|
function WalletForm() {
|
|
10002
9893
|
const { enums } = useWarqadConfig();
|
|
10003
9894
|
const { branchId } = useParams7();
|
|
@@ -10059,24 +9950,24 @@ function WalletForm() {
|
|
|
10059
9950
|
fetches();
|
|
10060
9951
|
}
|
|
10061
9952
|
}, [id]);
|
|
10062
|
-
return /* @__PURE__ */
|
|
9953
|
+
return /* @__PURE__ */ jsxs47(
|
|
10063
9954
|
Card,
|
|
10064
9955
|
{
|
|
10065
9956
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
10066
9957
|
isLoading: isLoadingGet,
|
|
10067
9958
|
loadingText: "Processing...",
|
|
10068
9959
|
children: [
|
|
10069
|
-
/* @__PURE__ */
|
|
10070
|
-
/* @__PURE__ */
|
|
10071
|
-
/* @__PURE__ */
|
|
9960
|
+
/* @__PURE__ */ jsxs47(Card.Header, { children: [
|
|
9961
|
+
/* @__PURE__ */ jsx61(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Wallet` }),
|
|
9962
|
+
/* @__PURE__ */ jsx61(Card.Description, { children: isEdit ? `Update the details for this wallet` : `Create a new wallet and add it to your list` })
|
|
10072
9963
|
] }),
|
|
10073
|
-
/* @__PURE__ */
|
|
9964
|
+
/* @__PURE__ */ jsx61(Card.Content, { children: /* @__PURE__ */ jsxs47(
|
|
10074
9965
|
"form",
|
|
10075
9966
|
{
|
|
10076
9967
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
10077
9968
|
children: [
|
|
10078
|
-
/* @__PURE__ */
|
|
10079
|
-
/* @__PURE__ */
|
|
9969
|
+
/* @__PURE__ */ jsxs47("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
9970
|
+
/* @__PURE__ */ jsx61(
|
|
10080
9971
|
Fields_default.Input,
|
|
10081
9972
|
{
|
|
10082
9973
|
label: "Name",
|
|
@@ -10087,7 +9978,7 @@ function WalletForm() {
|
|
|
10087
9978
|
required: true
|
|
10088
9979
|
}
|
|
10089
9980
|
),
|
|
10090
|
-
/* @__PURE__ */
|
|
9981
|
+
/* @__PURE__ */ jsx61(
|
|
10091
9982
|
Fields_default.Select,
|
|
10092
9983
|
{
|
|
10093
9984
|
label: "Wallet Type",
|
|
@@ -10097,7 +9988,7 @@ function WalletForm() {
|
|
|
10097
9988
|
enumName: "walletTypes"
|
|
10098
9989
|
}
|
|
10099
9990
|
),
|
|
10100
|
-
/* @__PURE__ */
|
|
9991
|
+
/* @__PURE__ */ jsx61(
|
|
10101
9992
|
Fields_default.Select,
|
|
10102
9993
|
{
|
|
10103
9994
|
label: "Currency",
|
|
@@ -10107,7 +9998,7 @@ function WalletForm() {
|
|
|
10107
9998
|
enumName: "currencies"
|
|
10108
9999
|
}
|
|
10109
10000
|
),
|
|
10110
|
-
/* @__PURE__ */
|
|
10001
|
+
/* @__PURE__ */ jsx61(
|
|
10111
10002
|
Fields_default.Input,
|
|
10112
10003
|
{
|
|
10113
10004
|
label: "Account Number",
|
|
@@ -10117,7 +10008,7 @@ function WalletForm() {
|
|
|
10117
10008
|
placeholder: "Enter account number (optional)"
|
|
10118
10009
|
}
|
|
10119
10010
|
),
|
|
10120
|
-
!branchId && /* @__PURE__ */
|
|
10011
|
+
!branchId && /* @__PURE__ */ jsx61(
|
|
10121
10012
|
Feilds_default.Branches,
|
|
10122
10013
|
{
|
|
10123
10014
|
label: "Branch",
|
|
@@ -10128,7 +10019,7 @@ function WalletForm() {
|
|
|
10128
10019
|
}
|
|
10129
10020
|
)
|
|
10130
10021
|
] }),
|
|
10131
|
-
/* @__PURE__ */
|
|
10022
|
+
/* @__PURE__ */ jsx61("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx61(
|
|
10132
10023
|
Button,
|
|
10133
10024
|
{
|
|
10134
10025
|
isLoading,
|
|
@@ -10150,7 +10041,7 @@ var WalletForm_default = WalletForm;
|
|
|
10150
10041
|
|
|
10151
10042
|
// src/components/wallets/Feilds/Wallet.tsx
|
|
10152
10043
|
import { useParams as useParams8 } from "react-router-dom";
|
|
10153
|
-
import { jsx as
|
|
10044
|
+
import { jsx as jsx62, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
10154
10045
|
function Wallet({
|
|
10155
10046
|
name,
|
|
10156
10047
|
label,
|
|
@@ -10170,8 +10061,8 @@ function Wallet({
|
|
|
10170
10061
|
showBalance,
|
|
10171
10062
|
accountId: walletId
|
|
10172
10063
|
});
|
|
10173
|
-
return /* @__PURE__ */
|
|
10174
|
-
/* @__PURE__ */
|
|
10064
|
+
return /* @__PURE__ */ jsxs48("div", { className: "flex flex-col gap-2", children: [
|
|
10065
|
+
/* @__PURE__ */ jsx62(
|
|
10175
10066
|
Fields_default.SearchApi,
|
|
10176
10067
|
{
|
|
10177
10068
|
name,
|
|
@@ -10188,7 +10079,7 @@ function Wallet({
|
|
|
10188
10079
|
disabled
|
|
10189
10080
|
}
|
|
10190
10081
|
),
|
|
10191
|
-
/* @__PURE__ */
|
|
10082
|
+
/* @__PURE__ */ jsx62(BalanceView, {})
|
|
10192
10083
|
] });
|
|
10193
10084
|
}
|
|
10194
10085
|
var Wallet_default = Wallet;
|
|
@@ -10198,6 +10089,111 @@ var WalletField = {
|
|
|
10198
10089
|
Wallet: Wallet_default
|
|
10199
10090
|
};
|
|
10200
10091
|
var Feilds_default2 = WalletField;
|
|
10092
|
+
|
|
10093
|
+
// src/components/ErrorPage/ErrorPage.tsx
|
|
10094
|
+
import { jsx as jsx63, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
10095
|
+
var ErrorPageBase = ({
|
|
10096
|
+
title,
|
|
10097
|
+
message: message16,
|
|
10098
|
+
statusCode,
|
|
10099
|
+
action,
|
|
10100
|
+
className = ""
|
|
10101
|
+
}) => {
|
|
10102
|
+
return /* @__PURE__ */ jsx63(
|
|
10103
|
+
"div",
|
|
10104
|
+
{
|
|
10105
|
+
className: `flex-1 m-auto h-full w-full min-h-[50vh] flex flex-col items-center justify-center p-6 text-zinc-900 dark:text-zinc-100 ${className}`,
|
|
10106
|
+
children: /* @__PURE__ */ jsxs49("div", { className: "relative flex flex-col items-center justify-center w-full max-w-2xl text-center", children: [
|
|
10107
|
+
statusCode && /* @__PURE__ */ jsx63("div", { className: "absolute inset-0 flex items-center justify-center z-0 select-none pointer-events-none opacity-[0.03] dark:opacity-5", children: /* @__PURE__ */ jsx63("span", { className: "text-[12rem] sm:text-[16rem] md:text-[20rem] font-bold leading-none tracking-tighter", children: statusCode }) }),
|
|
10108
|
+
/* @__PURE__ */ jsxs49("div", { className: "relative z-10 space-y-6", children: [
|
|
10109
|
+
statusCode && /* @__PURE__ */ jsxs49("h2", { className: "text-xl md:text-2xl font-semibold text-zinc-500 dark:text-zinc-400", children: [
|
|
10110
|
+
"Error ",
|
|
10111
|
+
statusCode
|
|
10112
|
+
] }),
|
|
10113
|
+
title && /* @__PURE__ */ jsx63("h1", { className: "text-4xl md:text-5xl font-extrabold tracking-tight drop-shadow-sm", children: title }),
|
|
10114
|
+
message16 && /* @__PURE__ */ jsx63("p", { className: "text-lg md:text-xl text-zinc-600 dark:text-zinc-400 max-w-md mx-auto", children: message16 }),
|
|
10115
|
+
action && /* @__PURE__ */ jsx63("div", { className: "pt-8", children: /* @__PURE__ */ jsx63(
|
|
10116
|
+
"button",
|
|
10117
|
+
{
|
|
10118
|
+
onClick: action.onClick,
|
|
10119
|
+
className: "px-8 py-3.5 rounded-full text-white font-semibold shadow-[0_4px_14px_0_rgba(0,0,0,0.1)] hover:shadow-[0_6px_20px_rgba(0,0,0,0.15)] transition-all hover:-translate-y-0.5 active:translate-y-0 focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
10120
|
+
style: { backgroundColor: "var(--primary-color, #3b82f6)" },
|
|
10121
|
+
children: action.label
|
|
10122
|
+
}
|
|
10123
|
+
) })
|
|
10124
|
+
] })
|
|
10125
|
+
] })
|
|
10126
|
+
}
|
|
10127
|
+
);
|
|
10128
|
+
};
|
|
10129
|
+
|
|
10130
|
+
// src/components/ErrorPage/ErrorPage.500.tsx
|
|
10131
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
10132
|
+
var ErrorPage500 = (props) => {
|
|
10133
|
+
return /* @__PURE__ */ jsx64(
|
|
10134
|
+
ErrorPageBase,
|
|
10135
|
+
{
|
|
10136
|
+
statusCode: 500,
|
|
10137
|
+
title: "Internal Server Error",
|
|
10138
|
+
message: "Oops, something went wrong on our end. Please try again later.",
|
|
10139
|
+
action: { label: "Go Home", onClick: () => window.location.href = "/" },
|
|
10140
|
+
...props
|
|
10141
|
+
}
|
|
10142
|
+
);
|
|
10143
|
+
};
|
|
10144
|
+
|
|
10145
|
+
// src/components/ErrorPage/ErrorPage.404.tsx
|
|
10146
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
10147
|
+
var ErrorPage404 = (props) => {
|
|
10148
|
+
return /* @__PURE__ */ jsx65(
|
|
10149
|
+
ErrorPageBase,
|
|
10150
|
+
{
|
|
10151
|
+
statusCode: 404,
|
|
10152
|
+
title: "Page Not Found",
|
|
10153
|
+
message: "The page you are looking for doesn't exist or has been moved.",
|
|
10154
|
+
action: { label: "Go Home", onClick: () => window.location.href = "/" },
|
|
10155
|
+
...props
|
|
10156
|
+
}
|
|
10157
|
+
);
|
|
10158
|
+
};
|
|
10159
|
+
|
|
10160
|
+
// src/components/ErrorPage/ErrorPage.401.tsx
|
|
10161
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
10162
|
+
var ErrorPage401 = (props) => {
|
|
10163
|
+
return /* @__PURE__ */ jsx66(
|
|
10164
|
+
ErrorPageBase,
|
|
10165
|
+
{
|
|
10166
|
+
statusCode: 401,
|
|
10167
|
+
title: "Unauthorized",
|
|
10168
|
+
message: "You don't have permission to access this page.",
|
|
10169
|
+
action: { label: "Go Home", onClick: () => window.location.href = "/" },
|
|
10170
|
+
...props
|
|
10171
|
+
}
|
|
10172
|
+
);
|
|
10173
|
+
};
|
|
10174
|
+
|
|
10175
|
+
// src/components/ErrorPage/ErrorPage.400.tsx
|
|
10176
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
10177
|
+
var ErrorPage400 = (props) => {
|
|
10178
|
+
return /* @__PURE__ */ jsx67(
|
|
10179
|
+
ErrorPageBase,
|
|
10180
|
+
{
|
|
10181
|
+
statusCode: 400,
|
|
10182
|
+
title: "Bad Request",
|
|
10183
|
+
message: "Your request could not be processed. Please try again.",
|
|
10184
|
+
action: { label: "Go Home", onClick: () => window.location.href = "/" },
|
|
10185
|
+
...props
|
|
10186
|
+
}
|
|
10187
|
+
);
|
|
10188
|
+
};
|
|
10189
|
+
|
|
10190
|
+
// src/components/ErrorPage/index.ts
|
|
10191
|
+
var ErrorPage = Object.assign(ErrorPageBase, {
|
|
10192
|
+
500: ErrorPage500,
|
|
10193
|
+
404: ErrorPage404,
|
|
10194
|
+
401: ErrorPage401,
|
|
10195
|
+
400: ErrorPage400
|
|
10196
|
+
});
|
|
10201
10197
|
export {
|
|
10202
10198
|
Feilds_default as AccountFields,
|
|
10203
10199
|
AccountForm_default as AccountForm,
|