ahs-cti 0.0.8 → 0.0.9

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.
Files changed (139) hide show
  1. package/dist/agentDetailReport-F44HMQ5O.mjs +27 -0
  2. package/dist/agentDetailReport-F44HMQ5O.mjs.map +1 -0
  3. package/dist/{agentPerformanceReport-JZK5DN5E.mjs → agentPerformanceReport-TTOMNENK.mjs} +25 -15
  4. package/dist/{agentPerformanceReport-JZK5DN5E.mjs.map → agentPerformanceReport-TTOMNENK.mjs.map} +1 -1
  5. package/dist/auditReport-QTMAKVTN.mjs +26 -0
  6. package/dist/auditReport-QTMAKVTN.mjs.map +1 -0
  7. package/dist/{callHistory-T3M76D4B.mjs → callHistory-4J4J2XHA.mjs} +20 -10
  8. package/dist/{callHistory-T3M76D4B.mjs.map → callHistory-4J4J2XHA.mjs.map} +1 -1
  9. package/dist/{campaigns-5PVHXBSD.mjs → campaigns-N3UNUGQP.mjs} +23 -13
  10. package/dist/{campaigns-5PVHXBSD.mjs.map → campaigns-N3UNUGQP.mjs.map} +1 -1
  11. package/dist/{caroQualityAuditDashboard-EUDYZ3QY.mjs → caroQualityAuditDashboard-TNS4L2NR.mjs} +12 -2
  12. package/dist/{caroQualityAuditDashboard-EUDYZ3QY.mjs.map → caroQualityAuditDashboard-TNS4L2NR.mjs.map} +1 -1
  13. package/dist/{caroVoiceAI-GGJCVUIQ.mjs → caroVoiceAI-OUTAAIFE.mjs} +12 -2
  14. package/dist/{caroVoiceAI-GGJCVUIQ.mjs.map → caroVoiceAI-OUTAAIFE.mjs.map} +1 -1
  15. package/dist/{cdrReport-ZMDHSZUW.mjs → cdrReport-Z35OLYUL.mjs} +26 -16
  16. package/dist/{cdrReport-ZMDHSZUW.mjs.map → cdrReport-Z35OLYUL.mjs.map} +1 -1
  17. package/dist/chunk-3PNP6G5P.mjs +92 -0
  18. package/dist/chunk-3PNP6G5P.mjs.map +1 -0
  19. package/dist/{chunk-DF5EFKXC.mjs → chunk-45MLTWV7.mjs} +12 -2
  20. package/dist/{chunk-DF5EFKXC.mjs.map → chunk-45MLTWV7.mjs.map} +1 -1
  21. package/dist/chunk-635IIVZE.mjs +24 -0
  22. package/dist/{chunk-FRKV2U3I.mjs.map → chunk-635IIVZE.mjs.map} +1 -1
  23. package/dist/chunk-677RFPP5.mjs +24 -0
  24. package/dist/{chunk-7LE2VTAI.mjs.map → chunk-677RFPP5.mjs.map} +1 -1
  25. package/dist/{chunk-Q6G3MPS7.mjs → chunk-ERSNXW5X.mjs} +11 -1
  26. package/dist/{chunk-Q6G3MPS7.mjs.map → chunk-ERSNXW5X.mjs.map} +1 -1
  27. package/dist/{chunk-H7GRWLYI.mjs → chunk-G6KRLGGC.mjs} +13 -3
  28. package/dist/{chunk-H7GRWLYI.mjs.map → chunk-G6KRLGGC.mjs.map} +1 -1
  29. package/dist/chunk-GFVR3HLK.mjs +24 -0
  30. package/dist/{chunk-6WLG2PXL.mjs.map → chunk-GFVR3HLK.mjs.map} +1 -1
  31. package/dist/{chunk-E6KYWWAI.mjs → chunk-GTI2ZVQX.mjs} +12 -2
  32. package/dist/{chunk-E6KYWWAI.mjs.map → chunk-GTI2ZVQX.mjs.map} +1 -1
  33. package/dist/chunk-H22TUCN3.mjs +24 -0
  34. package/dist/{chunk-AOJRUZTO.mjs.map → chunk-H22TUCN3.mjs.map} +1 -1
  35. package/dist/{chunk-YAQYTUTX.mjs → chunk-HAOFUADN.mjs} +12 -2
  36. package/dist/{chunk-YAQYTUTX.mjs.map → chunk-HAOFUADN.mjs.map} +1 -1
  37. package/dist/{chunk-33QNSXP7.mjs → chunk-JHC7OUQG.mjs} +21 -11
  38. package/dist/chunk-JHC7OUQG.mjs.map +1 -0
  39. package/dist/chunk-KSVNZKRD.mjs +10930 -0
  40. package/dist/chunk-KSVNZKRD.mjs.map +1 -0
  41. package/dist/{chunk-VVDJLUYT.mjs → chunk-M7FJYZF6.mjs} +12 -2
  42. package/dist/{chunk-VVDJLUYT.mjs.map → chunk-M7FJYZF6.mjs.map} +1 -1
  43. package/dist/{chunk-DNTGBNZD.mjs → chunk-NDZDJWXY.mjs} +13 -3
  44. package/dist/{chunk-DNTGBNZD.mjs.map → chunk-NDZDJWXY.mjs.map} +1 -1
  45. package/dist/chunk-S2SMCH2C.mjs +71 -0
  46. package/dist/chunk-S2SMCH2C.mjs.map +1 -0
  47. package/dist/{chunk-IDZWA6HG.mjs → chunk-S34CQVTF.mjs} +14 -4
  48. package/dist/{chunk-IDZWA6HG.mjs.map → chunk-S34CQVTF.mjs.map} +1 -1
  49. package/dist/{chunk-2M3YEXYA.mjs → chunk-SUS5RUCA.mjs} +17 -7
  50. package/dist/{chunk-2M3YEXYA.mjs.map → chunk-SUS5RUCA.mjs.map} +1 -1
  51. package/dist/{chunk-3J7KQNEU.mjs → chunk-TCYBXDAP.mjs} +13 -3
  52. package/dist/{chunk-3J7KQNEU.mjs.map → chunk-TCYBXDAP.mjs.map} +1 -1
  53. package/dist/chunk-VII5JNA6.mjs +24 -0
  54. package/dist/{chunk-WTBVFN4H.mjs.map → chunk-VII5JNA6.mjs.map} +1 -1
  55. package/dist/chunk-W3ECDLUB.mjs +24 -0
  56. package/dist/{chunk-OHJIW3I3.mjs.map → chunk-W3ECDLUB.mjs.map} +1 -1
  57. package/dist/{chunk-VBIDPX5Z.mjs → chunk-Y4PAUTZ4.mjs} +13 -3
  58. package/dist/{chunk-VBIDPX5Z.mjs.map → chunk-Y4PAUTZ4.mjs.map} +1 -1
  59. package/dist/{chunk-NAZO4HKB.mjs → chunk-ZSRD3ZXF.mjs} +12 -2
  60. package/dist/{chunk-NAZO4HKB.mjs.map → chunk-ZSRD3ZXF.mjs.map} +1 -1
  61. package/dist/index.mjs +33 -23
  62. package/dist/index.mjs.map +1 -1
  63. package/dist/{liveStatus-YSBYSVOO.mjs → liveStatus-PRDEL7CK.mjs} +16 -6
  64. package/dist/{liveStatus-YSBYSVOO.mjs.map → liveStatus-PRDEL7CK.mjs.map} +1 -1
  65. package/dist/{loginReport-YIVBJVJD.mjs → loginReport-47QNACQU.mjs} +22 -12
  66. package/dist/{loginReport-YIVBJVJD.mjs.map → loginReport-47QNACQU.mjs.map} +1 -1
  67. package/dist/{managementDashboard-7EMQC2UA.mjs → managementDashboard-SZFYULKA.mjs} +22 -12
  68. package/dist/{managementDashboard-7EMQC2UA.mjs.map → managementDashboard-SZFYULKA.mjs.map} +1 -1
  69. package/dist/{qualityAuditDashboard-ENGQN2WQ.mjs → qualityAuditDashboard-FHRGB77R.mjs} +12 -2
  70. package/dist/{qualityAuditDashboard-ENGQN2WQ.mjs.map → qualityAuditDashboard-FHRGB77R.mjs.map} +1 -1
  71. package/dist-react/agentDetailReport-PDKQKJNL.mjs +23 -0
  72. package/dist-react/agentPerformanceReport-MU2FASNN.mjs +544 -0
  73. package/dist-react/agentPerformanceReport-MU2FASNN.mjs.map +1 -0
  74. package/dist-react/auditReport-WH2KDNYT.mjs +25 -0
  75. package/{dist/auditReport-6ZUJ4UFO.mjs.map → dist-react/auditReport-WH2KDNYT.mjs.map} +1 -1
  76. package/dist-react/callHistory-HXXRYUIV.mjs +832 -0
  77. package/dist-react/callHistory-HXXRYUIV.mjs.map +1 -0
  78. package/dist-react/campaigns-J7KIAATE.mjs +3139 -0
  79. package/dist-react/campaigns-J7KIAATE.mjs.map +1 -0
  80. package/dist-react/caroQualityAuditDashboard-THYPVOCP.mjs +76 -0
  81. package/dist-react/caroQualityAuditDashboard-THYPVOCP.mjs.map +1 -0
  82. package/dist-react/caroVoiceAI-XGDUETXI.mjs +31 -0
  83. package/dist-react/caroVoiceAI-XGDUETXI.mjs.map +1 -0
  84. package/dist-react/cdrReport-SX2FZAO6.mjs +858 -0
  85. package/dist-react/cdrReport-SX2FZAO6.mjs.map +1 -0
  86. package/dist-react/chunk-4YF4IDV6.mjs +72 -0
  87. package/dist-react/chunk-4YF4IDV6.mjs.map +1 -0
  88. package/dist-react/chunk-ADM2JJCP.mjs +190 -0
  89. package/dist-react/chunk-ADM2JJCP.mjs.map +1 -0
  90. package/dist-react/chunk-EN7HM2MD.mjs +688 -0
  91. package/dist-react/chunk-EN7HM2MD.mjs.map +1 -0
  92. package/{dist/chunk-LHE4QGJJ.mjs → dist-react/chunk-F7G2XFRU.mjs} +12 -2
  93. package/{dist/chunk-LHE4QGJJ.mjs.map → dist-react/chunk-F7G2XFRU.mjs.map} +1 -1
  94. package/{dist/chunk-DJP744FF.mjs → dist-react/chunk-GUMGXVIT.mjs} +12 -2
  95. package/{dist/chunk-DJP744FF.mjs.map → dist-react/chunk-GUMGXVIT.mjs.map} +1 -1
  96. package/dist-react/chunk-KRXHK4AU.mjs +127 -0
  97. package/dist-react/chunk-KRXHK4AU.mjs.map +1 -0
  98. package/{dist/chunk-U2UDKXMB.mjs → dist-react/chunk-LWDAC6QU.mjs} +12 -2
  99. package/{dist/chunk-U2UDKXMB.mjs.map → dist-react/chunk-LWDAC6QU.mjs.map} +1 -1
  100. package/dist-react/chunk-LX6I32Y4.mjs +106 -0
  101. package/dist-react/chunk-LX6I32Y4.mjs.map +1 -0
  102. package/dist-react/chunk-MCD5FQNY.mjs +428 -0
  103. package/dist-react/chunk-MCD5FQNY.mjs.map +1 -0
  104. package/dist-react/chunk-MD472UKG.mjs +757 -0
  105. package/{dist/chunk-33QNSXP7.mjs.map → dist-react/chunk-MD472UKG.mjs.map} +1 -1
  106. package/dist-react/chunk-ORNNWQI6.mjs +67 -0
  107. package/dist-react/chunk-ORNNWQI6.mjs.map +1 -0
  108. package/dist-react/chunk-S4J35V4B.mjs +126 -0
  109. package/dist-react/chunk-S4J35V4B.mjs.map +1 -0
  110. package/dist-react/chunk-T53WMN5A.mjs +126 -0
  111. package/dist-react/chunk-T53WMN5A.mjs.map +1 -0
  112. package/dist-react/chunk-UTSRABCL.mjs +96 -0
  113. package/dist-react/chunk-UTSRABCL.mjs.map +1 -0
  114. package/dist-react/incoming-4WP3FJI4.mp3 +0 -0
  115. package/dist-react/incoming.mp3 +0 -0
  116. package/dist-react/index.d.mts +2476 -0
  117. package/dist-react/index.d.ts +2477 -0
  118. package/dist-react/index.js +26713 -0
  119. package/dist-react/index.js.map +1 -0
  120. package/dist-react/index.mjs +4675 -0
  121. package/dist-react/index.mjs.map +1 -0
  122. package/dist-react/liveStatus-IDZ7CPYK.mjs +1087 -0
  123. package/dist-react/liveStatus-IDZ7CPYK.mjs.map +1 -0
  124. package/dist-react/loginReport-F47GUU53.mjs +990 -0
  125. package/dist-react/loginReport-F47GUU53.mjs.map +1 -0
  126. package/dist-react/managementDashboard-GC5E7NEL.mjs +540 -0
  127. package/dist-react/managementDashboard-GC5E7NEL.mjs.map +1 -0
  128. package/dist-react/qualityAuditDashboard-ZAM7HRNH.mjs +76 -0
  129. package/dist-react/qualityAuditDashboard-ZAM7HRNH.mjs.map +1 -0
  130. package/package.json +17 -2
  131. package/dist/agentDetailReport-ZR7U2LLB.mjs +0 -17
  132. package/dist/auditReport-6ZUJ4UFO.mjs +0 -16
  133. package/dist/chunk-6WLG2PXL.mjs +0 -14
  134. package/dist/chunk-7LE2VTAI.mjs +0 -14
  135. package/dist/chunk-AOJRUZTO.mjs +0 -14
  136. package/dist/chunk-FRKV2U3I.mjs +0 -14
  137. package/dist/chunk-OHJIW3I3.mjs +0 -14
  138. package/dist/chunk-WTBVFN4H.mjs +0 -14
  139. /package/{dist/agentDetailReport-ZR7U2LLB.mjs.map → dist-react/agentDetailReport-PDKQKJNL.mjs.map} +0 -0
@@ -0,0 +1,540 @@
1
+ import * as __ext_react from "react";
2
+ import * as __ext_react_dom from "react-dom";
3
+ import * as __ext_react_jsx from "react/jsx-runtime";
4
+ var __cjsExternals = { "react": __ext_react, "react-dom": __ext_react_dom, "react/jsx-runtime": __ext_react_jsx };
5
+ var require = function (id) {
6
+ var mod = __cjsExternals[id];
7
+ if (mod) return mod.default || mod;
8
+ throw new Error('Dynamic require of "' + id + '" is not supported');
9
+ };
10
+
11
+ import {
12
+ ReportFilterBar,
13
+ headCellSx
14
+ } from "./chunk-MCD5FQNY.mjs";
15
+ import {
16
+ PageHeader
17
+ } from "./chunk-KRXHK4AU.mjs";
18
+ import {
19
+ AppButton
20
+ } from "./chunk-LX6I32Y4.mjs";
21
+ import "./chunk-UTSRABCL.mjs";
22
+ import {
23
+ SDKProvider
24
+ } from "./chunk-4YF4IDV6.mjs";
25
+ import {
26
+ END_POINT,
27
+ axios_default
28
+ } from "./chunk-F7G2XFRU.mjs";
29
+ import {
30
+ __spreadProps,
31
+ __spreadValues
32
+ } from "./chunk-S4J35V4B.mjs";
33
+
34
+ // call-control-sdk/lib/pages/managementDashboard/index.tsx
35
+ import { useState, useEffect, useCallback, useMemo, useRef } from "react";
36
+ import {
37
+ Box,
38
+ Paper,
39
+ Stack,
40
+ Typography,
41
+ CircularProgress,
42
+ Alert,
43
+ Table,
44
+ TableBody,
45
+ TableCell,
46
+ TableContainer,
47
+ TableHead,
48
+ TableRow,
49
+ TextField,
50
+ InputAdornment,
51
+ Chip,
52
+ Radio,
53
+ RadioGroup,
54
+ FormControlLabel
55
+ } from "@mui/material";
56
+ import dayjs from "dayjs";
57
+ import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
58
+ import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
59
+ import {
60
+ ComposedChart,
61
+ Bar,
62
+ Line,
63
+ XAxis,
64
+ YAxis,
65
+ CartesianGrid,
66
+ Tooltip as RTooltip,
67
+ ResponsiveContainer
68
+ } from "recharts";
69
+ import SearchIcon from "@mui/icons-material/Search";
70
+ import FileDownloadIcon from "@mui/icons-material/FileDownload";
71
+ import RefreshIcon from "@mui/icons-material/Refresh";
72
+
73
+ // call-control-sdk/lib/pages/managementDashboard/useManagementDashboard.ts
74
+ function buildQs(params) {
75
+ const qs = new URLSearchParams();
76
+ if (params.start_date) qs.append("start_date", params.start_date);
77
+ if (params.end_date) qs.append("end_date", params.end_date);
78
+ if (params.agent_id != null) qs.append("agent_id", String(params.agent_id));
79
+ const str = qs.toString();
80
+ return str ? `?${str}` : "";
81
+ }
82
+ async function getManagementDashboard(params) {
83
+ const res = await axios_default.get(
84
+ `${END_POINT.MANAGEMENT_DASHBOARD}${buildQs(params)}`
85
+ );
86
+ return res.data;
87
+ }
88
+
89
+ // call-control-sdk/lib/pages/managementDashboard/index.tsx
90
+ import { jsx, jsxs } from "react/jsx-runtime";
91
+ var C = {
92
+ navy: "#1a3a6b",
93
+ blue: "#2b6cb0",
94
+ green: "#276749",
95
+ amber: "#c47c00",
96
+ red: "#c53030",
97
+ teal: "#0b7a8f",
98
+ surface: "#fff",
99
+ s2: "#f7f9fc",
100
+ s3: "#eef2f7",
101
+ b1: "rgba(20,50,100,.07)",
102
+ b2: "rgba(20,50,100,.13)",
103
+ t1: "#2d3748",
104
+ t2: "#4a5568",
105
+ t3: "#718096",
106
+ blt: "#e8f0fc",
107
+ glt: "#e4f6ef",
108
+ alt: "#fdf3e0",
109
+ rlt: "#fde8e8",
110
+ tlt: "#e3f4f7"
111
+ };
112
+ var headSx = __spreadProps(__spreadValues({}, headCellSx), { py: 1, px: 1.5 });
113
+ var cellSx = { fontSize: 12, py: 0.8, px: 1.5, borderBottom: `1px solid ${C.b1}` };
114
+ var monoSx = { fontFamily: "'JetBrains Mono', monospace", fontSize: 12, fontWeight: 700 };
115
+ var labelSx = { fontSize: 11, fontWeight: 700, letterSpacing: 0.7, textTransform: "uppercase", color: C.t2 };
116
+ var cardPaper = { background: C.surface, border: `1px solid #dce3ef`, borderRadius: "6px", overflow: "hidden", boxShadow: "0 1px 4px rgba(0,0,0,.09)" };
117
+ var cardHeader = { px: 1.5, py: 1, background: C.s2, borderBottom: `1px solid ${C.b1}`, display: "flex", alignItems: "center", justifyContent: "space-between" };
118
+ var EMPTY = {
119
+ inbound: { total: 0, answered: 0, unanswered: 0, answered_pct: 0, unanswered_pct: 0 },
120
+ outbound: { total: 0, answered: 0, unanswered: 0, answered_pct: 0, unanswered_pct: 0 },
121
+ totals: { total_calls: 0, total_answered: 0, highest_duration: "00:00:00", lowest_duration: "00:00:00", calls_lt_30sec: 0, avg_inbound_duration: "00:00:00", avg_outbound_duration: "00:00:00" },
122
+ abandoned: { total: 0, called_back: 0, to_call: 0, called_back_pct: 0, to_call_pct: 0, avg_callback_duration: "00:00:00" },
123
+ ivr: { total: 0, called_back: 0, to_call: 0, called_back_pct: 0, to_call_pct: 0 },
124
+ waiting: { avg_wait_time: "00:00:00", avg_lang_selection: "00:00:00", avg_queue_wait: "00:00:00" },
125
+ cht: [],
126
+ queue_calls: [],
127
+ hourly_chart: [],
128
+ repeated_calls: []
129
+ };
130
+ function DirectionCard({ title, data }) {
131
+ return /* @__PURE__ */ jsxs(Paper, { sx: cardPaper, children: [
132
+ /* @__PURE__ */ jsx(Box, { sx: cardHeader, children: /* @__PURE__ */ jsx(Typography, { sx: labelSx, children: title }) }),
133
+ /* @__PURE__ */ jsxs(Box, { sx: { p: 1.5 }, children: [
134
+ /* @__PURE__ */ jsx(Typography, { sx: { fontFamily: "'Barlow Condensed', sans-serif", fontSize: 32, fontWeight: 800, color: C.navy, lineHeight: 1, mb: 1.2 }, children: data.total.toLocaleString() }),
135
+ /* @__PURE__ */ jsx(Box, { sx: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 1, borderTop: `2px solid ${C.s3}`, pt: 1 }, children: [
136
+ { label: "ANSWERED", value: data.answered, pct: data.answered_pct, color: C.blue },
137
+ { label: "UNANSWERED", value: data.unanswered, pct: data.unanswered_pct, color: C.t3 }
138
+ ].map(({ label, value, pct, color }) => /* @__PURE__ */ jsxs(Box, { children: [
139
+ /* @__PURE__ */ jsx(Typography, { sx: { fontSize: 10, fontWeight: 700, letterSpacing: 0.5, color: C.t3, mb: 0.3 }, children: label }),
140
+ /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "baseline", gap: 0.5 }, children: [
141
+ /* @__PURE__ */ jsx(Typography, { sx: { fontSize: 18, fontWeight: 700, color }, children: value.toLocaleString() }),
142
+ /* @__PURE__ */ jsxs(Typography, { sx: { fontSize: 11, color: C.t3 }, children: [
143
+ pct.toFixed(1),
144
+ "%"
145
+ ] })
146
+ ] })
147
+ ] }, label)) })
148
+ ] })
149
+ ] });
150
+ }
151
+ function QueueCallsCard({ data }) {
152
+ return /* @__PURE__ */ jsxs(Paper, { sx: cardPaper, children: [
153
+ /* @__PURE__ */ jsx(Box, { sx: cardHeader, children: /* @__PURE__ */ jsx(Typography, { sx: labelSx, children: "Queue Wise Calls" }) }),
154
+ /* @__PURE__ */ jsxs(Box, { sx: { p: 1.5 }, children: [
155
+ data.length === 0 && /* @__PURE__ */ jsx(Typography, { sx: { fontSize: 12, color: C.t3, textAlign: "center", py: 2 }, children: "No data" }),
156
+ data.map((q, i) => /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center", py: 0.6, borderBottom: `1px solid #f0f0f0`, "&:last-child": { borderBottom: "none" } }, children: [
157
+ /* @__PURE__ */ jsx(Typography, { sx: { fontSize: 12, fontWeight: 600, color: C.t2 }, children: q.queue_name }),
158
+ /* @__PURE__ */ jsx(Box, { sx: { background: i === 0 ? "#3182ce" : "#90cdf4", color: i === 0 ? "#fff" : "#1a365d", borderRadius: "4px", px: 1.2, py: 0.3, minWidth: 44, textAlign: "center", fontSize: 14, fontWeight: 700 }, children: q.call_count })
159
+ ] }, q.queue_name))
160
+ ] })
161
+ ] });
162
+ }
163
+ function AbandonedCard({ data }) {
164
+ return /* @__PURE__ */ jsxs(Paper, { sx: cardPaper, children: [
165
+ /* @__PURE__ */ jsx(Box, { sx: cardHeader, children: /* @__PURE__ */ jsx(Typography, { sx: labelSx, children: "Abandoned Patients" }) }),
166
+ /* @__PURE__ */ jsxs(Box, { sx: { p: 1.5 }, children: [
167
+ /* @__PURE__ */ jsx(Typography, { sx: { fontFamily: "'Barlow Condensed', sans-serif", fontSize: 30, fontWeight: 800, color: C.navy, lineHeight: 1, mb: 1 }, children: data.total.toLocaleString() }),
168
+ [
169
+ { label: "Called Back Patients", value: data.called_back, pct: data.called_back_pct },
170
+ { label: "To be Called Patients", value: data.to_call, pct: data.to_call_pct }
171
+ ].map(({ label, value, pct }) => /* @__PURE__ */ jsxs(Box, { sx: { mb: 0.4 }, children: [
172
+ /* @__PURE__ */ jsxs(Typography, { sx: { fontSize: 11, color: C.t3, display: "inline" }, children: [
173
+ label,
174
+ " "
175
+ ] }),
176
+ /* @__PURE__ */ jsxs(Typography, { sx: { fontSize: 13, fontWeight: 700, color: C.blue, display: "inline" }, children: [
177
+ value,
178
+ " "
179
+ ] }),
180
+ /* @__PURE__ */ jsxs(Typography, { sx: { fontSize: 11, fontWeight: 700, color: "#48bb78", display: "inline" }, children: [
181
+ pct.toFixed(1),
182
+ "%"
183
+ ] })
184
+ ] }, label))
185
+ ] })
186
+ ] });
187
+ }
188
+ function AvgCallbackCard({ duration }) {
189
+ return /* @__PURE__ */ jsxs(Paper, { sx: cardPaper, children: [
190
+ /* @__PURE__ */ jsx(Box, { sx: cardHeader, children: /* @__PURE__ */ jsx(Typography, { sx: labelSx, children: "Avg Callback Duration" }) }),
191
+ /* @__PURE__ */ jsx(Box, { sx: { p: 1.5 }, children: /* @__PURE__ */ jsx(Typography, { sx: { fontFamily: "'JetBrains Mono', monospace", fontSize: 26, fontWeight: 700, color: C.navy, mt: 1, letterSpacing: 1 }, children: duration }) })
192
+ ] });
193
+ }
194
+ function IvrCard({ data }) {
195
+ return /* @__PURE__ */ jsxs(Paper, { sx: cardPaper, children: [
196
+ /* @__PURE__ */ jsx(Box, { sx: cardHeader, children: /* @__PURE__ */ jsx(Typography, { sx: labelSx, children: "IVR Patients" }) }),
197
+ /* @__PURE__ */ jsxs(Box, { sx: { p: 1.5 }, children: [
198
+ /* @__PURE__ */ jsx(Typography, { sx: { fontFamily: "'Barlow Condensed', sans-serif", fontSize: 30, fontWeight: 800, color: C.navy, lineHeight: 1, mb: 1 }, children: data.total.toLocaleString() }),
199
+ [
200
+ { label: "Called Back", value: data.called_back, pct: data.called_back_pct },
201
+ { label: "To Be Called", value: data.to_call, pct: data.to_call_pct }
202
+ ].map(({ label, value, pct }) => /* @__PURE__ */ jsxs(Box, { sx: { mb: 0.4 }, children: [
203
+ /* @__PURE__ */ jsxs(Typography, { sx: { fontSize: 11, color: C.t3, display: "inline" }, children: [
204
+ label,
205
+ " "
206
+ ] }),
207
+ /* @__PURE__ */ jsxs(Typography, { sx: { fontSize: 13, fontWeight: 700, color: C.blue, display: "inline" }, children: [
208
+ value,
209
+ " "
210
+ ] }),
211
+ /* @__PURE__ */ jsxs(Typography, { sx: { fontSize: 11, fontWeight: 700, color: "#48bb78", display: "inline" }, children: [
212
+ pct.toFixed(1),
213
+ "%"
214
+ ] })
215
+ ] }, label))
216
+ ] })
217
+ ] });
218
+ }
219
+ function statusColor(status) {
220
+ const s = status == null ? void 0 : status.toUpperCase();
221
+ if (s === "ANSWERED") return C.green;
222
+ if (s === "CANCEL") return C.red;
223
+ if (s === "ABANDONED") return "#c05621";
224
+ return C.t2;
225
+ }
226
+ function ManagementDashboardContent() {
227
+ const [startDate, setStartDate] = useState(dayjs().startOf("day"));
228
+ const [endDate, setEndDate] = useState(dayjs());
229
+ const [quickRange, setQuickRange] = useState("today");
230
+ const [data, setData] = useState(EMPTY);
231
+ const [loading, setLoading] = useState(false);
232
+ const [error, setError] = useState("");
233
+ const [repeatedSearch, setRepeatedSearch] = useState("");
234
+ const [chartDir, setChartDir] = useState("inbound");
235
+ const chartRef = useRef(null);
236
+ const fetchDashboard = useCallback(async () => {
237
+ var _a, _b;
238
+ if (!startDate || !endDate) return;
239
+ setLoading(true);
240
+ setError("");
241
+ try {
242
+ const result = await getManagementDashboard({
243
+ start_date: startDate.format("YYYY-MM-DD"),
244
+ end_date: endDate.format("YYYY-MM-DD")
245
+ });
246
+ setData(result);
247
+ } catch (err) {
248
+ setError(((_b = (_a = err == null ? void 0 : err.response) == null ? void 0 : _a.data) == null ? void 0 : _b.detail) || (err == null ? void 0 : err.message) || "Failed to load dashboard");
249
+ } finally {
250
+ setLoading(false);
251
+ }
252
+ }, [startDate, endDate]);
253
+ useEffect(() => {
254
+ fetchDashboard();
255
+ }, [fetchDashboard]);
256
+ const handleQuickRangeChange = (range) => setQuickRange(range);
257
+ const filteredRepeated = useMemo(() => {
258
+ if (!repeatedSearch) return data.repeated_calls;
259
+ const q = repeatedSearch.toLowerCase();
260
+ return data.repeated_calls.filter(
261
+ (r) => r.phone_number.toLowerCase().includes(q) || r.latest_status.toLowerCase().includes(q) || r.latest_call_type.toLowerCase().includes(q)
262
+ );
263
+ }, [data.repeated_calls, repeatedSearch]);
264
+ const hourlyData = useMemo(() => {
265
+ const map = new Map(data.hourly_chart.map((h) => [h.hour, h]));
266
+ return Array.from({ length: 24 }, (_, h) => {
267
+ var _a, _b, _c, _d, _e, _f;
268
+ return {
269
+ hour: `${String(h).padStart(2, "0")}`,
270
+ answered: (_b = (_a = map.get(h)) == null ? void 0 : _a.answered) != null ? _b : 0,
271
+ abandoned: (_d = (_c = map.get(h)) == null ? void 0 : _c.abandoned) != null ? _d : 0,
272
+ agents: (_f = (_e = map.get(h)) == null ? void 0 : _e.agents) != null ? _f : 0
273
+ };
274
+ });
275
+ }, [data.hourly_chart]);
276
+ const downloadChart = () => {
277
+ var _a;
278
+ const svgEl = (_a = chartRef.current) == null ? void 0 : _a.querySelector("svg");
279
+ if (!svgEl) return;
280
+ const svgData = new XMLSerializer().serializeToString(svgEl);
281
+ const canvas = document.createElement("canvas");
282
+ const img = new Image();
283
+ img.onload = () => {
284
+ canvas.width = img.width;
285
+ canvas.height = img.height;
286
+ const ctx = canvas.getContext("2d");
287
+ if (!ctx) return;
288
+ ctx.fillStyle = "#fff";
289
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
290
+ ctx.drawImage(img, 0, 0);
291
+ const a = document.createElement("a");
292
+ a.download = `hourly_chart_${chartDir}.png`;
293
+ a.href = canvas.toDataURL("image/png");
294
+ a.click();
295
+ };
296
+ img.src = "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(svgData)));
297
+ };
298
+ return /* @__PURE__ */ jsx(LocalizationProvider, { dateAdapter: AdapterDayjs, children: /* @__PURE__ */ jsxs(Box, { sx: { background: "transparent", minHeight: "100vh" }, children: [
299
+ /* @__PURE__ */ jsx(
300
+ PageHeader,
301
+ {
302
+ title: "Management Dashboard",
303
+ actions: /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [
304
+ /* @__PURE__ */ jsx(
305
+ AppButton,
306
+ {
307
+ variant: "outlined",
308
+ startIcon: /* @__PURE__ */ jsx(RefreshIcon, { sx: { fontSize: "0.95rem !important" } }),
309
+ onClick: fetchDashboard,
310
+ disabled: loading,
311
+ children: "Refresh"
312
+ }
313
+ ),
314
+ /* @__PURE__ */ jsx(
315
+ AppButton,
316
+ {
317
+ startIcon: /* @__PURE__ */ jsx(FileDownloadIcon, { sx: { fontSize: "0.95rem !important" } }),
318
+ disabled: loading || data.totals.total_calls === 0,
319
+ onClick: () => {
320
+ const rows = data.repeated_calls.map((r) => Object.values(r).join(","));
321
+ const csv = ["Phone,Date,Count,Status,Type,Comments", ...rows].join("\n");
322
+ const a = document.createElement("a");
323
+ a.href = URL.createObjectURL(new Blob([csv], { type: "text/csv" }));
324
+ a.download = `mgmt_dashboard_${startDate == null ? void 0 : startDate.format("YYYY-MM-DD")}.csv`;
325
+ a.click();
326
+ },
327
+ children: "Export CSV"
328
+ }
329
+ )
330
+ ] })
331
+ }
332
+ ),
333
+ /* @__PURE__ */ jsx(
334
+ ReportFilterBar,
335
+ {
336
+ startDate,
337
+ endDate,
338
+ onStartChange: setStartDate,
339
+ onEndChange: setEndDate,
340
+ showTime: false,
341
+ quickRange,
342
+ onQuickRangeChange: handleQuickRangeChange
343
+ }
344
+ ),
345
+ error && /* @__PURE__ */ jsx(Alert, { severity: "error", sx: { mx: 2.5, mt: 1.5 }, onClose: () => setError(""), children: error }),
346
+ loading && /* @__PURE__ */ jsx(Box, { sx: { display: "flex", justifyContent: "center", py: 5 }, children: /* @__PURE__ */ jsx(CircularProgress, { size: 36 }) }),
347
+ !loading && /* @__PURE__ */ jsxs(Box, { sx: { px: { xs: 1, md: 2 }, py: 1.5 }, children: [
348
+ /* @__PURE__ */ jsxs(Box, { sx: {
349
+ display: "grid",
350
+ gridTemplateColumns: { xs: "1fr", sm: "repeat(2, 1fr)", md: "repeat(3, 1fr)", lg: "1.3fr 1.2fr 1.1fr 0.75fr 1.3fr 1.1fr" },
351
+ gap: 1.2,
352
+ mb: 1.2
353
+ }, children: [
354
+ /* @__PURE__ */ jsx(DirectionCard, { title: "Inbound Calls", data: data.inbound }),
355
+ /* @__PURE__ */ jsx(QueueCallsCard, { data: data.queue_calls }),
356
+ /* @__PURE__ */ jsx(AbandonedCard, { data: data.abandoned }),
357
+ /* @__PURE__ */ jsx(AvgCallbackCard, { duration: data.abandoned.avg_callback_duration }),
358
+ /* @__PURE__ */ jsx(DirectionCard, { title: "Outbound Calls", data: data.outbound }),
359
+ /* @__PURE__ */ jsx(IvrCard, { data: data.ivr })
360
+ ] }),
361
+ /* @__PURE__ */ jsxs(Box, { sx: {
362
+ display: "grid",
363
+ gridTemplateColumns: { xs: "1fr", sm: "repeat(2, 1fr)", lg: "1fr 1fr 1.6fr 1.6fr" },
364
+ gap: 1.2,
365
+ mb: 1.2
366
+ }, children: [
367
+ /* @__PURE__ */ jsxs(Paper, { sx: cardPaper, children: [
368
+ /* @__PURE__ */ jsx(Box, { sx: cardHeader, children: /* @__PURE__ */ jsx(Typography, { sx: labelSx, children: "Summary" }) }),
369
+ /* @__PURE__ */ jsxs(Box, { sx: { p: 1.5 }, children: [
370
+ /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "baseline", gap: 0.5, mb: 0.5 }, children: [
371
+ /* @__PURE__ */ jsx(Typography, { sx: { fontFamily: "'Barlow Condensed', sans-serif", fontSize: 22, fontWeight: 800, color: C.navy }, children: data.totals.total_answered.toLocaleString() }),
372
+ /* @__PURE__ */ jsx(Typography, { sx: { fontSize: 14, color: C.t3 }, children: "/" }),
373
+ /* @__PURE__ */ jsx(Typography, { sx: { fontFamily: "'Barlow Condensed', sans-serif", fontSize: 22, fontWeight: 800, color: C.t3 }, children: data.totals.total_calls.toLocaleString() })
374
+ ] }),
375
+ /* @__PURE__ */ jsx(Typography, { sx: { fontSize: 11, color: C.t3, mb: 1 }, children: "Total Calls" }),
376
+ /* @__PURE__ */ jsxs(Box, { sx: { mt: 1 }, children: [
377
+ /* @__PURE__ */ jsx(Typography, { sx: { fontSize: 11, color: C.t3, mb: 0.3 }, children: "Call Duration" }),
378
+ /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", gap: 2 }, children: [
379
+ /* @__PURE__ */ jsxs(Box, { children: [
380
+ /* @__PURE__ */ jsx(Typography, { sx: { fontSize: 10, color: C.t3 }, children: "Highest" }),
381
+ /* @__PURE__ */ jsx(Typography, { sx: __spreadProps(__spreadValues({}, monoSx), { color: C.blue, fontSize: 13 }), children: data.totals.highest_duration })
382
+ ] }),
383
+ /* @__PURE__ */ jsxs(Box, { children: [
384
+ /* @__PURE__ */ jsx(Typography, { sx: { fontSize: 10, color: C.t3 }, children: "Lowest" }),
385
+ /* @__PURE__ */ jsx(Typography, { sx: __spreadProps(__spreadValues({}, monoSx), { color: C.blue, fontSize: 13 }), children: data.totals.lowest_duration })
386
+ ] })
387
+ ] })
388
+ ] }),
389
+ /* @__PURE__ */ jsxs(Box, { sx: { mt: 1 }, children: [
390
+ /* @__PURE__ */ jsx(Typography, { sx: { fontSize: 11, color: C.t3, display: "inline" }, children: "Calls < 30 sec: " }),
391
+ /* @__PURE__ */ jsx(Typography, { sx: __spreadProps(__spreadValues({}, monoSx), { color: C.blue, display: "inline", fontSize: 13 }), children: data.totals.calls_lt_30sec.toLocaleString() })
392
+ ] })
393
+ ] })
394
+ ] }),
395
+ /* @__PURE__ */ jsxs(Paper, { sx: cardPaper, children: [
396
+ /* @__PURE__ */ jsx(Box, { sx: cardHeader, children: /* @__PURE__ */ jsx(Typography, { sx: labelSx, children: "Avg Total Calls Duration" }) }),
397
+ /* @__PURE__ */ jsx(Box, { sx: { p: 1.5 }, children: [
398
+ { label: "Inbound", value: data.totals.avg_inbound_duration },
399
+ { label: "Outbound", value: data.totals.avg_outbound_duration }
400
+ ].map(({ label, value }) => /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center", py: 1, borderBottom: `1px solid ${C.b1}`, "&:last-child": { borderBottom: "none" } }, children: [
401
+ /* @__PURE__ */ jsx(Typography, { sx: { fontSize: 12, fontWeight: 600, color: C.t2 }, children: label }),
402
+ /* @__PURE__ */ jsx(Typography, { sx: __spreadProps(__spreadValues({}, monoSx), { fontSize: 16, color: C.blue }), children: value })
403
+ ] }, label)) })
404
+ ] }),
405
+ /* @__PURE__ */ jsxs(Paper, { sx: cardPaper, children: [
406
+ /* @__PURE__ */ jsx(Box, { sx: cardHeader, children: /* @__PURE__ */ jsx(Typography, { sx: labelSx, children: "Inbound Average Waiting" }) }),
407
+ /* @__PURE__ */ jsx(Box, { sx: { p: 1.5, display: "grid", gridTemplateColumns: "1fr 1fr 1fr", gap: 1, mt: 0.5 }, children: [
408
+ { label: "Waiting Time", value: data.waiting.avg_wait_time },
409
+ { label: "Language Selection", value: data.waiting.avg_lang_selection },
410
+ { label: "Queue Waiting", value: data.waiting.avg_queue_wait }
411
+ ].map(({ label, value }) => /* @__PURE__ */ jsxs(Box, { sx: { textAlign: "center" }, children: [
412
+ /* @__PURE__ */ jsx(Typography, { sx: { fontSize: 10, fontWeight: 600, color: C.t3, mb: 0.5 }, children: label }),
413
+ /* @__PURE__ */ jsx(Typography, { sx: __spreadProps(__spreadValues({}, monoSx), { fontSize: 18, color: C.blue }), children: value })
414
+ ] }, label)) })
415
+ ] }),
416
+ /* @__PURE__ */ jsxs(Paper, { sx: cardPaper, children: [
417
+ /* @__PURE__ */ jsx(Box, { sx: cardHeader, children: /* @__PURE__ */ jsx(Typography, { sx: labelSx, children: "Average CHT" }) }),
418
+ /* @__PURE__ */ jsx(TableContainer, { children: /* @__PURE__ */ jsxs(Table, { size: "small", children: [
419
+ /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
420
+ /* @__PURE__ */ jsx(TableCell, { sx: headSx, children: "Call Type" }),
421
+ /* @__PURE__ */ jsx(TableCell, { sx: headSx, children: "Call Handling Time" }),
422
+ /* @__PURE__ */ jsx(TableCell, { sx: headSx, children: "Talk Duration" }),
423
+ /* @__PURE__ */ jsx(TableCell, { sx: headSx, children: "Hold Duration" })
424
+ ] }) }),
425
+ /* @__PURE__ */ jsxs(TableBody, { children: [
426
+ data.cht.length === 0 && /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: 4, sx: { textAlign: "center", py: 2, color: C.t3, fontSize: 12 }, children: "No data" }) }),
427
+ data.cht.map((row) => /* @__PURE__ */ jsxs(TableRow, { hover: true, children: [
428
+ /* @__PURE__ */ jsx(TableCell, { sx: __spreadProps(__spreadValues({}, cellSx), { fontWeight: 600, color: C.t2 }), children: row.call_type }),
429
+ /* @__PURE__ */ jsx(TableCell, { sx: __spreadProps(__spreadValues(__spreadValues({}, cellSx), monoSx), { color: C.blue }), children: row.call_handling_time }),
430
+ /* @__PURE__ */ jsx(TableCell, { sx: __spreadProps(__spreadValues(__spreadValues({}, cellSx), monoSx), { color: C.blue }), children: row.talk_duration }),
431
+ /* @__PURE__ */ jsx(TableCell, { sx: __spreadProps(__spreadValues(__spreadValues({}, cellSx), monoSx), { color: C.blue }), children: row.hold_duration })
432
+ ] }, row.call_type))
433
+ ] })
434
+ ] }) })
435
+ ] })
436
+ ] }),
437
+ /* @__PURE__ */ jsxs(Box, { sx: { display: "grid", gridTemplateColumns: { xs: "1fr", lg: "1fr 1fr" }, gap: 1.2 }, children: [
438
+ /* @__PURE__ */ jsxs(Paper, { sx: cardPaper, children: [
439
+ /* @__PURE__ */ jsxs(Box, { sx: __spreadProps(__spreadValues({}, cardHeader), { flexWrap: "wrap", gap: 1 }), children: [
440
+ /* @__PURE__ */ jsxs(Box, { children: [
441
+ /* @__PURE__ */ jsx(Typography, { sx: labelSx, children: "Avg Hour Wise Inbound Calls vs Agents" }),
442
+ /* @__PURE__ */ jsx(Stack, { direction: "row", spacing: 1.5, sx: { mt: 0.5 }, children: [
443
+ { color: "#f6a623", label: "Answered" },
444
+ { color: "#90a4c0", label: "Abandoned" },
445
+ { color: "#4a5568", label: "Agents" }
446
+ ].map(({ color, label }) => /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
447
+ /* @__PURE__ */ jsx(Box, { sx: { width: 12, height: 12, borderRadius: "2px", background: color } }),
448
+ /* @__PURE__ */ jsx(Typography, { sx: { fontSize: 11, color: C.t3 }, children: label })
449
+ ] }, label)) })
450
+ ] }),
451
+ /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", flexDirection: "column", alignItems: "flex-end", gap: 0.5 }, children: [
452
+ /* @__PURE__ */ jsxs(
453
+ RadioGroup,
454
+ {
455
+ row: true,
456
+ value: chartDir,
457
+ onChange: (e) => setChartDir(e.target.value),
458
+ sx: { "& .MuiFormControlLabel-root": { mr: 0.5 }, "& .MuiFormControlLabel-label": { fontSize: 12 } },
459
+ children: [
460
+ /* @__PURE__ */ jsx(FormControlLabel, { value: "inbound", control: /* @__PURE__ */ jsx(Radio, { size: "small" }), label: "Inbound" }),
461
+ /* @__PURE__ */ jsx(FormControlLabel, { value: "outbound", control: /* @__PURE__ */ jsx(Radio, { size: "small" }), label: "Outbound" })
462
+ ]
463
+ }
464
+ ),
465
+ /* @__PURE__ */ jsx(
466
+ Typography,
467
+ {
468
+ onClick: downloadChart,
469
+ sx: { fontSize: 11, color: "#3182ce", cursor: "pointer", border: "1px solid #bee3f8", borderRadius: "4px", px: 1, py: 0.3 },
470
+ children: "\u2B07 DOWNLOAD"
471
+ }
472
+ )
473
+ ] })
474
+ ] }),
475
+ /* @__PURE__ */ jsx(Box, { ref: chartRef, sx: { p: 1.5, height: 260 }, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(ComposedChart, { data: hourlyData, margin: { top: 4, right: 30, left: -20, bottom: 0 }, barGap: 1, children: [
476
+ /* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3", stroke: C.b2, vertical: false }),
477
+ /* @__PURE__ */ jsx(XAxis, { dataKey: "hour", tick: { fontSize: 9, fill: C.t3 }, interval: 1 }),
478
+ /* @__PURE__ */ jsx(YAxis, { yAxisId: "left", tick: { fontSize: 9, fill: C.t3 } }),
479
+ /* @__PURE__ */ jsx(YAxis, { yAxisId: "right", orientation: "right", tick: { fontSize: 9, fill: C.t3 } }),
480
+ /* @__PURE__ */ jsx(
481
+ RTooltip,
482
+ {
483
+ contentStyle: { fontSize: 11, borderRadius: 6, border: `1px solid ${C.b2}` },
484
+ formatter: (v, n) => [v, n.charAt(0).toUpperCase() + n.slice(1)]
485
+ }
486
+ ),
487
+ /* @__PURE__ */ jsx(Bar, { yAxisId: "left", dataKey: "answered", fill: "#f6a623", radius: [2, 2, 0, 0], maxBarSize: 14 }),
488
+ /* @__PURE__ */ jsx(Bar, { yAxisId: "left", dataKey: "abandoned", fill: "#90a4c0", radius: [2, 2, 0, 0], maxBarSize: 14 }),
489
+ /* @__PURE__ */ jsx(Line, { yAxisId: "right", type: "monotone", dataKey: "agents", stroke: "#4a5568", strokeWidth: 1.5, dot: { r: 2, fill: "#4a5568" } })
490
+ ] }) }) })
491
+ ] }),
492
+ /* @__PURE__ */ jsxs(Paper, { sx: cardPaper, children: [
493
+ /* @__PURE__ */ jsxs(Box, { sx: cardHeader, children: [
494
+ /* @__PURE__ */ jsx(Typography, { sx: labelSx, children: "Repeated Calls" }),
495
+ /* @__PURE__ */ jsx(Chip, { label: data.repeated_calls.length, size: "small", sx: { background: C.rlt, color: C.red, fontWeight: 700, fontSize: 11 } })
496
+ ] }),
497
+ /* @__PURE__ */ jsx(Box, { sx: { px: 1.5, py: 1 }, children: /* @__PURE__ */ jsx(
498
+ TextField,
499
+ {
500
+ size: "small",
501
+ placeholder: "Search\u2026",
502
+ value: repeatedSearch,
503
+ onChange: (e) => setRepeatedSearch(e.target.value),
504
+ fullWidth: true,
505
+ slotProps: { input: { startAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "start", children: /* @__PURE__ */ jsx(SearchIcon, { sx: { fontSize: 16, color: C.t3 } }) }) } },
506
+ sx: { "& .MuiInputBase-root": { fontSize: 12 } }
507
+ }
508
+ ) }),
509
+ /* @__PURE__ */ jsx(TableContainer, { sx: { maxHeight: 260, overflow: "auto" }, children: /* @__PURE__ */ jsxs(Table, { size: "small", stickyHeader: true, children: [
510
+ /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
511
+ /* @__PURE__ */ jsx(TableCell, { sx: headSx, children: "Phone Number" }),
512
+ /* @__PURE__ */ jsx(TableCell, { sx: headSx, children: "Date" }),
513
+ /* @__PURE__ */ jsx(TableCell, { sx: headSx, children: "No of Calls" }),
514
+ /* @__PURE__ */ jsx(TableCell, { sx: headSx, children: "Latest Status" }),
515
+ /* @__PURE__ */ jsx(TableCell, { sx: headSx, children: "Latest Call Type" }),
516
+ /* @__PURE__ */ jsx(TableCell, { sx: headSx, children: "Comments" })
517
+ ] }) }),
518
+ /* @__PURE__ */ jsxs(TableBody, { children: [
519
+ filteredRepeated.length === 0 && /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: 6, sx: { textAlign: "center", py: 2, color: C.t3, fontSize: 12 }, children: "No repeated calls" }) }),
520
+ filteredRepeated.map((r) => /* @__PURE__ */ jsxs(TableRow, { hover: true, children: [
521
+ /* @__PURE__ */ jsx(TableCell, { sx: __spreadProps(__spreadValues(__spreadValues({}, cellSx), monoSx), { fontSize: 11 }), children: r.phone_number }),
522
+ /* @__PURE__ */ jsx(TableCell, { sx: __spreadProps(__spreadValues({}, cellSx), { fontSize: 11 }), children: r.date }),
523
+ /* @__PURE__ */ jsx(TableCell, { sx: __spreadProps(__spreadValues({}, cellSx), { fontWeight: 700, color: C.navy, fontSize: 13 }), children: r.call_count }),
524
+ /* @__PURE__ */ jsx(TableCell, { sx: __spreadProps(__spreadValues({}, cellSx), { fontSize: 11, fontWeight: 600, color: statusColor(r.latest_status) }), children: r.latest_status }),
525
+ /* @__PURE__ */ jsx(TableCell, { sx: __spreadProps(__spreadValues({}, cellSx), { fontSize: 11 }), children: r.latest_call_type }),
526
+ /* @__PURE__ */ jsx(TableCell, { sx: __spreadProps(__spreadValues({}, cellSx), { fontSize: 11, color: C.t3 }), children: r.comments })
527
+ ] }, `${r.phone_number}-${r.date}`))
528
+ ] })
529
+ ] }) })
530
+ ] })
531
+ ] })
532
+ ] })
533
+ ] }) });
534
+ }
535
+ var ManagementDashboard = () => /* @__PURE__ */ jsx(SDKProvider, { children: /* @__PURE__ */ jsx(ManagementDashboardContent, {}) });
536
+ var managementDashboard_default = ManagementDashboard;
537
+ export {
538
+ managementDashboard_default as default
539
+ };
540
+ //# sourceMappingURL=managementDashboard-GC5E7NEL.mjs.map