@ukpc-lib/react 0.2.20 → 0.2.21

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.
@@ -1,5 +1,5 @@
1
- import { C as an, p as Zn, a as Uc, L as co, u as Yc, i as Gc, g as qc, Q as ga, R as Kc, l as Xc, c as kn, s as On, t as Vr, _ as W, b as st, P as R, d as Fe, e as Zc, o as Jc, f as Qc, h as eu, j as uo, I as tu, k as nu, m as fo, D as ru, n as ut, r as iu, q as ou, B as su, v as Mn } from "../index.module-c4038cae.js";
2
- import { w as Z3, x as J3 } from "../index.module-c4038cae.js";
1
+ import { C as an, p as Zn, a as Uc, L as co, u as Yc, i as Gc, g as qc, Q as ga, R as Kc, l as Xc, c as kn, s as On, t as Vr, _ as W, b as st, P as R, d as Fe, e as Zc, o as Jc, f as Qc, h as eu, j as uo, I as tu, k as nu, m as fo, D as ru, n as ut, r as iu, q as ou, B as su, v as Mn } from "../index.module-1315f6d2.js";
2
+ import { w as Z3, x as J3 } from "../index.module-1315f6d2.js";
3
3
  import { jsxs as k, Fragment as yn, jsx as g } from "react/jsx-runtime";
4
4
  import * as N from "react";
5
5
  import ya, { useContext as ie, useState as K, useEffect as be, useRef as ze, createContext as jt, useLayoutEffect as wi, useInsertionEffect as au, useCallback as Qt, useMemo as hr, forwardRef as va, createElement as en, useId as lu, PureComponent as cu } from "react";
@@ -141,7 +141,7 @@ const Cu = (e) => {
141
141
  /* @__PURE__ */ g("div", { className: "notification-item__image-container", children: /* @__PURE__ */ g(
142
142
  "img",
143
143
  {
144
- src: e.userAvatarUrl === void 0 ? "https://ukpcsaprod.blob.core.windows.net/account/logo.png" : e.userAvatarUrl,
144
+ src: (e == null ? void 0 : e.userAvatarUrl) === void 0 ? "https://ukpcsaprod.blob.core.windows.net/account/logo.png" : e == null ? void 0 : e.userAvatarUrl,
145
145
  alt: e.userName
146
146
  }
147
147
  ) }),
@@ -149,7 +149,7 @@ const Cu = (e) => {
149
149
  /* @__PURE__ */ g("p", { className: "notification-item__user-name", children: e.userName }),
150
150
  /* @__PURE__ */ k("p", { children: [
151
151
  `${e.message} `,
152
- /* @__PURE__ */ g("span", { children: e.context })
152
+ /* @__PURE__ */ g("span", { children: e == null ? void 0 : e.context })
153
153
  ] })
154
154
  ] }),
155
155
  /* @__PURE__ */ g("div", { className: "notification-item__time", children: /* @__PURE__ */ g("p", { children: n(e.createdAt) }) }),
@@ -215,46 +215,47 @@ const Cu = (e) => {
215
215
  });
216
216
  });
217
217
  }, _u = ({ baseUrl: e, notiPath: t }) => {
218
+ var u, h, p, y;
218
219
  const { setShowModalFalse: n } = ie(an), { notidata: r, setNotiData: i } = ie(an);
219
220
  console.log(r);
220
221
  const [s, o] = K("all"), a = wa({ baseUrl: e, notiPath: t, setNotiData: i }), l = async () => {
221
- var u, h;
222
+ var f, m;
222
223
  try {
223
- const y = e + (t || "/notification-management/api/v1/notifications");
224
- await ln.put(y, {
224
+ const w = e + (t || "/notification-management/api/v1/notifications");
225
+ await ln.put(w, {
225
226
  withCredentials: !0
226
227
  });
227
- } catch (p) {
228
- console.log(p), Zn(
229
- ((h = (u = p.response) == null ? void 0 : u.data) == null ? void 0 : h.errorMessage) || "Have error when get notification list"
228
+ } catch (b) {
229
+ console.log(b), Zn(
230
+ ((m = (f = b.response) == null ? void 0 : f.data) == null ? void 0 : m.errorMessage) || "Have error when get notification list"
230
231
  );
231
232
  }
232
233
  await a();
233
- }, c = async (u, h) => {
234
- var p, y;
234
+ }, c = async (f, m) => {
235
+ var b, w;
235
236
  try {
236
- const f = t || `/notification-management/api/v1/notifications/${u}`, m = e + f;
237
+ const x = t || `/notification-management/api/v1/notifications/${f}`, S = e + x;
237
238
  await ln.put(
238
- m,
239
- { isRead: h },
239
+ S,
240
+ { isRead: m },
240
241
  {
241
242
  withCredentials: !0
242
243
  }
243
244
  );
244
- } catch (f) {
245
+ } catch (x) {
245
246
  Zn(
246
- ((y = (p = f.response) == null ? void 0 : p.data) == null ? void 0 : y.errorMessage) || "Have error when get notification list"
247
+ ((w = (b = x.response) == null ? void 0 : b.data) == null ? void 0 : w.errorMessage) || "Have error when get notification list"
247
248
  );
248
249
  }
249
250
  await a();
250
251
  }, d = [
251
252
  {
252
253
  id: "all",
253
- tabTitle: `All (${r.all.total || 0})`,
254
+ tabTitle: `All (${((u = r == null ? void 0 : r.all) == null ? void 0 : u.total) || 0})`,
254
255
  children: /* @__PURE__ */ g(
255
256
  po,
256
257
  {
257
- notidata: r.all.rows,
258
+ notidata: ((h = r == null ? void 0 : r.all) == null ? void 0 : h.rows) || [],
258
259
  handleUpdateRead: c,
259
260
  handleUpdateReadAll: l
260
261
  }
@@ -262,11 +263,11 @@ const Cu = (e) => {
262
263
  },
263
264
  {
264
265
  id: "unread",
265
- tabTitle: `Unread (${r.unread.total || 0})`,
266
+ tabTitle: `Unread (${((p = r == null ? void 0 : r.unread) == null ? void 0 : p.total) || 0})`,
266
267
  children: /* @__PURE__ */ g(
267
268
  po,
268
269
  {
269
- notidata: r.unread.rows,
270
+ notidata: ((y = r == null ? void 0 : r.unread) == null ? void 0 : y.rows) || [],
270
271
  handleUpdateRead: c,
271
272
  handleUpdateReadAll: l
272
273
  }
@@ -343,13 +344,14 @@ function Pu({
343
344
  baseUrl: t,
344
345
  notiPath: n
345
346
  }) {
347
+ var c;
346
348
  const { isOpen: r, toggleOpen: i } = ie(an), { notidata: s, setNotiData: o } = ie(an), a = wa({ baseUrl: t, notiPath: n, setNotiData: o }), l = async () => {
347
- var c, d;
349
+ var d, u;
348
350
  try {
349
351
  await a();
350
- } catch (u) {
352
+ } catch (h) {
351
353
  Zn(
352
- ((d = (c = u.response) == null ? void 0 : c.data) == null ? void 0 : d.errorMessage) || "Have error when get notification list"
354
+ ((u = (d = h.response) == null ? void 0 : d.data) == null ? void 0 : u.errorMessage) || "Have error when get notification list"
353
355
  );
354
356
  }
355
357
  };
@@ -392,7 +394,7 @@ function Pu({
392
394
  ]
393
395
  }
394
396
  ),
395
- s.unread.total != 0 && /* @__PURE__ */ g(
397
+ (s == null ? void 0 : s.unread) && (s == null ? void 0 : s.unread.total) != 0 && /* @__PURE__ */ g(
396
398
  "span",
397
399
  {
398
400
  style: {
@@ -407,7 +409,7 @@ function Pu({
407
409
  fontSize: "8px"
408
410
  },
409
411
  className: "notification-badge",
410
- children: s.unread.total
412
+ children: (c = s == null ? void 0 : s.unread) == null ? void 0 : c.total
411
413
  }
412
414
  ),
413
415
  !r && /* @__PURE__ */ g(_u, { baseUrl: t, notiPath: n })