warqadui 0.0.71 → 0.0.73

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 CHANGED
@@ -84,11 +84,13 @@ __export(index_exports, {
84
84
  ThemeToggle: () => ThemeToggle,
85
85
  ThemedLogin: () => ThemedLogin,
86
86
  UnProtectedRoute: () => UnProtectedRoute,
87
+ UserForm: () => UserForm_default,
87
88
  UserProfile: () => UserProfile_default,
88
89
  Users: () => users_default,
89
90
  Views: () => Views_default,
90
91
  WarqadProvider: () => WarqadProvider,
91
92
  createAccountSchema: () => createAccountSchema,
93
+ createUserSchema: () => createUserSchema,
92
94
  generatePdf: () => generatePdf,
93
95
  linkUserSchema: () => linkUserSchema,
94
96
  resetPasswordSchema: () => resetPasswordSchema,
@@ -1042,7 +1044,7 @@ var CardTitle = ({
1042
1044
  "h3",
1043
1045
  {
1044
1046
  className: cn(
1045
- "text-lg font-semibold leading-none tracking-tight text-gray-900 dark:text-gray-100",
1047
+ "text-xl capitalize font-bold leading-none tracking-tight text-gray-900 dark:text-gray-100 ",
1046
1048
  className
1047
1049
  ),
1048
1050
  children
@@ -1171,13 +1173,13 @@ var Input = (0, import_react8.forwardRef)(
1171
1173
  }
1172
1174
  }
1173
1175
  }, [props.value, name, form]);
1174
- let message13 = error;
1176
+ let message14 = error;
1175
1177
  if (form && name) {
1176
1178
  const {
1177
1179
  formState: { errors }
1178
1180
  } = form;
1179
1181
  const errorObj = name.split(".").reduce((acc, current) => acc?.[current], errors);
1180
- message13 = errorObj?.message;
1182
+ message14 = errorObj?.message;
1181
1183
  }
1182
1184
  const watchedValue = form?.watch(name);
1183
1185
  (0, import_react8.useEffect)(() => {
@@ -1246,7 +1248,7 @@ var Input = (0, import_react8.forwardRef)(
1246
1248
  }
1247
1249
  )
1248
1250
  ] }),
1249
- message13 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message13 })
1251
+ message14 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message14 })
1250
1252
  ]
1251
1253
  }
1252
1254
  );
@@ -1569,7 +1571,7 @@ var PhoneInput = (0, import_react11.forwardRef)(
1569
1571
  const [isFocused, setIsFocused] = (0, import_react11.useState)(false);
1570
1572
  const { theme } = useWarqadConfig();
1571
1573
  const primaryColor = theme?.primaryColor;
1572
- let message13 = error;
1574
+ let message14 = error;
1573
1575
  if (form && name) {
1574
1576
  const {
1575
1577
  formState: { errors }
@@ -1579,7 +1581,7 @@ var PhoneInput = (0, import_react11.forwardRef)(
1579
1581
  for (const part of nameParts) {
1580
1582
  currentError = currentError?.[part];
1581
1583
  }
1582
- message13 = currentError?.message || message13;
1584
+ message14 = currentError?.message || message14;
1583
1585
  }
1584
1586
  const renderInput = (onChangeHandler, currentValue) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: `space-y-2 group relative ${containerClassName}`, children: [
1585
1587
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
@@ -1630,7 +1632,7 @@ var PhoneInput = (0, import_react11.forwardRef)(
1630
1632
  }
1631
1633
  )
1632
1634
  ] }),
1633
- message13 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message13 })
1635
+ message14 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message14 })
1634
1636
  ] });
1635
1637
  if (form && name) {
1636
1638
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
@@ -1779,7 +1781,7 @@ var SelectRoot = ({
1779
1781
  document.addEventListener("mousedown", handleClickOutside);
1780
1782
  return () => document.removeEventListener("mousedown", handleClickOutside);
1781
1783
  }, [fieldInternalProps]);
1782
- let message13 = error;
1784
+ let message14 = error;
1783
1785
  if (form && name) {
1784
1786
  const {
1785
1787
  formState: { errors }
@@ -1789,7 +1791,7 @@ var SelectRoot = ({
1789
1791
  for (const part of nameParts) {
1790
1792
  currentError = currentError?.[part];
1791
1793
  }
1792
- message13 = currentError?.message || message13;
1794
+ message14 = currentError?.message || message14;
1793
1795
  }
1794
1796
  const allOptions = initialOptions?.length ? initialOptions : registeredOptions;
1795
1797
  const valueCtx = {
@@ -1850,7 +1852,7 @@ var SelectRoot = ({
1850
1852
  String(opt.value) || index
1851
1853
  )) })
1852
1854
  ] }),
1853
- message13 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message13 })
1855
+ message14 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message14 })
1854
1856
  ]
1855
1857
  }
1856
1858
  ) });
@@ -2086,13 +2088,13 @@ var Textarea = (0, import_react13.forwardRef)(
2086
2088
  const [isFocused, setIsFocused] = (0, import_react13.useState)(false);
2087
2089
  const { theme } = useWarqadConfig();
2088
2090
  const primaryColor = theme?.primaryColor;
2089
- let message13 = error;
2091
+ let message14 = error;
2090
2092
  if (form && name) {
2091
2093
  const {
2092
2094
  formState: { errors }
2093
2095
  } = form;
2094
2096
  const errorObj = name.split(".").reduce((acc, current) => acc?.[current], errors);
2095
- message13 = errorObj?.message;
2097
+ message14 = errorObj?.message;
2096
2098
  }
2097
2099
  const renderInput = (inputProps, ref2) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: `space-y-2 group w-full! relative ${containerClassName}`, children: [
2098
2100
  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
@@ -2130,7 +2132,7 @@ var Textarea = (0, import_react13.forwardRef)(
2130
2132
  }
2131
2133
  }
2132
2134
  ) }),
2133
- message13 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message13 })
2135
+ message14 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message14 })
2134
2136
  ] });
2135
2137
  (0, import_react13.useEffect)(() => {
2136
2138
  if (form && name && props.value !== void 0 && props.value !== null && props.value !== "") {
@@ -2616,7 +2618,7 @@ var SearchApiRoot = ({
2616
2618
  const filteredOptions = options.filter(
2617
2619
  (option) => !filter.includes(getOptionValue(option))
2618
2620
  );
2619
- let message13 = error || errorMessage;
2621
+ let message14 = error || errorMessage;
2620
2622
  if (form && name) {
2621
2623
  const {
2622
2624
  formState: { errors }
@@ -2626,7 +2628,7 @@ var SearchApiRoot = ({
2626
2628
  for (const part of nameParts) {
2627
2629
  currentError = currentError?.[part];
2628
2630
  }
2629
- message13 = currentError?.message || message13;
2631
+ message14 = currentError?.message || message14;
2630
2632
  }
2631
2633
  const valueCtx = {
2632
2634
  isOpen,
@@ -2660,7 +2662,7 @@ var SearchApiRoot = ({
2660
2662
  form,
2661
2663
  name,
2662
2664
  obj,
2663
- error: message13,
2665
+ error: message14,
2664
2666
  onSelect,
2665
2667
  onClear
2666
2668
  };
@@ -3027,19 +3029,19 @@ var DateInput = (0, import_react16.forwardRef)(
3027
3029
  const { theme } = useWarqadConfig();
3028
3030
  const primaryColor = theme?.primaryColor;
3029
3031
  const [isFocused, setIsFocused] = (0, import_react16.useState)(false);
3030
- let message13 = error;
3032
+ let message14 = error;
3031
3033
  if (form && name) {
3032
3034
  const {
3033
3035
  formState: { errors }
3034
3036
  } = form;
3035
3037
  const errorObj = name.split(".").reduce((acc, current) => acc?.[current], errors);
3036
- message13 = errorObj?.message;
3038
+ message14 = errorObj?.message;
3037
3039
  }
3038
3040
  const inputStyles = `w-full px-2.5 py-1 rounded-md border! shadow-none transition-all! duration-200! outline-none!
3039
3041
  bg-white! dark:bg-zinc-900!
3040
3042
  text-gray-900! dark:text-zinc-100!
3041
3043
  hover:bg-white! dark:hover:bg-zinc-900!
3042
- ${message13 ? "border-red-500 hover:border-red-500 [&.ant-picker-focused]:border-red-500 [&.ant-picker-focused]:ring-red-500/20" : "border-gray-200 dark:border-zinc-700 hover:border-gray-200 dark:hover:border-zinc-700 [&.ant-picker-focused]:ring-2"}
3044
+ ${message14 ? "border-red-500 hover:border-red-500 [&.ant-picker-focused]:border-red-500 [&.ant-picker-focused]:ring-red-500/20" : "border-gray-200 dark:border-zinc-700 hover:border-gray-200 dark:hover:border-zinc-700 [&.ant-picker-focused]:ring-2"}
3043
3045
  [&.ant-picker-focused]:bg-white dark:[&.ant-picker-focused]:bg-zinc-900
3044
3046
  ${className}`;
3045
3047
  const renderDatePicker = (val, changeHandler, blurHandler, refProps) => {
@@ -3062,8 +3064,8 @@ var DateInput = (0, import_react16.forwardRef)(
3062
3064
  needConfirm: false,
3063
3065
  style: {
3064
3066
  height: "var(--input-height, 40px)",
3065
- borderColor: isFocused && !message13 ? primaryColor : void 0,
3066
- boxShadow: isFocused && !message13 ? `${primaryColor}33 0px 0px 0px 2px` : void 0
3067
+ borderColor: isFocused && !message14 ? primaryColor : void 0,
3068
+ boxShadow: isFocused && !message14 ? `${primaryColor}33 0px 0px 0px 2px` : void 0
3067
3069
  },
3068
3070
  classNames: { popup: { root: "z-50" } },
3069
3071
  suffixIcon: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
@@ -3093,7 +3095,7 @@ var DateInput = (0, import_react16.forwardRef)(
3093
3095
  {
3094
3096
  className: "block text-xs font-medium transition-colors duration-200",
3095
3097
  style: {
3096
- color: message13 ? "#ef4444" : isFocused ? primaryColor : void 0
3098
+ color: message14 ? "#ef4444" : isFocused ? primaryColor : void 0
3097
3099
  },
3098
3100
  children: [
3099
3101
  label,
@@ -3114,7 +3116,7 @@ var DateInput = (0, import_react16.forwardRef)(
3114
3116
  )
3115
3117
  }
3116
3118
  ) : renderDatePicker(value, onChange, onBlur, ref),
3117
- message13 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message13 })
3119
+ message14 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message14 })
3118
3120
  ] });
3119
3121
  }
3120
3122
  );
@@ -7383,17 +7385,17 @@ var preWarningFns = [];
7383
7385
  var preMessage = (fn) => {
7384
7386
  preWarningFns.push(fn);
7385
7387
  };
7386
- function warning(valid, message13) {
7388
+ function warning(valid, message14) {
7387
7389
  if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) {
7388
- const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? "", "warning"), message13);
7390
+ const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? "", "warning"), message14);
7389
7391
  if (finalMessage) {
7390
7392
  console.error(`Warning: ${finalMessage}`);
7391
7393
  }
7392
7394
  }
7393
7395
  }
7394
- function note(valid, message13) {
7396
+ function note(valid, message14) {
7395
7397
  if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) {
7396
- const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? "", "note"), message13);
7398
+ const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? "", "note"), message14);
7397
7399
  if (finalMessage) {
7398
7400
  console.warn(`Note: ${finalMessage}`);
7399
7401
  }
@@ -7402,17 +7404,17 @@ function note(valid, message13) {
7402
7404
  function resetWarned() {
7403
7405
  warned = {};
7404
7406
  }
7405
- function call(method, valid, message13) {
7406
- if (!valid && !warned[message13]) {
7407
- method(false, message13);
7408
- warned[message13] = true;
7407
+ function call(method, valid, message14) {
7408
+ if (!valid && !warned[message14]) {
7409
+ method(false, message14);
7410
+ warned[message14] = true;
7409
7411
  }
7410
7412
  }
7411
- function warningOnce(valid, message13) {
7412
- call(warning, valid, message13);
7413
+ function warningOnce(valid, message14) {
7414
+ call(warning, valid, message14);
7413
7415
  }
7414
- function noteOnce(valid, message13) {
7415
- call(note, valid, message13);
7416
+ function noteOnce(valid, message14) {
7417
+ call(note, valid, message14);
7416
7418
  }
7417
7419
  warningOnce.preMessage = preMessage;
7418
7420
  warningOnce.resetWarned = resetWarned;
@@ -7423,8 +7425,8 @@ var import_react30 = __toESM(require("react"));
7423
7425
  function camelCase(input) {
7424
7426
  return input.replace(/-(.)/g, (match, g) => g.toUpperCase());
7425
7427
  }
7426
- function warning2(valid, message13) {
7427
- warningOnce(valid, `[@ant-design/icons] ${message13}`);
7428
+ function warning2(valid, message14) {
7429
+ warningOnce(valid, `[@ant-design/icons] ${message14}`);
7428
7430
  }
7429
7431
  function isIconDefinition(target) {
7430
7432
  return typeof target === "object" && typeof target.name === "string" && typeof target.theme === "string" && (typeof target.icon === "object" || typeof target.icon === "function");
@@ -8330,6 +8332,13 @@ var resetPasswordSchema = import_zod4.z.object({
8330
8332
  token: import_zod4.z.string().min(1, { message: "Token is required" }),
8331
8333
  password: import_zod4.z.string().min(6, { message: "Password must be at least 6 characters" })
8332
8334
  });
8335
+ var createUserSchema = import_zod4.z.object({
8336
+ email: import_zod4.z.string().refine((val) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(val), {
8337
+ message: "Please enter a valid email address"
8338
+ }).transform((val) => val?.toLowerCase()),
8339
+ phoneNumber: import_zod4.z.string().optional(),
8340
+ role: import_zod4.z.enum(["admin"])
8341
+ });
8333
8342
 
8334
8343
  // src/components/users/linkUser.tsx
8335
8344
  var import_react_hook_form9 = require("react-hook-form");
@@ -8608,7 +8617,8 @@ var import_jsx_runtime46 = require("react/jsx-runtime");
8608
8617
  function UpdateEmailForm({
8609
8618
  data,
8610
8619
  close,
8611
- reload
8620
+ reload,
8621
+ app = ""
8612
8622
  }) {
8613
8623
  const { put, isLoading } = useApis_default();
8614
8624
  const currentEmail = data?.email;
@@ -8623,7 +8633,7 @@ function UpdateEmailForm({
8623
8633
  const onSubmit = async (formData) => {
8624
8634
  try {
8625
8635
  await put({
8626
- url: `/users/change_email/${data._id}`,
8636
+ url: `${app}/users/change_email/${data._id}`,
8627
8637
  body: {
8628
8638
  email: formData.newEmail
8629
8639
  }
@@ -8696,7 +8706,8 @@ var { Countdown: Countdown2 } = import_antd11.Statistic;
8696
8706
  function ResetPasswordForm({
8697
8707
  data,
8698
8708
  close,
8699
- reload
8709
+ reload,
8710
+ app = ""
8700
8711
  }) {
8701
8712
  const { put, isLoading } = useApis_default();
8702
8713
  const [datas, setDatas] = (0, import_react37.useState)(data);
@@ -8705,7 +8716,9 @@ function ResetPasswordForm({
8705
8716
  );
8706
8717
  (0, import_react37.useEffect)(() => {
8707
8718
  setDatas(data);
8708
- setHasPassed(data?.passwordReset?.passed || !data?.passwordReset?.createdAt);
8719
+ setHasPassed(
8720
+ data?.passwordReset?.passed || !data?.passwordReset?.createdAt
8721
+ );
8709
8722
  }, [data]);
8710
8723
  const userEmail = data?.email;
8711
8724
  const methods = (0, import_react_hook_form12.useForm)({
@@ -8728,7 +8741,7 @@ function ResetPasswordForm({
8728
8741
  const resendToken = async () => {
8729
8742
  try {
8730
8743
  const res = await put({
8731
- url: `/users/reset_password/${data._id}`,
8744
+ url: `${app}/users/reset_password/${data._id}`,
8732
8745
  body: {
8733
8746
  email: userEmail
8734
8747
  }
@@ -8799,22 +8812,26 @@ var ResetPasswordForm_default = ResetPasswordForm;
8799
8812
  var import_antd12 = require("antd");
8800
8813
  var import_react38 = require("react");
8801
8814
  var import_jsx_runtime48 = require("react/jsx-runtime");
8802
- var ActivateUser = ({ data }) => {
8815
+ var ActivateUser = ({ data, app = "" }) => {
8803
8816
  const [checked, setChecked] = (0, import_react38.useState)(data?.isActive);
8804
8817
  const { put, isLoading } = useApis_default();
8805
8818
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_jsx_runtime48.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
8806
8819
  import_antd12.Switch,
8807
8820
  {
8808
8821
  onChange: async (e) => {
8809
- const res = await put({
8810
- url: `/users/activate/${data?._id}`,
8811
- v: 1,
8812
- body: { isActive: e }
8813
- });
8814
- import_antd12.message.success(
8815
- res?.data?.isActive ? "User Activated" : "User Deactivated"
8816
- );
8817
- setChecked(res?.data?.isActive);
8822
+ try {
8823
+ const res = await put({
8824
+ url: `${app}/users/activate/${data?._id}`,
8825
+ v: 1,
8826
+ body: { isActive: e }
8827
+ });
8828
+ import_antd12.message.success(
8829
+ res?.data?.isActive ? "User Activated" : "User Deactivated"
8830
+ );
8831
+ setChecked(res?.data?.isActive);
8832
+ } catch (error) {
8833
+ import_antd12.message.error(error?.message || "Failed to update user status");
8834
+ }
8818
8835
  },
8819
8836
  loading: isLoading,
8820
8837
  checked,
@@ -8825,15 +8842,17 @@ var ActivateUser = ({ data }) => {
8825
8842
  var Activate_default = ActivateUser;
8826
8843
 
8827
8844
  // src/components/users/users.tsx
8845
+ var import_react_router_dom7 = require("react-router-dom");
8828
8846
  var import_jsx_runtime49 = require("react/jsx-runtime");
8829
8847
  function Users() {
8848
+ const { appId: app = "" } = (0, import_react_router_dom7.useParams)();
8849
+ const navigate = (0, import_react_router_dom7.useNavigate)();
8830
8850
  const { data, TransactionViewComponent, reload } = useTransaction_default({
8831
- url: "/users/get",
8851
+ url: `${app}/users/get`,
8832
8852
  v: 1,
8833
8853
  dateFilter: false
8834
8854
  });
8835
8855
  const { Modal: Modal2, openState, close } = useModal();
8836
- const { put, isLoading } = useApis_default();
8837
8856
  const items = (data2) => [
8838
8857
  {
8839
8858
  label: `Reset Password`,
@@ -8845,6 +8864,7 @@ function Users() {
8845
8864
  ResetPasswordForm_default,
8846
8865
  {
8847
8866
  data: data2,
8867
+ app,
8848
8868
  close: () => close(),
8849
8869
  reload: () => reload()
8850
8870
  }
@@ -8863,7 +8883,8 @@ function Users() {
8863
8883
  {
8864
8884
  data: data2,
8865
8885
  close: () => close(),
8866
- reload: () => reload()
8886
+ reload: () => reload(),
8887
+ app
8867
8888
  }
8868
8889
  ),
8869
8890
  width: 600
@@ -8910,12 +8931,27 @@ function Users() {
8910
8931
  ] });
8911
8932
  }
8912
8933
  },
8934
+ {
8935
+ accessorKey: "role",
8936
+ header: "Role",
8937
+ cell: ({ row }) => {
8938
+ const data2 = row.original;
8939
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
8940
+ Badge,
8941
+ {
8942
+ variant: data2?.role === "admin" ? "primary" : "warning",
8943
+ size: "sm",
8944
+ children: data2?.role || "N/A"
8945
+ }
8946
+ );
8947
+ }
8948
+ },
8913
8949
  {
8914
8950
  accessorKey: "account.name",
8915
8951
  header: "Employee Name",
8916
8952
  cell: ({ row }) => {
8917
8953
  const account = row.original?.account;
8918
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: account?.name });
8954
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: account?.name || "N/A" });
8919
8955
  }
8920
8956
  },
8921
8957
  {
@@ -8923,7 +8959,7 @@ function Users() {
8923
8959
  header: "Status",
8924
8960
  cell: ({ row }) => {
8925
8961
  const data2 = row.original;
8926
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Activate_default, { data: data2 });
8962
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Activate_default, { data: data2, app });
8927
8963
  }
8928
8964
  },
8929
8965
  {
@@ -8955,7 +8991,9 @@ function Users() {
8955
8991
  data: users,
8956
8992
  index: true,
8957
8993
  title: "User",
8958
- description: "Manage users"
8994
+ description: "Manage users",
8995
+ createTitle: "Add User",
8996
+ onCreate: () => navigate("/users/create")
8959
8997
  }
8960
8998
  ),
8961
8999
  " "
@@ -8963,15 +9001,99 @@ function Users() {
8963
9001
  }
8964
9002
  var users_default = Users;
8965
9003
 
8966
- // src/components/users/ResetPasswordPage.tsx
8967
- var import_react40 = require("react");
8968
- var import_react_router_dom7 = require("react-router-dom");
8969
- var import_lucide_react21 = require("lucide-react");
9004
+ // src/components/users/UserForm.tsx
8970
9005
  var import_react_hook_form13 = require("react-hook-form");
8971
9006
  var import_zod8 = require("@hookform/resolvers/zod");
8972
- var z4 = __toESM(require("zod"));
8973
9007
  var import_antd13 = require("antd");
9008
+ var import_react_router_dom8 = require("react-router-dom");
8974
9009
  var import_jsx_runtime50 = require("react/jsx-runtime");
9010
+ function UserForm() {
9011
+ const { appId: app = "" } = (0, import_react_router_dom8.useParams)();
9012
+ const { navigate } = useApp_default();
9013
+ const { post, isLoading } = useApis_default();
9014
+ const methods = (0, import_react_hook_form13.useForm)({
9015
+ resolver: (0, import_zod8.zodResolver)(createUserSchema),
9016
+ defaultValues: {
9017
+ email: "",
9018
+ phoneNumber: "",
9019
+ role: "admin"
9020
+ }
9021
+ });
9022
+ const { handleSubmit } = methods;
9023
+ const onSubmit = async (data) => {
9024
+ try {
9025
+ await post({
9026
+ url: `${app}/users/create`,
9027
+ body: data
9028
+ });
9029
+ import_antd13.message.success("User created successfully");
9030
+ navigate(-1);
9031
+ } catch (error) {
9032
+ import_antd13.message.error(error?.message || "Something went wrong");
9033
+ }
9034
+ };
9035
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Card, { className: "max-w-xl mx-auto mt-10 relative", children: [
9036
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Card.Header, { children: [
9037
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Card.Title, { children: "Add User" }),
9038
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Card.Description, { children: "Create a new user by providing their email and phone number." })
9039
+ ] }),
9040
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Card.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("form", { onSubmit: handleSubmit(onSubmit), children: [
9041
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "space-y-4", children: [
9042
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9043
+ Fields_default.Input,
9044
+ {
9045
+ label: "Email",
9046
+ form: methods,
9047
+ name: "email",
9048
+ type: "email",
9049
+ placeholder: "e.g. user@example.com",
9050
+ required: true
9051
+ }
9052
+ ),
9053
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9054
+ Fields_default.PhoneInput,
9055
+ {
9056
+ label: "Phone Number",
9057
+ form: methods,
9058
+ name: "phoneNumber",
9059
+ placeholder: "Enter phone number"
9060
+ }
9061
+ ),
9062
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9063
+ Fields_default.Select,
9064
+ {
9065
+ label: "Role",
9066
+ form: methods,
9067
+ name: "role",
9068
+ options: [{ label: "Admin", value: "admin" }],
9069
+ required: true
9070
+ }
9071
+ )
9072
+ ] }),
9073
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("footer", { className: "flex justify-end mt-6", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9074
+ Button,
9075
+ {
9076
+ isLoading,
9077
+ disabled: isLoading,
9078
+ type: "submit",
9079
+ className: "min-w-[100px]",
9080
+ children: "Add User"
9081
+ }
9082
+ ) })
9083
+ ] }) })
9084
+ ] });
9085
+ }
9086
+ var UserForm_default = UserForm;
9087
+
9088
+ // src/components/users/ResetPasswordPage.tsx
9089
+ var import_react40 = require("react");
9090
+ var import_react_router_dom9 = require("react-router-dom");
9091
+ var import_lucide_react21 = require("lucide-react");
9092
+ var import_react_hook_form14 = require("react-hook-form");
9093
+ var import_zod9 = require("@hookform/resolvers/zod");
9094
+ var z4 = __toESM(require("zod"));
9095
+ var import_antd14 = require("antd");
9096
+ var import_jsx_runtime51 = require("react/jsx-runtime");
8975
9097
  var resetPageSchema = z4.object({
8976
9098
  password: z4.string().min(6, "Password must be at least 6 characters"),
8977
9099
  confirmPassword: z4.string().min(6, "Password must be at least 6 characters")
@@ -8980,8 +9102,8 @@ var resetPageSchema = z4.object({
8980
9102
  path: ["confirmPassword"]
8981
9103
  });
8982
9104
  function ResetPasswordPage() {
8983
- const [searchParams] = (0, import_react_router_dom7.useSearchParams)();
8984
- const navigate = (0, import_react_router_dom7.useNavigate)();
9105
+ const [searchParams] = (0, import_react_router_dom9.useSearchParams)();
9106
+ const navigate = (0, import_react_router_dom9.useNavigate)();
8985
9107
  const { put, isLoading } = useApis_default();
8986
9108
  const [isVerified, setIsVerified] = (0, import_react40.useState)(false);
8987
9109
  const [verifying, setVerifying] = (0, import_react40.useState)(true);
@@ -8989,8 +9111,8 @@ function ResetPasswordPage() {
8989
9111
  const token = searchParams.get("token");
8990
9112
  const email = searchParams.get("email");
8991
9113
  const id = searchParams.get("id");
8992
- const methods = (0, import_react_hook_form13.useForm)({
8993
- resolver: (0, import_zod8.zodResolver)(resetPageSchema),
9114
+ const methods = (0, import_react_hook_form14.useForm)({
9115
+ resolver: (0, import_zod9.zodResolver)(resetPageSchema),
8994
9116
  defaultValues: {
8995
9117
  password: "",
8996
9118
  confirmPassword: ""
@@ -9028,23 +9150,23 @@ function ResetPasswordPage() {
9028
9150
  password: data.password
9029
9151
  }
9030
9152
  });
9031
- import_antd13.message.success(
9153
+ import_antd14.message.success(
9032
9154
  "Password has been reset successfully. You can now login."
9033
9155
  );
9034
9156
  navigate("/login", { replace: true });
9035
9157
  } catch (err) {
9036
- import_antd13.message.error(err?.message || "Failed to reset password.");
9158
+ import_antd14.message.error(err?.message || "Failed to reset password.");
9037
9159
  }
9038
9160
  };
9039
9161
  if (verifying) {
9040
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "h-screen w-full flex items-center justify-center bg-slate-50 dark:bg-[#0A0B10]", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "text-center space-y-4", children: [
9041
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_antd13.Spin, { size: "large" }),
9042
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "text-slate-500 animate-pulse", children: "Verifying reset link..." })
9162
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "h-screen w-full flex items-center justify-center bg-slate-50 dark:bg-[#0A0B10]", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "text-center space-y-4", children: [
9163
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_antd14.Spin, { size: "large" }),
9164
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "text-slate-500 animate-pulse", children: "Verifying reset link..." })
9043
9165
  ] }) });
9044
9166
  }
9045
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex h-screen w-full overflow-hidden bg-white dark:bg-[#0A0B10]", children: [
9046
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "hidden lg:flex lg:w-1/2 relative overflow-hidden bg-slate-900 border-r border-slate-800", children: [
9047
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9167
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex h-screen w-full overflow-hidden bg-white dark:bg-[#0A0B10]", children: [
9168
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "hidden lg:flex lg:w-1/2 relative overflow-hidden bg-slate-900 border-r border-slate-800", children: [
9169
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
9048
9170
  "div",
9049
9171
  {
9050
9172
  className: "absolute inset-0 z-0 opacity-40 bg-cover bg-center",
@@ -9053,35 +9175,35 @@ function ResetPasswordPage() {
9053
9175
  }
9054
9176
  }
9055
9177
  ),
9056
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "absolute inset-0 bg-linear-to-tr from-[#0A0B10] via-transparent to-indigo-500/10 z-10" }),
9057
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "relative z-20 p-12 flex flex-col justify-between w-full h-full", children: [
9058
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-3", children: [
9059
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "h-10 w-10 bg-indigo-600 rounded-lg flex items-center justify-center shadow-indigo-500/20 shadow-xl", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react21.Terminal, { className: "text-white w-6 h-6" }) }),
9060
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-2xl font-bold text-white tracking-widest uppercase", children: "Warqad UI" })
9178
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "absolute inset-0 bg-linear-to-tr from-[#0A0B10] via-transparent to-indigo-500/10 z-10" }),
9179
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "relative z-20 p-12 flex flex-col justify-between w-full h-full", children: [
9180
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-3", children: [
9181
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "h-10 w-10 bg-indigo-600 rounded-lg flex items-center justify-center shadow-indigo-500/20 shadow-xl", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react21.Terminal, { className: "text-white w-6 h-6" }) }),
9182
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-2xl font-bold text-white tracking-widest uppercase", children: "Warqad UI" })
9061
9183
  ] }),
9062
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "max-w-md", children: [
9063
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("h1", { className: "text-5xl font-extrabold text-white mb-6 leading-tight", children: [
9184
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "max-w-md", children: [
9185
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("h1", { className: "text-5xl font-extrabold text-white mb-6 leading-tight", children: [
9064
9186
  "Secure ",
9065
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-indigo-400", children: "Access" }),
9187
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-indigo-400", children: "Access" }),
9066
9188
  " ",
9067
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("br", {}),
9189
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("br", {}),
9068
9190
  " ",
9069
9191
  "Simplified."
9070
9192
  ] }),
9071
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "text-slate-400 text-lg leading-relaxed", children: "Reset your credentials securely and regain access to your dashboard in minutes." })
9193
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "text-slate-400 text-lg leading-relaxed", children: "Reset your credentials securely and regain access to your dashboard in minutes." })
9072
9194
  ] }),
9073
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "text-slate-500 text-sm italic", children: "Trusted by developers worldwide." })
9195
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "text-slate-500 text-sm italic", children: "Trusted by developers worldwide." })
9074
9196
  ] })
9075
9197
  ] }),
9076
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("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: [
9077
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ThemeToggle, {}) }),
9078
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "max-w-md w-full mx-auto", children: !isVerified || error ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "text-center space-y-6", children: [
9079
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("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__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react21.ShieldCheck, { className: "text-red-600 dark:text-red-400 w-8 h-8" }) }),
9080
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { children: [
9081
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h2", { className: "text-3xl font-bold text-slate-900 dark:text-white mb-2", children: "Link Invalid" }),
9082
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "text-slate-500 dark:text-slate-400", children: error || "The reset link is invalid or has already been used." })
9198
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("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: [
9199
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ThemeToggle, {}) }),
9200
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "max-w-md w-full mx-auto", children: !isVerified || error ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "text-center space-y-6", children: [
9201
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("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__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react21.ShieldCheck, { className: "text-red-600 dark:text-red-400 w-8 h-8" }) }),
9202
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
9203
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("h2", { className: "text-3xl font-bold text-slate-900 dark:text-white mb-2", children: "Link Invalid" }),
9204
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "text-slate-500 dark:text-slate-400", children: error || "The reset link is invalid or has already been used." })
9083
9205
  ] }),
9084
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9206
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
9085
9207
  Button,
9086
9208
  {
9087
9209
  onClick: () => navigate("/login"),
@@ -9089,22 +9211,22 @@ function ResetPasswordPage() {
9089
9211
  children: "Back to Login"
9090
9212
  }
9091
9213
  )
9092
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
9093
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "mb-10", children: [
9094
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h2", { className: "text-3xl font-bold text-slate-900 dark:text-white mb-3 tracking-tight", children: "Reset Password" }),
9095
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("p", { className: "text-slate-500 dark:text-slate-400", children: [
9214
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
9215
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "mb-10", children: [
9216
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("h2", { className: "text-3xl font-bold text-slate-900 dark:text-white mb-3 tracking-tight", children: "Reset Password" }),
9217
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("p", { className: "text-slate-500 dark:text-slate-400", children: [
9096
9218
  "Set a new, strong password for",
9097
9219
  " ",
9098
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-indigo-600 font-medium", children: email })
9220
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-indigo-600 font-medium", children: email })
9099
9221
  ] })
9100
9222
  ] }),
9101
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
9223
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
9102
9224
  "form",
9103
9225
  {
9104
9226
  onSubmit: methods.handleSubmit(onSubmit),
9105
9227
  className: "space-y-6",
9106
9228
  children: [
9107
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9229
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
9108
9230
  Fields_default.Input,
9109
9231
  {
9110
9232
  form: methods,
@@ -9113,11 +9235,11 @@ function ResetPasswordPage() {
9113
9235
  type: "password",
9114
9236
  placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
9115
9237
  required: true,
9116
- icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react21.Lock, { size: 18, className: "text-slate-400" }),
9238
+ icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react21.Lock, { size: 18, className: "text-slate-400" }),
9117
9239
  className: "bg-slate-50 dark:bg-slate-900/50 h-12"
9118
9240
  }
9119
9241
  ),
9120
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9242
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
9121
9243
  Fields_default.Input,
9122
9244
  {
9123
9245
  form: methods,
@@ -9126,11 +9248,11 @@ function ResetPasswordPage() {
9126
9248
  type: "password",
9127
9249
  placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
9128
9250
  required: true,
9129
- icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react21.ShieldCheck, { size: 18, className: "text-slate-400" }),
9251
+ icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react21.ShieldCheck, { size: 18, className: "text-slate-400" }),
9130
9252
  className: "bg-slate-50 dark:bg-slate-900/50 h-12"
9131
9253
  }
9132
9254
  ),
9133
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
9255
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
9134
9256
  Button,
9135
9257
  {
9136
9258
  type: "submit",
@@ -9138,7 +9260,7 @@ function ResetPasswordPage() {
9138
9260
  className: "w-full h-12 bg-indigo-600 hover:bg-indigo-500 text-white font-semibold flex items-center justify-center gap-2",
9139
9261
  children: [
9140
9262
  "Update Password",
9141
- !isLoading && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react21.ArrowRight, { size: 18 })
9263
+ !isLoading && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react21.ArrowRight, { size: 18 })
9142
9264
  ]
9143
9265
  }
9144
9266
  )
@@ -9153,9 +9275,9 @@ var ResetPasswordPage_default = ResetPasswordPage;
9153
9275
 
9154
9276
  // src/components/users/UserProfile.tsx
9155
9277
  var import_lucide_react22 = require("lucide-react");
9156
- var import_react_router_dom8 = require("react-router-dom");
9157
- var import_antd14 = require("antd");
9158
- var import_jsx_runtime51 = require("react/jsx-runtime");
9278
+ var import_react_router_dom10 = require("react-router-dom");
9279
+ var import_antd15 = require("antd");
9280
+ var import_jsx_runtime52 = require("react/jsx-runtime");
9159
9281
  var UserProfile = ({
9160
9282
  items,
9161
9283
  name,
@@ -9166,7 +9288,7 @@ var UserProfile = ({
9166
9288
  }) => {
9167
9289
  const { post } = useApis_default();
9168
9290
  const { user, logout: authLogout, account } = useAuth_default();
9169
- const navigate = (0, import_react_router_dom8.useNavigate)();
9291
+ const navigate = (0, import_react_router_dom10.useNavigate)();
9170
9292
  const logout = async () => {
9171
9293
  if (onLogout) {
9172
9294
  onLogout();
@@ -9177,32 +9299,32 @@ var UserProfile = ({
9177
9299
  url: `/users/logout/${user?._id}`,
9178
9300
  v: 1
9179
9301
  });
9180
- import_antd14.message.success("Logout successfully");
9302
+ import_antd15.message.success("Logout successfully");
9181
9303
  authLogout();
9182
9304
  navigate("/login");
9183
9305
  } catch (error) {
9184
9306
  console.log(error);
9185
- import_antd14.message.error(error?.message);
9307
+ import_antd15.message.error(error?.message);
9186
9308
  }
9187
9309
  };
9188
9310
  const defaultItems = [
9189
9311
  {
9190
9312
  label: "My Profile",
9191
- icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react22.User, { size: 18 }),
9313
+ icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react22.User, { size: 18 }),
9192
9314
  onClick: () => navigate("/profile"),
9193
9315
  className: "min-w-[150px]"
9194
9316
  },
9195
9317
  {
9196
9318
  label: "Logout",
9197
- icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react22.LogOut, { size: 18 }),
9319
+ icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react22.LogOut, { size: 18 }),
9198
9320
  onClick: logout,
9199
9321
  className: "text-red-500 hover:bg-red-50 dark:hover:bg-red-950/20"
9200
9322
  }
9201
9323
  ];
9202
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-3", children: [
9203
- showThemeToggle && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ThemeToggle, {}),
9204
- showThemeToggle && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "w-px h-6 mx-2 bg-gray-200 dark:bg-gray-800" }),
9205
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
9324
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center gap-3", children: [
9325
+ showThemeToggle && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ThemeToggle, {}),
9326
+ showThemeToggle && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "w-px h-6 mx-2 bg-gray-200 dark:bg-gray-800" }),
9327
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
9206
9328
  ProfileDropdown,
9207
9329
  {
9208
9330
  name: name || account?.name || "User",
@@ -9218,14 +9340,14 @@ var UserProfile = ({
9218
9340
  var UserProfile_default = UserProfile;
9219
9341
 
9220
9342
  // src/components/users/ProfilePage.tsx
9221
- var import_react_router_dom9 = require("react-router-dom");
9343
+ var import_react_router_dom11 = require("react-router-dom");
9222
9344
  var import_lucide_react23 = require("lucide-react");
9223
- var import_jsx_runtime52 = require("react/jsx-runtime");
9345
+ var import_jsx_runtime53 = require("react/jsx-runtime");
9224
9346
  var ProfilePage = () => {
9225
- const navigate = (0, import_react_router_dom9.useNavigate)();
9347
+ const navigate = (0, import_react_router_dom11.useNavigate)();
9226
9348
  const { user, account } = useAuth();
9227
9349
  if (!user) {
9228
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h1", { children: "Please login to view your profile" }) });
9350
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h1", { children: "Please login to view your profile" }) });
9229
9351
  }
9230
9352
  const extraInfo = [
9231
9353
  {
@@ -9244,19 +9366,19 @@ var ProfilePage = () => {
9244
9366
  copiable: false
9245
9367
  }
9246
9368
  ];
9247
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "p-4 sm:p-8 space-y-6", children: [
9248
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "max-w-5xl mx-auto", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
9369
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "p-4 sm:p-8 space-y-6", children: [
9370
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "max-w-5xl mx-auto", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
9249
9371
  Button,
9250
9372
  {
9251
9373
  variant: "outline",
9252
9374
  size: "sm",
9253
9375
  onClick: () => navigate(-1),
9254
- icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react23.ArrowLeft, { size: 16 }),
9376
+ icon: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react23.ArrowLeft, { size: 16 }),
9255
9377
  className: "rounded-full font-bold px-5",
9256
9378
  children: "Back"
9257
9379
  }
9258
9380
  ) }),
9259
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
9381
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
9260
9382
  ProfileView,
9261
9383
  {
9262
9384
  name: account?.name || "User Account",
@@ -9326,11 +9448,13 @@ var ProfilePage_default = ProfilePage;
9326
9448
  ThemeToggle,
9327
9449
  ThemedLogin,
9328
9450
  UnProtectedRoute,
9451
+ UserForm,
9329
9452
  UserProfile,
9330
9453
  Users,
9331
9454
  Views,
9332
9455
  WarqadProvider,
9333
9456
  createAccountSchema,
9457
+ createUserSchema,
9334
9458
  generatePdf,
9335
9459
  linkUserSchema,
9336
9460
  resetPasswordSchema,