@bjsdistribution/dms-client-return 0.1.94-prod → 0.1.95-prod

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,77 +1,73 @@
1
- import { jsx as t, Fragment as D, jsxs as a } from "react/jsx-runtime";
2
- import P, { useState as k, useMemo as E } from "react";
3
- import { useClientData as O, useInternalSearchText as W } from "../../order-view/store.js";
4
- import { useStatsLoading as v } from "../store/store.js";
5
- import { StyledTableWrapper as b, StyledTable as A, EmptyDataContainer as U, ColumStyle as c, GreyBox as o } from "./table-data/styles.js";
6
- import { Skeleton as M, Empty as Y } from "antd";
7
- import { useNavigate as F } from "react-router-dom";
8
- import { filtersReducerAtom as G } from "../header-filters/filterStore.js";
1
+ import { jsx as t, Fragment as k, jsxs as s } from "react/jsx-runtime";
2
+ import P, { useState as O, useMemo as A } from "react";
3
+ import { useClientData as W, useInternalSearchText as v } from "../../order-view/store.js";
4
+ import { useStatsLoading as U } from "../store/store.js";
5
+ import { StyledTableWrapper as L, StyledTable as R, EmptyDataContainer as M, ColumStyle as c, GreyBox as o } from "./table-data/styles.js";
6
+ import { Skeleton as F, Empty as Y } from "antd";
7
+ import { useNavigate as G, NavLink as j } from "react-router-dom";
8
+ import { filtersReducerAtom as B } from "../header-filters/filterStore.js";
9
9
  import { useCustomerData as $ } from "../../store.js";
10
- import j from "../../../common/SortIcon.js";
11
- import L from "../../../common/CaretDownFilledIcon.js";
12
- import { useAtom as B } from "jotai";
13
- const rt = () => {
14
- const [u] = O(), [R] = v(), [, s] = B(G), m = F(), [S] = $(), [f] = W(), [h, T] = k(null), I = (r) => {
15
- T((l) => l?.key === r && l.direction === "asc" ? { key: r, direction: "desc" } : { key: r, direction: "asc" });
16
- }, g = E(() => (f && f?.length > 0 ? u || [] : S || [])?.map((n) => {
17
- const e = u?.find(
18
- (d) => d?.customer_id != null && d?.customer_id.toString() === n?.customer_id?.toString()
10
+ import q from "../../../common/SortIcon.js";
11
+ import T from "../../../common/CaretDownFilledIcon.js";
12
+ import { useAtom as z } from "jotai";
13
+ const C = (h, g) => {
14
+ const a = new URLSearchParams({
15
+ customerId: h?.toString()
16
+ });
17
+ return g && a.set("type", g), `/orders/view/return/filter?${a.toString()}`;
18
+ }, nt = () => {
19
+ const [h] = W(), [g] = U(), [, a] = z(B), x = G(), [S] = $(), [m] = v(), [p, y] = O(null), I = (r) => {
20
+ y((n) => n?.key === r && n.direction === "asc" ? { key: r, direction: "desc" } : { key: r, direction: "asc" });
21
+ }, f = A(() => (m && m?.length > 0 ? h || [] : S || [])?.map((d) => {
22
+ const e = h?.find(
23
+ (l) => l?.customer_id != null && l?.customer_id.toString() === d?.customer_id?.toString()
19
24
  );
20
- let i = n?.children?.map((d) => {
21
- const _ = u?.find(
22
- (x) => x?.customer_id != null && x?.customer_id.toString() === d?.customer_id?.toString()
25
+ let i = d?.children?.map((l) => {
26
+ const D = h?.find(
27
+ (b) => b?.customer_id != null && b?.customer_id.toString() === l?.customer_id?.toString()
23
28
  );
24
29
  return {
25
- ...d,
26
- ..._
30
+ ...l,
31
+ ...D
27
32
  };
28
33
  });
29
34
  return {
30
- ...n,
35
+ ...d,
31
36
  ...e,
32
37
  children: i
33
38
  };
34
- }) || [], [S, u, f]), C = E(() => {
35
- if (!g || !h) return g;
36
- const { key: r, direction: l } = h;
37
- return [...g].sort((n, e) => {
38
- const i = n[r], d = e[r];
39
- return typeof i == "number" && typeof d == "number" ? l === "asc" ? i - d : d - i : typeof i == "string" && typeof d == "string" ? l === "asc" ? i.localeCompare(d) : d.localeCompare(i) : 0;
39
+ }) || [], [S, h, m]), E = A(() => {
40
+ if (!f || !p) return f;
41
+ const { key: r, direction: n } = p;
42
+ return [...f].sort((d, e) => {
43
+ const i = d[r], l = e[r];
44
+ return typeof i == "number" && typeof l == "number" ? n === "asc" ? i - l : l - i : typeof i == "string" && typeof l == "string" ? n === "asc" ? i.localeCompare(l) : l.localeCompare(i) : 0;
40
45
  });
41
- }, [g, h]), y = (r) => !h || h.key !== r ? /* @__PURE__ */ t(j, {}) : h.direction === "asc" ? /* @__PURE__ */ t(L, {}) : /* @__PURE__ */ t(L, {}), N = (r) => {
42
- r ? (s({
46
+ }, [f, p]), N = (r) => !p || p.key !== r ? /* @__PURE__ */ t(q, {}) : p.direction === "asc" ? /* @__PURE__ */ t(T, {}) : /* @__PURE__ */ t(T, {}), _ = (r) => {
47
+ r ? (a({
43
48
  type: "SET_CLIENT_FILTER",
44
49
  payload: r
45
- }), s({
50
+ }), a({
46
51
  type: "SET_PAGE",
47
52
  payload: 1
48
- })) : s({
53
+ })) : a({
49
54
  type: "SET_CLIENT_FILTER",
50
55
  payload: []
51
- });
52
- const l = new URLSearchParams({
53
- customerId: r?.toString()
54
- });
55
- m(`/orders/view/return/filter?${l.toString()}`);
56
- }, p = (r, l) => {
57
- r ? (s({
56
+ }), x(C(r));
57
+ }, u = (r, n) => {
58
+ r ? (a({
58
59
  type: "SET_CLIENT_FILTER",
59
60
  payload: r
60
- }), s({
61
+ }), a({
61
62
  type: "SET_PAGE",
62
63
  payload: 1
63
- })) : s({
64
+ })) : a({
64
65
  type: "SET_CLIENT_FILTER",
65
66
  payload: []
66
- });
67
- const n = new URLSearchParams({
68
- customerId: r?.toString(),
69
- type: l
70
- });
71
- m(`/orders/view/return/filter?${n.toString()}`);
67
+ }), x(C(r, n));
72
68
  };
73
- return /* @__PURE__ */ t(D, { children: /* @__PURE__ */ t(b, { children: /* @__PURE__ */ a(A, { children: [
74
- /* @__PURE__ */ a("colgroup", { children: [
69
+ return /* @__PURE__ */ t(k, { children: /* @__PURE__ */ t(L, { children: /* @__PURE__ */ s(R, { children: [
70
+ /* @__PURE__ */ s("colgroup", { children: [
75
71
  /* @__PURE__ */ t("col", { style: { width: "180px" } }),
76
72
  /* @__PURE__ */ t("col", { style: { width: "180px" } }),
77
73
  /* @__PURE__ */ t("col", { style: { width: "90px" } }),
@@ -98,14 +94,14 @@ const rt = () => {
98
94
  { label: "Re-Del", key: "RE-Del", width: "90px", align: "center" },
99
95
  { label: "Recycle", key: "RECYCLE", width: "90px", align: "center" },
100
96
  { label: "Unknown", key: "UNKNOWN", width: "90px", align: "center" }
101
- ].map(({ label: r, key: l, width: n, align: e }) => /* @__PURE__ */ t("th", { onClick: () => I(l), style: { whiteSpace: "nowrap", width: n, textAlign: e }, children: /* @__PURE__ */ a("div", { style: { display: "flex", cursor: "pointer", justifyContent: e === "left" ? "flex-start" : "center" }, children: [
97
+ ].map(({ label: r, key: n, width: d, align: e }) => /* @__PURE__ */ t("th", { onClick: () => I(n), style: { whiteSpace: "nowrap", width: d, textAlign: e }, children: /* @__PURE__ */ s("div", { style: { display: "flex", cursor: "pointer", justifyContent: e === "left" ? "flex-start" : "center" }, children: [
102
98
  r,
103
99
  " ",
104
- /* @__PURE__ */ t("span", { children: y(l) })
105
- ] }) }, l)) }) }),
106
- /* @__PURE__ */ t("tbody", { children: R ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: 12, children: /* @__PURE__ */ t(M, { active: !0 }) }) }) : C?.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: 12, children: /* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(Y, {}) }) }) }) : C?.map((r, l) => {
100
+ /* @__PURE__ */ t("span", { children: N(n) })
101
+ ] }) }, n)) }) }),
102
+ /* @__PURE__ */ t("tbody", { children: g ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: 12, children: /* @__PURE__ */ t(F, { active: !0 }) }) }) : E?.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: 12, children: /* @__PURE__ */ t(M, { children: /* @__PURE__ */ t(Y, {}) }) }) }) : E?.map((r, n) => {
107
103
  if (!r) return null;
108
- const n = (e, i = !1) => e ? /* @__PURE__ */ a("tr", { style: i ? { backgroundColor: "#ffffff" } : {}, children: [
104
+ const d = (e, i = !1) => e ? /* @__PURE__ */ s("tr", { style: i ? { backgroundColor: "#ffffff" } : {}, children: [
109
105
  /* @__PURE__ */ t(
110
106
  "td",
111
107
  {
@@ -119,14 +115,27 @@ const rt = () => {
119
115
  /* @__PURE__ */ t(
120
116
  "td",
121
117
  {
122
- onClick: () => N(e?.customer_id),
123
118
  style: {
124
119
  color: "#0099ff",
125
120
  fontWeight: 600,
126
- cursor: "pointer",
127
121
  textAlign: "center"
128
122
  },
129
- children: /* @__PURE__ */ t("span", { children: e?.customer_name })
123
+ children: /* @__PURE__ */ t(
124
+ j,
125
+ {
126
+ to: C(e?.customer_id),
127
+ onClick: (l) => {
128
+ l.ctrlKey || l.metaKey || (l.preventDefault(), _(e?.customer_id));
129
+ },
130
+ style: {
131
+ color: "#0099ff",
132
+ fontWeight: 600,
133
+ cursor: "pointer",
134
+ display: "inline-block"
135
+ },
136
+ children: e?.customer_name
137
+ }
138
+ )
130
139
  }
131
140
  ),
132
141
  /* @__PURE__ */ t("td", { style: { textAlign: "center" }, children: /* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(o, { children: e?.orders ?? 0 }) }) }),
@@ -140,7 +149,7 @@ const rt = () => {
140
149
  cursor: e?.RTS > 0 ? "pointer" : "default",
141
150
  textAlign: "center"
142
151
  },
143
- onClick: e?.RTS > 0 ? () => p(e?.customer_id, "RTS") : void 0,
152
+ onClick: e?.RTS > 0 ? () => u(e?.customer_id, "RTS") : void 0,
144
153
  children: /* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(
145
154
  o,
146
155
  {
@@ -162,7 +171,7 @@ const rt = () => {
162
171
  cursor: e?.["CLAIMS PAID"] > 0 ? "pointer" : "default",
163
172
  textAlign: "center"
164
173
  },
165
- onClick: e?.["CLAIMS PAID"] > 0 ? () => p(e?.customer_id, "CLAIMS PAID") : void 0,
174
+ onClick: e?.["CLAIMS PAID"] > 0 ? () => u(e?.customer_id, "CLAIMS PAID") : void 0,
166
175
  children: /* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(
167
176
  o,
168
177
  {
@@ -183,7 +192,7 @@ const rt = () => {
183
192
  cursor: e?.DISPOSE > 0 ? "pointer" : "default",
184
193
  textAlign: "center"
185
194
  },
186
- onClick: e?.DISPOSE > 0 ? () => p(e?.customer_id, "DISPOSE") : void 0,
195
+ onClick: e?.DISPOSE > 0 ? () => u(e?.customer_id, "DISPOSE") : void 0,
187
196
  children: /* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(
188
197
  o,
189
198
  {
@@ -204,7 +213,7 @@ const rt = () => {
204
213
  cursor: e?.["RE-ALLOCATE"] > 0 ? "pointer" : "default",
205
214
  textAlign: "center"
206
215
  },
207
- onClick: e?.["RE-ALLOCATE"] > 0 ? () => p(e?.customer_id, "RE-ALLOCATE") : void 0,
216
+ onClick: e?.["RE-ALLOCATE"] > 0 ? () => u(e?.customer_id, "RE-ALLOCATE") : void 0,
208
217
  children: /* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(
209
218
  o,
210
219
  {
@@ -226,7 +235,7 @@ const rt = () => {
226
235
  cursor: e?.RECYCLE > 0 ? "pointer" : "default",
227
236
  textAlign: "center"
228
237
  },
229
- onClick: e?.RECYCLE > 0 ? () => p(e?.customer_id, "RECYCLE") : void 0,
238
+ onClick: e?.RECYCLE > 0 ? () => u(e?.customer_id, "RECYCLE") : void 0,
230
239
  children: /* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(
231
240
  o,
232
241
  {
@@ -247,7 +256,7 @@ const rt = () => {
247
256
  cursor: e?.UNKNOWN > 0 ? "pointer" : "default",
248
257
  textAlign: "center"
249
258
  },
250
- onClick: e?.UNKNOWN > 0 ? () => p(e?.customer_id, "UNKNOWN") : void 0,
259
+ onClick: e?.UNKNOWN > 0 ? () => u(e?.customer_id, "UNKNOWN") : void 0,
251
260
  children: /* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(
252
261
  o,
253
262
  {
@@ -260,20 +269,20 @@ const rt = () => {
260
269
  }
261
270
  )
262
271
  ] }, i ? `child-${e?.customer_id}` : e?.customer_id) : null;
263
- return !r?.children || r?.children?.length === 0 ? /* @__PURE__ */ t(P.Fragment, { children: n(r, !1) }, l) : /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: 12, style: { padding: 0, border: "none", background: "transparent" }, children: /* @__PURE__ */ t("div", { style: {
272
+ return !r?.children || r?.children?.length === 0 ? /* @__PURE__ */ t(P.Fragment, { children: d(r, !1) }, n) : /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: 12, style: { padding: 0, border: "none", background: "transparent" }, children: /* @__PURE__ */ t("div", { style: {
264
273
  margin: "3px 10px",
265
274
  backgroundColor: "#f8fafc",
266
275
  borderRadius: "16px",
267
276
  border: "1px solid rgba(0,0,0,0.08)",
268
277
  borderLeft: "4px solid #0099ff",
269
278
  boxShadow: "inset 0 1px 4px rgba(0,0,0,0.02)"
270
- }, children: /* @__PURE__ */ t(b, { style: {
279
+ }, children: /* @__PURE__ */ t(L, { style: {
271
280
  padding: "0px 4px",
272
281
  border: "none",
273
282
  borderRadius: "15px",
274
283
  overflow: "hidden"
275
- }, children: /* @__PURE__ */ a(A, { style: { marginBottom: 0, borderSpacing: "0 2px" }, children: [
276
- /* @__PURE__ */ a("colgroup", { children: [
284
+ }, children: /* @__PURE__ */ s(R, { style: { marginBottom: 0, borderSpacing: "0 2px" }, children: [
285
+ /* @__PURE__ */ s("colgroup", { children: [
277
286
  /* @__PURE__ */ t("col", { style: { width: "180px" } }),
278
287
  /* @__PURE__ */ t("col", { style: { width: "180px" } }),
279
288
  /* @__PURE__ */ t("col", { style: { width: "90px" } }),
@@ -287,15 +296,15 @@ const rt = () => {
287
296
  /* @__PURE__ */ t("col", { style: { width: "90px" } }),
288
297
  /* @__PURE__ */ t("col", { style: { width: "90px" } })
289
298
  ] }),
290
- /* @__PURE__ */ a("tbody", { children: [
291
- n(r, !1),
292
- r?.children?.map((e) => n(e, !0))
299
+ /* @__PURE__ */ s("tbody", { children: [
300
+ d(r, !1),
301
+ r?.children?.map((e) => d(e, !0))
293
302
  ] })
294
- ] }) }) }) }) }, `group-${l}`);
303
+ ] }) }) }) }) }, `group-${n}`);
295
304
  }) })
296
305
  ] }) }) });
297
306
  };
298
307
  export {
299
- rt as default
308
+ nt as default
300
309
  };
301
310
  //# sourceMappingURL=ReturnTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReturnTable.js","sources":["../../../../src/components/order-daily-overview/table/ReturnTable.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\nimport { useAtom, useClientData, useInternalSearchText } from '../../order-view/store';\nimport { useStatsLoading } from '../store/store';\nimport {\n ColumStyle,\n EmptyDataContainer,\n GreyBox,\n StyledTable,\n StyledTableWrapper,\n} from './table-data/styles';\nimport { Empty, Skeleton } from 'antd';\nimport { useNavigate } from 'react-router-dom';\nimport { filtersReducerAtom } from '../header-filters/filterStore';\nimport { useCustomerData } from '../../store';\nimport SortIcon from '../../../common/SortIcon';\nimport CaretDownFilledIcon from '../../../common/CaretDownFilledIcon';\n\nconst ReturnTable: React.FC = () => {\n const [clientData] = useClientData();\n const [statsLoading] = useStatsLoading();\n const [, dispatch] = useAtom(filtersReducerAtom);\n const navigate = useNavigate();\n const [customers] = useCustomerData();\n const [debouncedSearchText] = useInternalSearchText();\n // const [searchParams] = useSearchParams();\n\n //sorting\n const [sortConfig, setSortConfig] = useState<{\n key: string;\n direction: 'asc' | 'desc';\n } | null>(null);\n\n const handleSort = (key: string) => {\n setSortConfig(prev => {\n if (prev?.key === key && prev.direction === 'asc') {\n return { key, direction: 'desc' };\n }\n return { key, direction: 'asc' };\n });\n };\n\n //updated client data\n const updatedData = useMemo(() => {\n\n let baseCustomers = (debouncedSearchText && debouncedSearchText?.length > 0)\n ? (clientData || [])\n : (customers || []);\n\n const mappedCustomers = baseCustomers?.map((customer: any) => {\n // Normal state: Merge aggregate stats from the stats API onto the generic customers list\n const matchingClientStats = clientData?.find((client: any) =>\n client?.customer_id != null && client?.customer_id.toString() === customer?.customer_id?.toString()\n );\n\n let processedChildren = customer?.children?.map((child: any) => {\n const matchingChildStats = clientData?.find((client: any) =>\n client?.customer_id != null && client?.customer_id.toString() === child?.customer_id?.toString()\n );\n return {\n ...child,\n ...matchingChildStats,\n };\n });\n\n return {\n ...customer,\n ...matchingClientStats,\n children: processedChildren,\n };\n }) || [];\n\n return mappedCustomers;\n }, [customers, clientData, debouncedSearchText]);\n\n const sortedData = useMemo(() => {\n if (!updatedData || !sortConfig) return updatedData;\n\n const { key, direction } = sortConfig;\n return [...updatedData].sort((a, b) => {\n const valueA = a[key];\n const valueB = b[key];\n\n if (typeof valueA === 'number' && typeof valueB === 'number') {\n return direction === 'asc' ? valueA - valueB : valueB - valueA;\n }\n if (typeof valueA === 'string' && typeof valueB === 'string') {\n return direction === 'asc'\n ? valueA.localeCompare(valueB)\n : valueB.localeCompare(valueA);\n }\n return 0;\n });\n }, [updatedData, sortConfig]);\n\n const renderSortIcon = (columnKey: string) => {\n if (!sortConfig || sortConfig.key !== columnKey) {\n return <SortIcon />;\n }\n return sortConfig.direction === 'asc' ? (\n <CaretDownFilledIcon />\n ) : (\n <CaretDownFilledIcon />\n );\n };\n\n //handle Redirect\n const handleRedirect = (customerId: number) => {\n if (customerId) {\n dispatch({\n type: 'SET_CLIENT_FILTER',\n payload: customerId,\n });\n dispatch({\n type: 'SET_PAGE',\n payload: 1,\n });\n } else {\n dispatch({\n type: 'SET_CLIENT_FILTER',\n payload: [],\n });\n }\n\n const queryParams = new URLSearchParams({\n customerId: customerId?.toString(),\n });\n //for dev\n navigate(`/orders/view/return/filter?${queryParams.toString()}`);\n\n //for local\n // navigate(`/filter?${queryParams.toString()}`);\n };\n\n //for RTS\n const handleRedirectRTS = (customerId: number, RTS: string) => {\n if (customerId) {\n dispatch({\n type: 'SET_CLIENT_FILTER',\n payload: customerId,\n });\n dispatch({\n type: 'SET_PAGE',\n payload: 1,\n });\n } else {\n dispatch({\n type: 'SET_CLIENT_FILTER',\n payload: [],\n });\n }\n\n const queryParams = new URLSearchParams({\n customerId: customerId?.toString(),\n type: RTS,\n });\n //for dev\n navigate(`/orders/view/return/filter?${queryParams.toString()}`);\n\n //for local\n //navigate(`/filter?${queryParams.toString()}`);\n };\n\n return (\n <>\n <StyledTableWrapper>\n <StyledTable>\n <colgroup>\n <col style={{ width: '180px' }} />\n <col style={{ width: '180px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '80px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '110px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '110px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '90px' }} />\n </colgroup>\n <thead>\n <tr>\n {[\n { label: 'Trading Name', key: 'trading_as', width: '180px', align: 'left' },\n { label: 'Client', key: 'customer_name', width: '180px', align: 'center' },\n { label: 'Orders', key: 'orders', width: '90px', align: 'center' },\n { label: 'Products', key: 'return_order_products', width: '90px', align: 'center' },\n { label: 'RTS', key: 'RTS', width: '80px', align: 'center' },\n { label: 'Pending', key: 'PENDING', width: '90px', align: 'center' },\n { label: 'Claims Paid', key: 'CLAIMS PAID', width: '110px', align: 'center' },\n { label: 'Dispose', key: 'DISPOSE', width: '90px', align: 'center' },\n { label: 'Re-allocate', key: 'RE-ALLOCATE', width: '110px', align: 'center' },\n { label: 'Re-Del', key: 'RE-Del', width: '90px', align: 'center' },\n { label: 'Recycle', key: 'RECYCLE', width: '90px', align: 'center' },\n { label: 'Unknown', key: 'UNKNOWN', width: '90px', align: 'center' },\n ].map(({ label, key, width, align }) => (\n <th key={key} onClick={() => handleSort(key)} style={{ whiteSpace: 'nowrap', width, textAlign: align as any }}>\n <div style={{ display: 'flex', cursor: 'pointer', justifyContent: align === 'left' ? 'flex-start' : 'center' }}>\n {label} <span>{renderSortIcon(key)}</span>\n </div>\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {statsLoading ? (\n <tr>\n <td colSpan={12}>\n <Skeleton active />\n </td>\n </tr>\n ) : sortedData?.length === 0 ? (\n <tr>\n <td colSpan={12}>\n <EmptyDataContainer>\n <Empty />\n </EmptyDataContainer>\n </td>\n </tr>\n ) : (\n sortedData?.map((key: any, index: number) => {\n if (!key) return null; // Safe rendering fallback \n\n const renderDataRow = (rowKey: any, isChild: boolean = false) => {\n if (!rowKey) return null; // Prevent properties of undefined UI crashes\n\n return (\n <tr key={isChild ? `child-${rowKey?.customer_id}` : rowKey?.customer_id} style={isChild ? { backgroundColor: '#ffffff' } : {}}>\n <td\n style={{\n paddingLeft: '15px',\n color: 'inherit',\n }}\n >\n <span style={{ fontWeight: !isChild && rowKey?.children?.length > 0 ? 600 : 400 }}>\n {rowKey?.trading_as}\n </span>\n </td>\n\n <td\n onClick={() => handleRedirect(rowKey?.customer_id)}\n style={{\n color: '#0099ff',\n fontWeight: 600,\n cursor: 'pointer',\n textAlign: 'center',\n }}\n >\n <span>{rowKey?.customer_name}</span>\n </td>\n\n <td style={{ textAlign: 'center' }}>\n <ColumStyle>\n <GreyBox>{rowKey?.orders ?? 0}</GreyBox>\n </ColumStyle>\n </td>\n\n <td style={{ textAlign: 'center' }}>\n <ColumStyle>\n <GreyBox>{rowKey?.return_order_products ?? 0}</GreyBox>\n </ColumStyle>\n </td>\n <td\n style={{\n color: rowKey?.RTS > 0 ? '#0099ff' : 'inherit',\n fontWeight: rowKey?.RTS > 0 ? 600 : 'normal',\n cursor: rowKey?.RTS > 0 ? 'pointer' : 'default',\n textAlign: 'center',\n }}\n onClick={\n rowKey?.RTS > 0\n ? () => handleRedirectRTS(rowKey?.customer_id, 'RTS')\n : undefined\n }\n >\n <ColumStyle>\n <GreyBox\n style={{\n backgroundColor:\n rowKey?.RTS > 0\n ? 'rgba(99, 150, 229, 0.1)'\n : 'rgba(153, 153, 153, 0.1)',\n }}\n >\n {rowKey?.RTS ?? 0}\n </GreyBox>\n </ColumStyle>\n </td>\n\n <td style={{ textAlign: 'center' }}>\n <ColumStyle>\n <GreyBox>{rowKey?.PENDING ?? 0}</GreyBox>\n </ColumStyle>\n </td>\n <td\n style={{\n color: rowKey?.['CLAIMS PAID'] > 0 ? '#0099ff' : 'inherit',\n fontWeight: rowKey?.['CLAIMS PAID'] > 0 ? 600 : 'normal',\n cursor: rowKey?.['CLAIMS PAID'] > 0 ? 'pointer' : 'default',\n textAlign: 'center',\n }}\n onClick={\n rowKey?.['CLAIMS PAID'] > 0\n ? () => handleRedirectRTS(rowKey?.customer_id, 'CLAIMS PAID')\n : undefined\n }\n >\n <ColumStyle>\n <GreyBox\n style={{\n backgroundColor:\n rowKey?.['CLAIMS PAID'] > 0\n ? 'rgba(99, 150, 229, 0.1)'\n : 'rgba(153, 153, 153, 0.1)',\n }}\n >\n {rowKey?.['CLAIMS PAID'] ?? 0}\n </GreyBox>\n </ColumStyle>\n </td>\n <td\n style={{\n color: rowKey?.DISPOSE > 0 ? '#0099ff' : 'inherit',\n fontWeight: rowKey?.DISPOSE > 0 ? 600 : 'normal',\n cursor: rowKey?.DISPOSE > 0 ? 'pointer' : 'default',\n textAlign: 'center',\n }}\n onClick={\n rowKey?.DISPOSE > 0\n ? () => handleRedirectRTS(rowKey?.customer_id, 'DISPOSE')\n : undefined\n }\n >\n <ColumStyle>\n <GreyBox\n style={{\n backgroundColor:\n rowKey?.DISPOSE > 0\n ? 'rgba(99, 150, 229, 0.1)'\n : 'rgba(153, 153, 153, 0.1)',\n }}\n >\n {rowKey?.DISPOSE ?? 0}\n </GreyBox>\n </ColumStyle>\n </td>\n <td\n style={{\n color: rowKey?.['RE-ALLOCATE'] > 0 ? '#0099ff' : 'inherit',\n fontWeight: rowKey?.['RE-ALLOCATE'] > 0 ? 600 : 'normal',\n cursor: rowKey?.['RE-ALLOCATE'] > 0 ? 'pointer' : 'default',\n textAlign: 'center',\n }}\n onClick={\n rowKey?.['RE-ALLOCATE'] > 0\n ? () => handleRedirectRTS(rowKey?.customer_id, 'RE-ALLOCATE')\n : undefined\n }\n >\n <ColumStyle>\n <GreyBox\n style={{\n backgroundColor:\n rowKey?.['RE-ALLOCATE'] > 0\n ? 'rgba(99, 150, 229, 0.1)'\n : 'rgba(153, 153, 153, 0.1)',\n }}\n >\n {rowKey?.['RE-ALLOCATE'] ?? 0}\n </GreyBox>\n </ColumStyle>\n </td>\n <td style={{ textAlign: 'center' }}>\n <ColumStyle>\n <GreyBox>{rowKey?.['RE-DEL'] ?? 0}</GreyBox>\n </ColumStyle>\n </td>\n <td\n style={{\n color: rowKey?.RECYCLE > 0 ? '#0099ff' : 'inherit',\n fontWeight: rowKey?.RECYCLE > 0 ? 600 : 'normal',\n cursor: rowKey?.RECYCLE > 0 ? 'pointer' : 'default',\n textAlign: 'center',\n }}\n onClick={\n rowKey?.RECYCLE > 0\n ? () => handleRedirectRTS(rowKey?.customer_id, 'RECYCLE')\n : undefined\n }\n >\n <ColumStyle>\n <GreyBox\n style={{\n backgroundColor:\n rowKey?.RECYCLE > 0\n ? 'rgba(99, 150, 229, 0.1)'\n : 'rgba(153, 153, 153, 0.1)',\n }}\n >\n {rowKey?.RECYCLE ?? 0}\n </GreyBox>\n </ColumStyle>\n </td>\n <td\n style={{\n color: rowKey?.UNKNOWN > 0 ? '#0099ff' : 'inherit',\n fontWeight: rowKey?.UNKNOWN > 0 ? 600 : 'normal',\n cursor: rowKey?.UNKNOWN > 0 ? 'pointer' : 'default',\n textAlign: 'center',\n }}\n onClick={\n rowKey?.UNKNOWN > 0\n ? () => handleRedirectRTS(rowKey?.customer_id, 'UNKNOWN')\n : undefined\n }\n >\n <ColumStyle>\n <GreyBox\n style={{\n backgroundColor:\n rowKey?.UNKNOWN > 0\n ? 'rgba(99, 150, 229, 0.1)'\n : 'rgba(153, 153, 153, 0.1)',\n }}\n >\n {rowKey?.UNKNOWN ?? 0}\n </GreyBox>\n </ColumStyle>\n </td>\n </tr>\n );\n };\n\n if (!key?.children || key?.children?.length === 0) {\n return <React.Fragment key={index}>{renderDataRow(key, false)}</React.Fragment>;\n }\n\n return (\n <tr key={`group-${index}`}>\n <td colSpan={12} style={{ padding: 0, border: 'none', background: 'transparent' }}>\n <div style={{\n margin: '3px 10px',\n backgroundColor: '#f8fafc',\n borderRadius: '16px',\n border: '1px solid rgba(0,0,0,0.08)',\n borderLeft: '4px solid #0099ff',\n boxShadow: 'inset 0 1px 4px rgba(0,0,0,0.02)'\n }}>\n <StyledTableWrapper style={{\n padding: '0px 4px',\n border: 'none',\n borderRadius: '15px',\n overflow: 'hidden'\n }}>\n <StyledTable style={{ marginBottom: 0, borderSpacing: '0 2px' }}>\n <colgroup>\n <col style={{ width: '180px' }} />\n <col style={{ width: '180px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '80px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '110px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '110px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '90px' }} />\n </colgroup>\n <tbody>\n {renderDataRow(key, false)}\n {key?.children?.map((child: any) => renderDataRow(child, true))}\n </tbody>\n </StyledTable>\n </StyledTableWrapper>\n </div>\n </td>\n </tr>\n );\n })\n )}\n </tbody>\n </StyledTable>\n </StyledTableWrapper>\n </>\n );\n};\n\nexport default ReturnTable;\n"],"names":["ReturnTable","clientData","useClientData","statsLoading","useStatsLoading","dispatch","useAtom","filtersReducerAtom","navigate","useNavigate","customers","useCustomerData","debouncedSearchText","useInternalSearchText","sortConfig","setSortConfig","useState","handleSort","key","prev","updatedData","useMemo","customer","matchingClientStats","client","processedChildren","child","matchingChildStats","sortedData","direction","a","b","valueA","valueB","renderSortIcon","columnKey","SortIcon","CaretDownFilledIcon","handleRedirect","customerId","queryParams","handleRedirectRTS","RTS","jsx","Fragment","StyledTableWrapper","jsxs","StyledTable","label","width","align","Skeleton","EmptyDataContainer","Empty","index","renderDataRow","rowKey","isChild","ColumStyle","GreyBox","React"],"mappings":";;;;;;;;;;;;AAiBA,MAAMA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BACC,SAAA,EACE,UAAA;AAAA,UAAAY,EAAcrC,GAAK,EAAK;AAAA,UACxBA,GAAK,UAAU,IAAI,CAACQ,MAAe6B,EAAc7B,GAAO,EAAI,CAAC;AAAA,QAAA,EAAA,CAChE;AAAA,MAAA,GACF,GACF,EAAA,CACF,EAAA,CACF,EAAA,GAtCO,SAAS4B,CAAK,EAuCvB;AAAA,IAEJ,CAAC,EAAA,CAEL;AAAA,EAAA,EAAA,CACF,GACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"ReturnTable.js","sources":["../../../../src/components/order-daily-overview/table/ReturnTable.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\nimport { useAtom, useClientData, useInternalSearchText } from '../../order-view/store';\nimport { useStatsLoading } from '../store/store';\nimport {\n ColumStyle,\n EmptyDataContainer,\n GreyBox,\n StyledTable,\n StyledTableWrapper,\n} from './table-data/styles';\nimport { Empty, Skeleton } from 'antd';\nimport { NavLink, useNavigate } from 'react-router-dom';\nimport { filtersReducerAtom } from '../header-filters/filterStore';\nimport { useCustomerData } from '../../store';\nimport SortIcon from '../../../common/SortIcon';\nimport CaretDownFilledIcon from '../../../common/CaretDownFilledIcon';\n\nconst buildCustomerFilterPath = (customerId: number, type?: string) => {\n const queryParams = new URLSearchParams({\n customerId: customerId?.toString(),\n });\n\n if (type) {\n queryParams.set('type', type);\n }\n\n return `/orders/view/return/filter?${queryParams.toString()}`;\n};\n\nconst ReturnTable: React.FC = () => {\n const [clientData] = useClientData();\n const [statsLoading] = useStatsLoading();\n const [, dispatch] = useAtom(filtersReducerAtom);\n const navigate = useNavigate();\n const [customers] = useCustomerData();\n const [debouncedSearchText] = useInternalSearchText();\n // const [searchParams] = useSearchParams();\n\n //sorting\n const [sortConfig, setSortConfig] = useState<{\n key: string;\n direction: 'asc' | 'desc';\n } | null>(null);\n\n const handleSort = (key: string) => {\n setSortConfig(prev => {\n if (prev?.key === key && prev.direction === 'asc') {\n return { key, direction: 'desc' };\n }\n return { key, direction: 'asc' };\n });\n };\n\n //updated client data\n const updatedData = useMemo(() => {\n\n let baseCustomers = (debouncedSearchText && debouncedSearchText?.length > 0)\n ? (clientData || [])\n : (customers || []);\n\n const mappedCustomers = baseCustomers?.map((customer: any) => {\n // Normal state: Merge aggregate stats from the stats API onto the generic customers list\n const matchingClientStats = clientData?.find((client: any) =>\n client?.customer_id != null && client?.customer_id.toString() === customer?.customer_id?.toString()\n );\n\n let processedChildren = customer?.children?.map((child: any) => {\n const matchingChildStats = clientData?.find((client: any) =>\n client?.customer_id != null && client?.customer_id.toString() === child?.customer_id?.toString()\n );\n return {\n ...child,\n ...matchingChildStats,\n };\n });\n\n return {\n ...customer,\n ...matchingClientStats,\n children: processedChildren,\n };\n }) || [];\n\n return mappedCustomers;\n }, [customers, clientData, debouncedSearchText]);\n\n const sortedData = useMemo(() => {\n if (!updatedData || !sortConfig) return updatedData;\n\n const { key, direction } = sortConfig;\n return [...updatedData].sort((a, b) => {\n const valueA = a[key];\n const valueB = b[key];\n\n if (typeof valueA === 'number' && typeof valueB === 'number') {\n return direction === 'asc' ? valueA - valueB : valueB - valueA;\n }\n if (typeof valueA === 'string' && typeof valueB === 'string') {\n return direction === 'asc'\n ? valueA.localeCompare(valueB)\n : valueB.localeCompare(valueA);\n }\n return 0;\n });\n }, [updatedData, sortConfig]);\n\n const renderSortIcon = (columnKey: string) => {\n if (!sortConfig || sortConfig.key !== columnKey) {\n return <SortIcon />;\n }\n return sortConfig.direction === 'asc' ? (\n <CaretDownFilledIcon />\n ) : (\n <CaretDownFilledIcon />\n );\n };\n\n //handle Redirect\n const handleRedirect = (customerId: number) => {\n if (customerId) {\n dispatch({\n type: 'SET_CLIENT_FILTER',\n payload: customerId,\n });\n dispatch({\n type: 'SET_PAGE',\n payload: 1,\n });\n } else {\n dispatch({\n type: 'SET_CLIENT_FILTER',\n payload: [],\n });\n }\n\n navigate(buildCustomerFilterPath(customerId));\n };\n\n //for RTS\n const handleRedirectRTS = (customerId: number, RTS: string) => {\n if (customerId) {\n dispatch({\n type: 'SET_CLIENT_FILTER',\n payload: customerId,\n });\n dispatch({\n type: 'SET_PAGE',\n payload: 1,\n });\n } else {\n dispatch({\n type: 'SET_CLIENT_FILTER',\n payload: [],\n });\n }\n\n navigate(buildCustomerFilterPath(customerId, RTS));\n };\n\n return (\n <>\n <StyledTableWrapper>\n <StyledTable>\n <colgroup>\n <col style={{ width: '180px' }} />\n <col style={{ width: '180px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '80px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '110px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '110px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '90px' }} />\n </colgroup>\n <thead>\n <tr>\n {[\n { label: 'Trading Name', key: 'trading_as', width: '180px', align: 'left' },\n { label: 'Client', key: 'customer_name', width: '180px', align: 'center' },\n { label: 'Orders', key: 'orders', width: '90px', align: 'center' },\n { label: 'Products', key: 'return_order_products', width: '90px', align: 'center' },\n { label: 'RTS', key: 'RTS', width: '80px', align: 'center' },\n { label: 'Pending', key: 'PENDING', width: '90px', align: 'center' },\n { label: 'Claims Paid', key: 'CLAIMS PAID', width: '110px', align: 'center' },\n { label: 'Dispose', key: 'DISPOSE', width: '90px', align: 'center' },\n { label: 'Re-allocate', key: 'RE-ALLOCATE', width: '110px', align: 'center' },\n { label: 'Re-Del', key: 'RE-Del', width: '90px', align: 'center' },\n { label: 'Recycle', key: 'RECYCLE', width: '90px', align: 'center' },\n { label: 'Unknown', key: 'UNKNOWN', width: '90px', align: 'center' },\n ].map(({ label, key, width, align }) => (\n <th key={key} onClick={() => handleSort(key)} style={{ whiteSpace: 'nowrap', width, textAlign: align as any }}>\n <div style={{ display: 'flex', cursor: 'pointer', justifyContent: align === 'left' ? 'flex-start' : 'center' }}>\n {label} <span>{renderSortIcon(key)}</span>\n </div>\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {statsLoading ? (\n <tr>\n <td colSpan={12}>\n <Skeleton active />\n </td>\n </tr>\n ) : sortedData?.length === 0 ? (\n <tr>\n <td colSpan={12}>\n <EmptyDataContainer>\n <Empty />\n </EmptyDataContainer>\n </td>\n </tr>\n ) : (\n sortedData?.map((key: any, index: number) => {\n if (!key) return null; // Safe rendering fallback \n\n const renderDataRow = (rowKey: any, isChild: boolean = false) => {\n if (!rowKey) return null; // Prevent properties of undefined UI crashes\n\n return (\n <tr key={isChild ? `child-${rowKey?.customer_id}` : rowKey?.customer_id} style={isChild ? { backgroundColor: '#ffffff' } : {}}>\n <td\n style={{\n paddingLeft: '15px',\n color: 'inherit',\n }}\n >\n <span style={{ fontWeight: !isChild && rowKey?.children?.length > 0 ? 600 : 400 }}>\n {rowKey?.trading_as}\n </span>\n </td>\n\n <td\n style={{\n color: '#0099ff',\n fontWeight: 600,\n textAlign: 'center',\n }}\n >\n <NavLink\n to={buildCustomerFilterPath(rowKey?.customer_id)}\n onClick={event => {\n if (event.ctrlKey || event.metaKey) {\n return;\n }\n event.preventDefault();\n handleRedirect(rowKey?.customer_id);\n }}\n style={{\n color: '#0099ff',\n fontWeight: 600,\n cursor: 'pointer',\n display: 'inline-block',\n }}\n >\n {rowKey?.customer_name}\n </NavLink>\n </td>\n\n <td style={{ textAlign: 'center' }}>\n <ColumStyle>\n <GreyBox>{rowKey?.orders ?? 0}</GreyBox>\n </ColumStyle>\n </td>\n\n <td style={{ textAlign: 'center' }}>\n <ColumStyle>\n <GreyBox>{rowKey?.return_order_products ?? 0}</GreyBox>\n </ColumStyle>\n </td>\n <td\n style={{\n color: rowKey?.RTS > 0 ? '#0099ff' : 'inherit',\n fontWeight: rowKey?.RTS > 0 ? 600 : 'normal',\n cursor: rowKey?.RTS > 0 ? 'pointer' : 'default',\n textAlign: 'center',\n }}\n onClick={\n rowKey?.RTS > 0\n ? () => handleRedirectRTS(rowKey?.customer_id, 'RTS')\n : undefined\n }\n >\n <ColumStyle>\n <GreyBox\n style={{\n backgroundColor:\n rowKey?.RTS > 0\n ? 'rgba(99, 150, 229, 0.1)'\n : 'rgba(153, 153, 153, 0.1)',\n }}\n >\n {rowKey?.RTS ?? 0}\n </GreyBox>\n </ColumStyle>\n </td>\n\n <td style={{ textAlign: 'center' }}>\n <ColumStyle>\n <GreyBox>{rowKey?.PENDING ?? 0}</GreyBox>\n </ColumStyle>\n </td>\n <td\n style={{\n color: rowKey?.['CLAIMS PAID'] > 0 ? '#0099ff' : 'inherit',\n fontWeight: rowKey?.['CLAIMS PAID'] > 0 ? 600 : 'normal',\n cursor: rowKey?.['CLAIMS PAID'] > 0 ? 'pointer' : 'default',\n textAlign: 'center',\n }}\n onClick={\n rowKey?.['CLAIMS PAID'] > 0\n ? () => handleRedirectRTS(rowKey?.customer_id, 'CLAIMS PAID')\n : undefined\n }\n >\n <ColumStyle>\n <GreyBox\n style={{\n backgroundColor:\n rowKey?.['CLAIMS PAID'] > 0\n ? 'rgba(99, 150, 229, 0.1)'\n : 'rgba(153, 153, 153, 0.1)',\n }}\n >\n {rowKey?.['CLAIMS PAID'] ?? 0}\n </GreyBox>\n </ColumStyle>\n </td>\n <td\n style={{\n color: rowKey?.DISPOSE > 0 ? '#0099ff' : 'inherit',\n fontWeight: rowKey?.DISPOSE > 0 ? 600 : 'normal',\n cursor: rowKey?.DISPOSE > 0 ? 'pointer' : 'default',\n textAlign: 'center',\n }}\n onClick={\n rowKey?.DISPOSE > 0\n ? () => handleRedirectRTS(rowKey?.customer_id, 'DISPOSE')\n : undefined\n }\n >\n <ColumStyle>\n <GreyBox\n style={{\n backgroundColor:\n rowKey?.DISPOSE > 0\n ? 'rgba(99, 150, 229, 0.1)'\n : 'rgba(153, 153, 153, 0.1)',\n }}\n >\n {rowKey?.DISPOSE ?? 0}\n </GreyBox>\n </ColumStyle>\n </td>\n <td\n style={{\n color: rowKey?.['RE-ALLOCATE'] > 0 ? '#0099ff' : 'inherit',\n fontWeight: rowKey?.['RE-ALLOCATE'] > 0 ? 600 : 'normal',\n cursor: rowKey?.['RE-ALLOCATE'] > 0 ? 'pointer' : 'default',\n textAlign: 'center',\n }}\n onClick={\n rowKey?.['RE-ALLOCATE'] > 0\n ? () => handleRedirectRTS(rowKey?.customer_id, 'RE-ALLOCATE')\n : undefined\n }\n >\n <ColumStyle>\n <GreyBox\n style={{\n backgroundColor:\n rowKey?.['RE-ALLOCATE'] > 0\n ? 'rgba(99, 150, 229, 0.1)'\n : 'rgba(153, 153, 153, 0.1)',\n }}\n >\n {rowKey?.['RE-ALLOCATE'] ?? 0}\n </GreyBox>\n </ColumStyle>\n </td>\n <td style={{ textAlign: 'center' }}>\n <ColumStyle>\n <GreyBox>{rowKey?.['RE-DEL'] ?? 0}</GreyBox>\n </ColumStyle>\n </td>\n <td\n style={{\n color: rowKey?.RECYCLE > 0 ? '#0099ff' : 'inherit',\n fontWeight: rowKey?.RECYCLE > 0 ? 600 : 'normal',\n cursor: rowKey?.RECYCLE > 0 ? 'pointer' : 'default',\n textAlign: 'center',\n }}\n onClick={\n rowKey?.RECYCLE > 0\n ? () => handleRedirectRTS(rowKey?.customer_id, 'RECYCLE')\n : undefined\n }\n >\n <ColumStyle>\n <GreyBox\n style={{\n backgroundColor:\n rowKey?.RECYCLE > 0\n ? 'rgba(99, 150, 229, 0.1)'\n : 'rgba(153, 153, 153, 0.1)',\n }}\n >\n {rowKey?.RECYCLE ?? 0}\n </GreyBox>\n </ColumStyle>\n </td>\n <td\n style={{\n color: rowKey?.UNKNOWN > 0 ? '#0099ff' : 'inherit',\n fontWeight: rowKey?.UNKNOWN > 0 ? 600 : 'normal',\n cursor: rowKey?.UNKNOWN > 0 ? 'pointer' : 'default',\n textAlign: 'center',\n }}\n onClick={\n rowKey?.UNKNOWN > 0\n ? () => handleRedirectRTS(rowKey?.customer_id, 'UNKNOWN')\n : undefined\n }\n >\n <ColumStyle>\n <GreyBox\n style={{\n backgroundColor:\n rowKey?.UNKNOWN > 0\n ? 'rgba(99, 150, 229, 0.1)'\n : 'rgba(153, 153, 153, 0.1)',\n }}\n >\n {rowKey?.UNKNOWN ?? 0}\n </GreyBox>\n </ColumStyle>\n </td>\n </tr>\n );\n };\n\n if (!key?.children || key?.children?.length === 0) {\n return <React.Fragment key={index}>{renderDataRow(key, false)}</React.Fragment>;\n }\n\n return (\n <tr key={`group-${index}`}>\n <td colSpan={12} style={{ padding: 0, border: 'none', background: 'transparent' }}>\n <div style={{\n margin: '3px 10px',\n backgroundColor: '#f8fafc',\n borderRadius: '16px',\n border: '1px solid rgba(0,0,0,0.08)',\n borderLeft: '4px solid #0099ff',\n boxShadow: 'inset 0 1px 4px rgba(0,0,0,0.02)'\n }}>\n <StyledTableWrapper style={{\n padding: '0px 4px',\n border: 'none',\n borderRadius: '15px',\n overflow: 'hidden'\n }}>\n <StyledTable style={{ marginBottom: 0, borderSpacing: '0 2px' }}>\n <colgroup>\n <col style={{ width: '180px' }} />\n <col style={{ width: '180px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '80px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '110px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '110px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '90px' }} />\n <col style={{ width: '90px' }} />\n </colgroup>\n <tbody>\n {renderDataRow(key, false)}\n {key?.children?.map((child: any) => renderDataRow(child, true))}\n </tbody>\n </StyledTable>\n </StyledTableWrapper>\n </div>\n </td>\n </tr>\n );\n })\n )}\n </tbody>\n </StyledTable>\n </StyledTableWrapper>\n </>\n );\n};\n\nexport default ReturnTable;\n"],"names":["buildCustomerFilterPath","customerId","type","queryParams","ReturnTable","clientData","useClientData","statsLoading","useStatsLoading","dispatch","useAtom","filtersReducerAtom","navigate","useNavigate","customers","useCustomerData","debouncedSearchText","useInternalSearchText","sortConfig","setSortConfig","useState","handleSort","key","prev","updatedData","useMemo","customer","matchingClientStats","client","processedChildren","child","matchingChildStats","sortedData","direction","a","b","valueA","valueB","renderSortIcon","columnKey","SortIcon","CaretDownFilledIcon","handleRedirect","handleRedirectRTS","RTS","jsx","Fragment","StyledTableWrapper","jsxs","StyledTable","label","width","align","Skeleton","EmptyDataContainer","Empty","index","renderDataRow","rowKey","isChild","NavLink","event","ColumStyle","GreyBox","React"],"mappings":";;;;;;;;;;;;AAiBA,MAAMA,IAA0B,CAACC,GAAoBC,MAAkB;AACrE,QAAMC,IAAc,IAAI,gBAAgB;AAAA,IACtC,YAAYF,GAAY,SAAA;AAAA,EAAS,CAClC;AAED,SAAIC,KACFC,EAAY,IAAI,QAAQD,CAAI,GAGvB,8BAA8BC,EAAY,SAAA,CAAU;AAC7D,GAEMC,KAAwB,MAAM;AAClC,QAAM,CAACC,CAAU,IAAIC,EAAA,GACf,CAACC,CAAY,IAAIC,EAAA,GACjB,GAAGC,CAAQ,IAAIC,EAAQC,CAAkB,GACzCC,IAAWC,EAAA,GACX,CAACC,CAAS,IAAIC,EAAA,GACd,CAACC,CAAmB,IAAIC,EAAA,GAIxB,CAACC,GAAYC,CAAa,IAAIC,EAG1B,IAAI,GAERC,IAAa,CAACC,MAAgB;AAClC,IAAAH,EAAc,CAAAI,MACRA,GAAM,QAAQD,KAAOC,EAAK,cAAc,QACnC,EAAE,KAAAD,GAAK,WAAW,OAAA,IAEpB,EAAE,KAAAA,GAAK,WAAW,MAAA,CAC1B;AAAA,EACH,GAGME,IAAcC,EAAQ,OAELT,KAAuBA,GAAqB,SAAS,IACrEX,KAAc,KACdS,KAAa,CAAA,IAEqB,IAAI,CAACY,MAAkB;AAE5D,UAAMC,IAAsBtB,GAAY;AAAA,MAAK,CAACuB,MAC5CA,GAAQ,eAAe,QAAQA,GAAQ,YAAY,SAAA,MAAeF,GAAU,aAAa,SAAA;AAAA,IAAS;AAGpG,QAAIG,IAAoBH,GAAU,UAAU,IAAI,CAACI,MAAe;AAC9D,YAAMC,IAAqB1B,GAAY;AAAA,QAAK,CAACuB,MAC3CA,GAAQ,eAAe,QAAQ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