ahs-cti 1.0.1-beta.2 → 1.0.1-beta.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.
@@ -0,0 +1,10 @@
1
+ import {
2
+ agentDetailReport_default
3
+ } from "./chunk-U2DJ5WRK.mjs";
4
+ import "./chunk-FVNDPJUU.mjs";
5
+ import "./chunk-RZZQ42MG.mjs";
6
+ import "./chunk-YREOEULC.mjs";
7
+ export {
8
+ agentDetailReport_default as default
9
+ };
10
+ //# sourceMappingURL=agentDetailReport-XUNWPSQW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,597 @@
1
+ import {
2
+ agentDetailReport_default
3
+ } from "./chunk-U2DJ5WRK.mjs";
4
+ import {
5
+ SDKButton
6
+ } from "./chunk-FVNDPJUU.mjs";
7
+ import {
8
+ SDKPageHeader
9
+ } from "./chunk-RZZQ42MG.mjs";
10
+ import {
11
+ END_POINT,
12
+ SDKProvider,
13
+ __spreadProps,
14
+ __spreadValues,
15
+ axios_default
16
+ } from "./chunk-YREOEULC.mjs";
17
+
18
+ // call-control-sdk/lib/pages/agentPerformanceReport/index.tsx
19
+ import { memo, useCallback as useCallback2, useEffect, useMemo, useState as useState2 } from "react";
20
+ import {
21
+ Alert,
22
+ Box,
23
+ CircularProgress,
24
+ IconButton,
25
+ InputAdornment,
26
+ OutlinedInput,
27
+ Paper,
28
+ Stack,
29
+ Table,
30
+ TableBody,
31
+ TableCell,
32
+ TableContainer,
33
+ TableHead,
34
+ TablePagination,
35
+ TableRow,
36
+ TableSortLabel,
37
+ Tooltip
38
+ } from "@mui/material";
39
+ import FileDownloadIcon from "@mui/icons-material/FileDownload";
40
+ import VisibilityIcon from "@mui/icons-material/Visibility";
41
+ import SearchIcon from "@mui/icons-material/Search";
42
+ import dayjs from "dayjs";
43
+ import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
44
+ import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
45
+ import { DatePicker } from "@mui/x-date-pickers/DatePicker";
46
+
47
+ // call-control-sdk/lib/pages/agentPerformanceReport/useAgentPerformanceReport.ts
48
+ import { useCallback, useState } from "react";
49
+ function buildQs(params) {
50
+ const qs = new URLSearchParams();
51
+ if (params.start_date) qs.append("start_date", params.start_date);
52
+ if (params.end_date) qs.append("end_date", params.end_date);
53
+ if (params.agent_id) for (const id of params.agent_id) qs.append("agent_id", id);
54
+ if (params.queue_id) for (const id of params.queue_id) qs.append("queue_id", String(id));
55
+ if (params.process_id) for (const id of params.process_id) qs.append("process_id", String(id));
56
+ if (params.top_n) qs.append("top_n", String(params.top_n));
57
+ const str = qs.toString();
58
+ return str ? `?${str}` : "";
59
+ }
60
+ function useAgentPerformanceReport() {
61
+ const [agents, setAgents] = useState([]);
62
+ const [loading, setLoading] = useState(false);
63
+ const [error, setError] = useState("");
64
+ const fetchAgents = useCallback(async (params) => {
65
+ var _a, _b;
66
+ setLoading(true);
67
+ setError("");
68
+ try {
69
+ const res = await axios_default.get(
70
+ `${END_POINT.AGENT_PERFORMANCE_REPORT_AGENTS}${buildQs(params)}`
71
+ );
72
+ setAgents(Array.isArray(res.data) ? res.data : []);
73
+ } catch (err) {
74
+ setError(((_b = (_a = err == null ? void 0 : err.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || (err == null ? void 0 : err.message) || "Failed to fetch performance report");
75
+ setAgents([]);
76
+ } finally {
77
+ setLoading(false);
78
+ }
79
+ }, []);
80
+ const exportExcel = useCallback(async (params) => {
81
+ var _a;
82
+ const res = await axios_default.get(
83
+ `${END_POINT.AGENT_PERFORMANCE_REPORT_EXPORT_EXCEL}${buildQs(params)}`,
84
+ { responseType: "blob" }
85
+ );
86
+ const url = URL.createObjectURL(new Blob([res.data]));
87
+ const a = document.createElement("a");
88
+ a.href = url;
89
+ a.download = `agent-performance-${(_a = params.start_date) != null ? _a : "export"}.xlsx`;
90
+ a.click();
91
+ URL.revokeObjectURL(url);
92
+ }, []);
93
+ return { agents, loading, error, setError, fetchAgents, exportExcel };
94
+ }
95
+
96
+ // call-control-sdk/lib/pages/agentPerformanceReport/types.ts
97
+ var COLUMNS = [
98
+ { key: "id", label: "User ID", group: "Agent" },
99
+ { key: "name", label: "Full Name", group: "Agent" },
100
+ { key: "queue", label: "Queues", group: "Agent" },
101
+ { key: "total", label: "Total Calls", group: "Calls", align: "right" },
102
+ { key: "ans", label: "Answered", group: "Calls", align: "right" },
103
+ { key: "miss", label: "Missed", group: "Calls", align: "right" },
104
+ { key: "inTotal", label: "Inbound", group: "Calls", align: "right" },
105
+ { key: "outTotal", label: "Outbound", group: "Calls", align: "right" },
106
+ { key: "aht", label: "AHT", group: "Time", align: "right" },
107
+ { key: "loginDur", label: "Login Dur", group: "Time", align: "right" },
108
+ { key: "talk", label: "Talk Time", group: "Time", align: "right" },
109
+ { key: "hold", label: "Hold Time", group: "Time", align: "right" },
110
+ { key: "wrapup", label: "Wrapup Time", group: "Time", align: "right" },
111
+ { key: "breakTime", label: "Break Time", group: "Breaks", align: "right" },
112
+ { key: "idle", label: "Idle Time", group: "Time", align: "right" },
113
+ { key: "firstLogin", label: "First Login", group: "Login" },
114
+ { key: "adherence", label: "Adherence %", group: "Agent", align: "right" }
115
+ ];
116
+
117
+ // call-control-sdk/lib/pages/agentPerformanceReport/styles.ts
118
+ var C = {
119
+ navy: "#0d2a56",
120
+ blue: "#1565c8",
121
+ green: "#0a9a62",
122
+ amber: "#c47c00",
123
+ red: "#cc2a2a",
124
+ purple: "#6b3fbf",
125
+ teal: "#0b7a8f",
126
+ bg: "transparent",
127
+ surface: "#fff",
128
+ s2: "#f7f9fc",
129
+ s3: "#eef2f7",
130
+ b1: "rgba(20,50,100,.07)",
131
+ b2: "rgba(20,50,100,.13)",
132
+ t1: "#0d1e35",
133
+ t2: "#364f6e",
134
+ t3: "#7a93b5",
135
+ t4: "#bccad9",
136
+ blt: "#e8f0fc",
137
+ glt: "#e4f6ef",
138
+ alt: "#fdf3e0",
139
+ rlt: "#fde8e8",
140
+ plt: "#f0eafa",
141
+ tlt: "#e3f4f7"
142
+ };
143
+ var containerSx = {
144
+ background: C.bg,
145
+ minHeight: "100vh"
146
+ };
147
+ var filterBarSx = {
148
+ display: "flex",
149
+ alignItems: "center",
150
+ gap: 1,
151
+ flexWrap: "wrap",
152
+ pb: 1.5,
153
+ px: 2
154
+ };
155
+ var contentSx = {
156
+ py: 2,
157
+ px: 1,
158
+ overflow: "auto",
159
+ position: "relative"
160
+ };
161
+ var loadingOverlaySx = {
162
+ position: "absolute",
163
+ top: 0,
164
+ left: 0,
165
+ right: 0,
166
+ bottom: 0,
167
+ background: "rgba(240,244,248,0.7)",
168
+ display: "flex",
169
+ alignItems: "center",
170
+ justifyContent: "center",
171
+ zIndex: 10
172
+ };
173
+ var tablePaperSx = {
174
+ borderRadius: "8px",
175
+ border: "1px solid #e0e7ef",
176
+ overflow: "hidden",
177
+ mb: 2
178
+ };
179
+ var tableRootSx = {
180
+ minWidth: 1400,
181
+ "& .MuiTableCell-root": {
182
+ fontSize: "0.75rem",
183
+ borderBottom: "1px solid #eef1f6",
184
+ py: 0.4,
185
+ px: 1,
186
+ height: 36,
187
+ whiteSpace: "nowrap",
188
+ overflow: "hidden",
189
+ textOverflow: "ellipsis"
190
+ },
191
+ "& .MuiTableRow-root": {
192
+ height: 36
193
+ }
194
+ };
195
+ var ellipsisCellSx = {
196
+ maxWidth: 220,
197
+ overflow: "hidden",
198
+ textOverflow: "ellipsis",
199
+ whiteSpace: "nowrap",
200
+ display: "block"
201
+ };
202
+ var headCellSx = {
203
+ fontFamily: "poppins, Arial, sans-serif",
204
+ bgcolor: "#f1f1f1",
205
+ color: "#333",
206
+ fontWeight: 600,
207
+ whiteSpace: "nowrap",
208
+ fontSize: "0.8rem",
209
+ py: "6px",
210
+ px: "12px"
211
+ };
212
+ var bodyCellSx = {
213
+ fontFamily: "poppins, Arial, sans-serif",
214
+ fontSize: "0.82rem",
215
+ py: "4px",
216
+ px: "12px"
217
+ };
218
+ var tableRowSx = {
219
+ backgroundColor: "#fff",
220
+ cursor: "pointer",
221
+ "&:hover": { backgroundColor: "#f0f7f8" }
222
+ };
223
+ var paginationSx = {
224
+ borderTop: "1px solid #eef1f6",
225
+ "& .MuiTablePagination-displayedRows": { fontSize: "0.73rem" },
226
+ "& .MuiTablePagination-selectLabel": { fontSize: "0.73rem" }
227
+ };
228
+ var searchInputSx = {
229
+ width: 250,
230
+ fontSize: "0.82rem",
231
+ height: 36
232
+ };
233
+ var datePickerSx = {
234
+ width: 150,
235
+ "& .MuiOutlinedInput-root": {
236
+ borderRadius: "7px",
237
+ fontSize: 12,
238
+ height: 30
239
+ },
240
+ "& .MuiInputBase-input": { py: "4px", fontSize: 12 }
241
+ };
242
+ var emptyRowSx = {
243
+ textAlign: "center",
244
+ py: 4,
245
+ color: C.t3,
246
+ fontSize: 13
247
+ };
248
+
249
+ // call-control-sdk/lib/pages/agentPerformanceReport/index.tsx
250
+ import { jsx, jsxs } from "react/jsx-runtime";
251
+ function fmtDur(s) {
252
+ if (!s || s <= 0) return "00:00:00";
253
+ const h = Math.floor(s / 3600);
254
+ const m = Math.floor(s % 3600 / 60);
255
+ const sc = Math.floor(s % 60);
256
+ return [h, m, sc].map((x) => String(x).padStart(2, "0")).join(":");
257
+ }
258
+ function getVal(row, key) {
259
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
260
+ switch (key) {
261
+ case "id":
262
+ return row.agentId || "";
263
+ case "name":
264
+ return row.fullName || "";
265
+ case "process":
266
+ return row.processName || "";
267
+ case "queue":
268
+ return row.queueNames || "";
269
+ case "total":
270
+ return (_a = row.totalCalls) != null ? _a : 0;
271
+ case "ans":
272
+ return (_b = row.answeredCalls) != null ? _b : 0;
273
+ case "miss":
274
+ return (_c = row.missedCalls) != null ? _c : 0;
275
+ case "inTotal":
276
+ return (_d = row.inCalls) != null ? _d : 0;
277
+ case "outTotal":
278
+ return (_e = row.outCalls) != null ? _e : 0;
279
+ case "aht":
280
+ return (_f = row.ahtSeconds) != null ? _f : 0;
281
+ case "loginDur":
282
+ return (_g = row.loginDurationSeconds) != null ? _g : 0;
283
+ case "talk":
284
+ return (_h = row.talkTimeSeconds) != null ? _h : 0;
285
+ case "hold":
286
+ return (_i = row.holdTimeSeconds) != null ? _i : 0;
287
+ case "wrapup":
288
+ return (_j = row.wrapupSeconds) != null ? _j : 0;
289
+ case "breakTime":
290
+ return (_k = row.breakTimeSeconds) != null ? _k : 0;
291
+ case "idle":
292
+ return (_l = row.idleTimeSeconds) != null ? _l : 0;
293
+ case "adherence":
294
+ return (_m = row.adherencePct) != null ? _m : null;
295
+ case "firstLogin":
296
+ return row.firstLoginTime || "";
297
+ default:
298
+ return "";
299
+ }
300
+ }
301
+ function renderCellValue(row, key) {
302
+ const v = getVal(row, key);
303
+ const durKeys = ["aht", "loginDur", "talk", "hold", "wrapup", "breakTime", "idle"];
304
+ if (durKeys.includes(key)) return fmtDur(Number(v) || 0);
305
+ if (key === "adherence") return v != null ? `${v}%` : "\u2014";
306
+ if (key === "firstLogin") return v ? dayjs(v).format("DD MMM YY hh:mm A") : "";
307
+ return v == null ? "" : String(v);
308
+ }
309
+ function splitQueues(raw) {
310
+ if (!raw) return [];
311
+ return String(raw).split(/[,;|]/).map((q) => q.trim()).filter(Boolean);
312
+ }
313
+ var AgentPerformanceReportContent = memo(() => {
314
+ const [startDate, setStartDate] = useState2(dayjs().startOf("day"));
315
+ const [endDate, setEndDate] = useState2(dayjs());
316
+ const [quickRange, setQuickRange] = useState2("today");
317
+ const [search, setSearch] = useState2("");
318
+ const [orderBy, setOrderBy] = useState2("total");
319
+ const [order, setOrder] = useState2("desc");
320
+ const [page, setPage] = useState2(0);
321
+ const [rowsPerPage, setRowsPerPage] = useState2(10);
322
+ const [selectedAgent, setSelectedAgent] = useState2(null);
323
+ const { agents, loading, error, setError, fetchAgents, exportExcel } = useAgentPerformanceReport();
324
+ const fetchReport = useCallback2(
325
+ async (sd, ed) => {
326
+ const fromDate = sd != null ? sd : startDate;
327
+ const toDate = ed != null ? ed : endDate;
328
+ if (!fromDate || !toDate) {
329
+ setError("Select date range");
330
+ return;
331
+ }
332
+ setPage(0);
333
+ await fetchAgents({
334
+ start_date: fromDate.format("YYYY-MM-DDTHH:mm:ss"),
335
+ end_date: toDate.format("YYYY-MM-DDTHH:mm:ss")
336
+ });
337
+ },
338
+ [startDate, endDate, fetchAgents, setError]
339
+ );
340
+ useEffect(() => {
341
+ if (startDate && endDate) fetchReport();
342
+ }, []);
343
+ const setQuick = (range) => {
344
+ setQuickRange(range);
345
+ const today = dayjs();
346
+ let sd = today;
347
+ const ed = today;
348
+ if (range === "week") sd = today.startOf("week");
349
+ else if (range === "month") sd = today.startOf("month");
350
+ setStartDate(sd);
351
+ setEndDate(ed);
352
+ fetchReport(sd, ed);
353
+ };
354
+ const filtered = useMemo(() => {
355
+ if (!search) return agents;
356
+ const s = search.toLowerCase();
357
+ return agents.filter(
358
+ (r) => (r.fullName || "").toLowerCase().includes(s) || (r.agentId || "").toLowerCase().includes(s)
359
+ );
360
+ }, [agents, search]);
361
+ const sorted = useMemo(() => {
362
+ return [...filtered].sort((a, b) => {
363
+ const av = getVal(a, orderBy);
364
+ const bv = getVal(b, orderBy);
365
+ if (typeof av === "number" && typeof bv === "number") {
366
+ return order === "asc" ? av - bv : bv - av;
367
+ }
368
+ return order === "asc" ? String(av).localeCompare(String(bv)) : String(bv).localeCompare(String(av));
369
+ });
370
+ }, [filtered, orderBy, order]);
371
+ const paged = sorted.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage);
372
+ const handleSort = (key) => {
373
+ setOrder(orderBy === key && order === "asc" ? "desc" : "asc");
374
+ setOrderBy(key);
375
+ };
376
+ const handleExport = async () => {
377
+ if (!startDate || !endDate) {
378
+ setError("Select date range");
379
+ return;
380
+ }
381
+ try {
382
+ await exportExcel({
383
+ start_date: startDate.format("YYYY-MM-DDTHH:mm:ss"),
384
+ end_date: endDate.format("YYYY-MM-DDTHH:mm:ss")
385
+ });
386
+ } catch (err) {
387
+ setError((err == null ? void 0 : err.message) || "Failed to export Excel");
388
+ }
389
+ };
390
+ if (selectedAgent) {
391
+ return /* @__PURE__ */ jsx(
392
+ agentDetailReport_default,
393
+ {
394
+ agentRow: selectedAgent,
395
+ onBack: () => setSelectedAgent(null),
396
+ initialStartDate: startDate,
397
+ initialEndDate: endDate,
398
+ initialQuickRange: quickRange,
399
+ from: "REPORTS_LIST"
400
+ }
401
+ );
402
+ }
403
+ return /* @__PURE__ */ jsx(LocalizationProvider, { dateAdapter: AdapterDayjs, children: /* @__PURE__ */ jsxs(Box, { sx: containerSx, children: [
404
+ /* @__PURE__ */ jsx(
405
+ SDKPageHeader,
406
+ {
407
+ title: "Performance Report",
408
+ actions: /* @__PURE__ */ jsxs(Stack, { direction: "row", alignItems: "center", spacing: 1, children: [
409
+ /* @__PURE__ */ jsx(
410
+ OutlinedInput,
411
+ {
412
+ size: "small",
413
+ value: search,
414
+ onChange: (e) => {
415
+ setSearch(e.target.value);
416
+ setPage(0);
417
+ },
418
+ placeholder: "Search name, ID...",
419
+ sx: searchInputSx,
420
+ endAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx(SearchIcon, { sx: { fontSize: 18, color: "#999" } }) })
421
+ }
422
+ ),
423
+ /* @__PURE__ */ jsx(
424
+ SDKButton,
425
+ {
426
+ startIcon: /* @__PURE__ */ jsx(FileDownloadIcon, { sx: { fontSize: "0.95rem" } }),
427
+ disabled: !agents.length,
428
+ onClick: handleExport,
429
+ children: "Export Excel"
430
+ }
431
+ )
432
+ ] })
433
+ }
434
+ ),
435
+ /* @__PURE__ */ jsxs(Box, { sx: filterBarSx, children: [
436
+ /* @__PURE__ */ jsx(
437
+ DatePicker,
438
+ {
439
+ value: startDate,
440
+ onChange: (val) => {
441
+ setStartDate(val);
442
+ setQuickRange("custom");
443
+ },
444
+ slotProps: { textField: { size: "small", sx: datePickerSx } }
445
+ }
446
+ ),
447
+ /* @__PURE__ */ jsx(Box, { component: "span", sx: { fontSize: 12, color: C.t3 }, children: "to" }),
448
+ /* @__PURE__ */ jsx(
449
+ DatePicker,
450
+ {
451
+ value: endDate,
452
+ onChange: (val) => {
453
+ setEndDate(val);
454
+ setQuickRange("custom");
455
+ },
456
+ slotProps: { textField: { size: "small", sx: datePickerSx } }
457
+ }
458
+ ),
459
+ /* @__PURE__ */ jsx(
460
+ SDKButton,
461
+ {
462
+ variant: quickRange === "today" ? "primary" : "outlined",
463
+ onClick: () => setQuick("today"),
464
+ children: "Today"
465
+ }
466
+ ),
467
+ /* @__PURE__ */ jsx(
468
+ SDKButton,
469
+ {
470
+ variant: quickRange === "week" ? "primary" : "outlined",
471
+ onClick: () => setQuick("week"),
472
+ children: "This Week"
473
+ }
474
+ ),
475
+ /* @__PURE__ */ jsx(
476
+ SDKButton,
477
+ {
478
+ variant: quickRange === "month" ? "primary" : "outlined",
479
+ onClick: () => setQuick("month"),
480
+ children: "This Month"
481
+ }
482
+ ),
483
+ /* @__PURE__ */ jsx(SDKButton, { variant: "outlined", onClick: () => fetchReport(), children: "Search" })
484
+ ] }),
485
+ error && /* @__PURE__ */ jsx(Alert, { severity: "error", sx: { mx: 2.5, mt: 1.5 }, onClose: () => setError(""), children: error }),
486
+ /* @__PURE__ */ jsxs(Box, { sx: contentSx, children: [
487
+ loading && /* @__PURE__ */ jsx(Box, { sx: loadingOverlaySx, children: /* @__PURE__ */ jsx(CircularProgress, {}) }),
488
+ /* @__PURE__ */ jsxs(Paper, { elevation: 0, sx: tablePaperSx, children: [
489
+ /* @__PURE__ */ jsx(TableContainer, { children: /* @__PURE__ */ jsxs(Table, { size: "small", sx: tableRootSx, children: [
490
+ /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
491
+ COLUMNS.map((col) => /* @__PURE__ */ jsx(TableCell, { align: col.align || "left", sx: headCellSx, children: /* @__PURE__ */ jsx(
492
+ TableSortLabel,
493
+ {
494
+ active: orderBy === col.key,
495
+ direction: orderBy === col.key ? order : "asc",
496
+ onClick: () => handleSort(col.key),
497
+ children: col.label
498
+ }
499
+ ) }, col.key)),
500
+ /* @__PURE__ */ jsx(TableCell, { sx: __spreadProps(__spreadValues({}, headCellSx), { width: 48 }), children: "Detail" })
501
+ ] }) }),
502
+ /* @__PURE__ */ jsxs(TableBody, { children: [
503
+ paged.map((row, idx) => /* @__PURE__ */ jsxs(
504
+ TableRow,
505
+ {
506
+ hover: true,
507
+ onClick: () => setSelectedAgent(row),
508
+ sx: tableRowSx,
509
+ children: [
510
+ COLUMNS.map((col) => {
511
+ if (col.key === "queue") {
512
+ const queues = splitQueues(row.queueNames);
513
+ const shown = queues.slice(0, 3).join(", ");
514
+ const overflow = queues.length > 3;
515
+ const display = overflow ? `${shown}\u2026` : shown;
516
+ const title = queues.join(", ") || "\u2014";
517
+ return /* @__PURE__ */ jsx(
518
+ TableCell,
519
+ {
520
+ align: col.align || "left",
521
+ sx: __spreadProps(__spreadValues({}, bodyCellSx), { maxWidth: 240 }),
522
+ children: /* @__PURE__ */ jsx(Tooltip, { title, placement: "top", arrow: true, children: /* @__PURE__ */ jsx(Box, { component: "span", sx: ellipsisCellSx, children: display || "\u2014" }) })
523
+ },
524
+ col.key
525
+ );
526
+ }
527
+ if (col.key === "firstLogin") {
528
+ const text = renderCellValue(row, col.key);
529
+ return /* @__PURE__ */ jsx(
530
+ TableCell,
531
+ {
532
+ align: col.align || "left",
533
+ sx: __spreadProps(__spreadValues({}, bodyCellSx), { whiteSpace: "nowrap" }),
534
+ children: text
535
+ },
536
+ col.key
537
+ );
538
+ }
539
+ if (col.key === "name") {
540
+ const text = renderCellValue(row, col.key);
541
+ return /* @__PURE__ */ jsx(
542
+ TableCell,
543
+ {
544
+ align: col.align || "left",
545
+ sx: __spreadProps(__spreadValues({}, bodyCellSx), { maxWidth: 200 }),
546
+ children: /* @__PURE__ */ jsx(Tooltip, { title: text || "", placement: "top", arrow: true, children: /* @__PURE__ */ jsx(Box, { component: "span", sx: ellipsisCellSx, children: text }) })
547
+ },
548
+ col.key
549
+ );
550
+ }
551
+ return /* @__PURE__ */ jsx(TableCell, { align: col.align || "left", sx: bodyCellSx, children: renderCellValue(row, col.key) }, col.key);
552
+ }),
553
+ /* @__PURE__ */ jsx(TableCell, { sx: bodyCellSx, align: "center", children: /* @__PURE__ */ jsx(
554
+ IconButton,
555
+ {
556
+ size: "small",
557
+ onClick: (e) => {
558
+ e.stopPropagation();
559
+ setSelectedAgent(row);
560
+ },
561
+ sx: { color: C.blue },
562
+ children: /* @__PURE__ */ jsx(VisibilityIcon, { sx: { fontSize: 16 } })
563
+ }
564
+ ) })
565
+ ]
566
+ },
567
+ row.agentId || idx
568
+ )),
569
+ paged.length === 0 && !loading && /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: COLUMNS.length + 1, sx: emptyRowSx, children: "No data found" }) })
570
+ ] })
571
+ ] }) }),
572
+ /* @__PURE__ */ jsx(
573
+ TablePagination,
574
+ {
575
+ component: "div",
576
+ count: filtered.length,
577
+ page,
578
+ onPageChange: (_, p) => setPage(p),
579
+ rowsPerPage,
580
+ onRowsPerPageChange: (e) => {
581
+ setRowsPerPage(parseInt(e.target.value, 10));
582
+ setPage(0);
583
+ },
584
+ rowsPerPageOptions: [5, 10, 20, 25, 50],
585
+ sx: paginationSx
586
+ }
587
+ )
588
+ ] })
589
+ ] })
590
+ ] }) });
591
+ });
592
+ var AgentPerformanceReport = () => /* @__PURE__ */ jsx(SDKProvider, { children: /* @__PURE__ */ jsx(AgentPerformanceReportContent, {}) });
593
+ var agentPerformanceReport_default = AgentPerformanceReport;
594
+ export {
595
+ agentPerformanceReport_default as default
596
+ };
597
+ //# sourceMappingURL=agentPerformanceReport-4WNLHIFT.mjs.map