@burdenoff/microfe-support 2026.624.2 → 2026.625.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/support/components/PageLayout.js +64 -51
- package/dist/support/components/PageLayout.js.map +1 -1
- package/dist/support/components/analytics/CategoryBreakdown.js +27 -25
- package/dist/support/components/analytics/CategoryBreakdown.js.map +1 -1
- package/dist/support/components/analytics/MetricCard.js +20 -15
- package/dist/support/components/analytics/MetricCard.js.map +1 -1
- package/dist/support/components/analytics/PriorityBreakdown.js +28 -26
- package/dist/support/components/analytics/PriorityBreakdown.js.map +1 -1
- package/dist/support/components/analytics/SLAReport.js +44 -42
- package/dist/support/components/analytics/SLAReport.js.map +1 -1
- package/dist/support/components/analytics/SatisfactionDistribution.js +56 -54
- package/dist/support/components/analytics/SatisfactionDistribution.js.map +1 -1
- package/dist/support/components/analytics/TopAgents.js +31 -29
- package/dist/support/components/analytics/TopAgents.js.map +1 -1
- package/dist/support/components/analytics/TrendChart.js +24 -22
- package/dist/support/components/analytics/TrendChart.js.map +1 -1
- package/dist/support/components/kb/ArticleForm.js +1 -1
- package/dist/support/components/kb/ArticleForm.js.map +1 -1
- package/dist/support/components/settings/CannedResponsesSettings.js +1 -1
- package/dist/support/components/settings/CannedResponsesSettings.js.map +1 -1
- package/dist/support/components/settings/SLAPoliciesSettings.js +1 -1
- package/dist/support/components/settings/SLAPoliciesSettings.js.map +1 -1
- package/dist/support/components/settings/TicketCategoriesSettings.js +1 -1
- package/dist/support/components/settings/TicketCategoriesSettings.js.map +1 -1
- package/dist/support/components/ui.js +2 -2
- package/dist/support/pages/AnalyticsPage.js +129 -126
- package/dist/support/pages/AnalyticsPage.js.map +1 -1
- package/dist/support/pages/ArticleDetailAdminPage.js +105 -114
- package/dist/support/pages/ArticleDetailAdminPage.js.map +1 -1
- package/dist/support/pages/ArticleDetailUserPage.js +59 -59
- package/dist/support/pages/ArticleDetailUserPage.js.map +1 -1
- package/dist/support/pages/ContactInquiriesPage.js +49 -63
- package/dist/support/pages/ContactInquiriesPage.js.map +1 -1
- package/dist/support/pages/ContactInquiryDetailPage.js +6 -6
- package/dist/support/pages/ContactInquiryDetailPage.js.map +1 -1
- package/dist/support/pages/CreateTicketPage.js +1 -1
- package/dist/support/pages/CreateTicketPage.js.map +1 -1
- package/dist/support/pages/JobApplicationDetailPage.js +7 -7
- package/dist/support/pages/JobApplicationDetailPage.js.map +1 -1
- package/dist/support/pages/JobApplicationsPage.js +51 -65
- package/dist/support/pages/JobApplicationsPage.js.map +1 -1
- package/dist/support/pages/KnowledgeBaseAdminPage.js +4 -4
- package/dist/support/pages/KnowledgeBaseAdminPage.js.map +1 -1
- package/dist/support/pages/KnowledgeBaseUserPage.js +80 -78
- package/dist/support/pages/KnowledgeBaseUserPage.js.map +1 -1
- package/dist/support/pages/TicketDetailAdminPage.js +78 -78
- package/dist/support/pages/TicketDetailAdminPage.js.map +1 -1
- package/dist/support/pages/TicketDetailUserPage.js +54 -54
- package/dist/support/pages/TicketDetailUserPage.js.map +1 -1
- package/dist/support/pages/TicketListPage.js +173 -170
- package/dist/support/pages/TicketListPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,101 +1,103 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { GlassCard as e } from "../ui.js";
|
|
2
|
+
import { AlertTriangle as t, Shield as n } from "lucide-react";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
3
4
|
//#region src/support/components/analytics/SLAReport.tsx
|
|
4
|
-
function
|
|
5
|
-
return /* @__PURE__ */
|
|
6
|
-
|
|
5
|
+
function a({ report: a }) {
|
|
6
|
+
return /* @__PURE__ */ i(e, {
|
|
7
|
+
treatment: "insight",
|
|
8
|
+
className: "p-6 border-border-seam animate-in fade-in-0 slide-in-from-bottom-2",
|
|
7
9
|
children: [
|
|
8
|
-
/* @__PURE__ */
|
|
10
|
+
/* @__PURE__ */ i("h2", {
|
|
9
11
|
className: "text-xl font-semibold mb-4 flex items-center gap-2 text-primary",
|
|
10
|
-
children: [/* @__PURE__ */ n
|
|
12
|
+
children: [/* @__PURE__ */ r(n, { size: 20 }), "SLA Compliance Report"]
|
|
11
13
|
}),
|
|
12
|
-
/* @__PURE__ */
|
|
14
|
+
/* @__PURE__ */ i("div", {
|
|
13
15
|
className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6",
|
|
14
16
|
children: [
|
|
15
|
-
/* @__PURE__ */
|
|
17
|
+
/* @__PURE__ */ i("div", {
|
|
16
18
|
className: "p-4 rounded-lg bg-bg-sunken transition-colors duration-200",
|
|
17
19
|
children: [
|
|
18
|
-
/* @__PURE__ */
|
|
20
|
+
/* @__PURE__ */ r("p", {
|
|
19
21
|
className: "text-xs font-medium mb-1 text-tertiary",
|
|
20
22
|
children: "First Response"
|
|
21
23
|
}),
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
className: `text-2xl font-bold tabular-nums ${
|
|
24
|
-
children: [
|
|
24
|
+
/* @__PURE__ */ i("p", {
|
|
25
|
+
className: `text-2xl font-bold tabular-nums ${a.firstResponseCompliance >= 90 ? "text-success" : "text-warning"}`,
|
|
26
|
+
children: [a.firstResponseCompliance.toFixed(1), "%"]
|
|
25
27
|
}),
|
|
26
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ i("p", {
|
|
27
29
|
className: "text-xs mt-1 text-tertiary",
|
|
28
30
|
children: [
|
|
29
31
|
"Avg: ",
|
|
30
|
-
(
|
|
32
|
+
(a.avgFirstResponseTime / 60).toFixed(1),
|
|
31
33
|
"h"
|
|
32
34
|
]
|
|
33
35
|
})
|
|
34
36
|
]
|
|
35
37
|
}),
|
|
36
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ i("div", {
|
|
37
39
|
className: "p-4 rounded-lg bg-bg-sunken transition-colors duration-200",
|
|
38
40
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ r("p", {
|
|
40
42
|
className: "text-xs font-medium mb-1 text-tertiary",
|
|
41
43
|
children: "Resolution"
|
|
42
44
|
}),
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
className: `text-2xl font-bold tabular-nums ${
|
|
45
|
-
children: [
|
|
45
|
+
/* @__PURE__ */ i("p", {
|
|
46
|
+
className: `text-2xl font-bold tabular-nums ${a.resolutionCompliance >= 90 ? "text-success" : "text-warning"}`,
|
|
47
|
+
children: [a.resolutionCompliance.toFixed(1), "%"]
|
|
46
48
|
}),
|
|
47
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ i("p", {
|
|
48
50
|
className: "text-xs mt-1 text-tertiary",
|
|
49
51
|
children: [
|
|
50
52
|
"Avg: ",
|
|
51
|
-
(
|
|
53
|
+
(a.avgResolutionTime / 60).toFixed(1),
|
|
52
54
|
"h"
|
|
53
55
|
]
|
|
54
56
|
})
|
|
55
57
|
]
|
|
56
58
|
}),
|
|
57
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ i("div", {
|
|
58
60
|
className: "p-4 rounded-lg bg-bg-sunken transition-colors duration-200",
|
|
59
|
-
children: [/* @__PURE__ */
|
|
61
|
+
children: [/* @__PURE__ */ r("p", {
|
|
60
62
|
className: "text-xs font-medium mb-1 text-tertiary",
|
|
61
63
|
children: "Total Tickets"
|
|
62
|
-
}), /* @__PURE__ */
|
|
64
|
+
}), /* @__PURE__ */ r("p", {
|
|
63
65
|
className: "text-2xl font-bold text-primary",
|
|
64
|
-
children:
|
|
66
|
+
children: a.totalTickets
|
|
65
67
|
})]
|
|
66
68
|
}),
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
className: `p-4 rounded-lg flex items-center gap-2 transition-colors duration-200 ${
|
|
69
|
-
children: [/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ i("div", {
|
|
70
|
+
className: `p-4 rounded-lg flex items-center gap-2 transition-colors duration-200 ${a.breachedTickets > 0 ? "bg-error/10" : "bg-bg-sunken"}`,
|
|
71
|
+
children: [/* @__PURE__ */ r(t, {
|
|
70
72
|
size: 20,
|
|
71
|
-
className:
|
|
72
|
-
}), /* @__PURE__ */
|
|
73
|
+
className: a.breachedTickets > 0 ? "text-error" : "text-tertiary"
|
|
74
|
+
}), /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("p", {
|
|
73
75
|
className: "text-xs font-medium text-tertiary",
|
|
74
76
|
children: "Breached"
|
|
75
|
-
}), /* @__PURE__ */
|
|
76
|
-
className: `text-2xl font-bold ${
|
|
77
|
-
children:
|
|
77
|
+
}), /* @__PURE__ */ r("p", {
|
|
78
|
+
className: `text-2xl font-bold ${a.breachedTickets > 0 ? "text-error" : "text-primary"}`,
|
|
79
|
+
children: a.breachedTickets
|
|
78
80
|
})] })]
|
|
79
81
|
})
|
|
80
82
|
]
|
|
81
83
|
}),
|
|
82
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("h3", {
|
|
83
85
|
className: "text-sm font-semibold mb-3 text-secondary",
|
|
84
86
|
children: "Compliance by Priority"
|
|
85
|
-
}), /* @__PURE__ */
|
|
87
|
+
}), /* @__PURE__ */ r("div", {
|
|
86
88
|
className: "space-y-2",
|
|
87
|
-
children:
|
|
89
|
+
children: a.byPriority.map((e) => /* @__PURE__ */ i("div", {
|
|
88
90
|
className: "flex items-center justify-between py-2 px-3 rounded bg-bg-sunken transition-colors duration-200 hover:bg-bg-sunken/80",
|
|
89
|
-
children: [/* @__PURE__ */
|
|
91
|
+
children: [/* @__PURE__ */ i("div", {
|
|
90
92
|
className: "flex items-center gap-3",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
93
|
+
children: [/* @__PURE__ */ r("span", {
|
|
92
94
|
className: "text-sm font-medium text-primary",
|
|
93
95
|
children: e.priority
|
|
94
|
-
}), /* @__PURE__ */
|
|
96
|
+
}), /* @__PURE__ */ i("span", {
|
|
95
97
|
className: "text-xs text-tertiary",
|
|
96
98
|
children: [e.tickets, " tickets"]
|
|
97
99
|
})]
|
|
98
|
-
}), /* @__PURE__ */
|
|
100
|
+
}), /* @__PURE__ */ i("span", {
|
|
99
101
|
className: `text-sm font-semibold ${e.compliance >= 90 ? "text-success" : e.compliance >= 70 ? "text-warning" : "text-error"}`,
|
|
100
102
|
children: [e.compliance.toFixed(1), "%"]
|
|
101
103
|
})]
|
|
@@ -105,6 +107,6 @@ function i({ report: i }) {
|
|
|
105
107
|
});
|
|
106
108
|
}
|
|
107
109
|
//#endregion
|
|
108
|
-
export {
|
|
110
|
+
export { a as SLAReport };
|
|
109
111
|
|
|
110
112
|
//# sourceMappingURL=SLAReport.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SLAReport.js","names":[],"sources":["../../../../src/support/components/analytics/SLAReport.tsx"],"sourcesContent":["import { Shield, AlertTriangle } from 'lucide-react';\n\ninterface SLAComplianceByPriority {\n priority: string;\n tickets: number;\n compliance: number;\n}\n\ninterface SLAReportProps {\n report: {\n period: {\n startDate: string;\n endDate: string;\n label: string;\n };\n totalTickets: number;\n firstResponseCompliance: number;\n resolutionCompliance: number;\n avgFirstResponseTime: number;\n avgResolutionTime: number;\n breachedTickets: number;\n byPriority: SLAComplianceByPriority[];\n };\n}\n\nexport function SLAReport({ report }: SLAReportProps) {\n return (\n <
|
|
1
|
+
{"version":3,"file":"SLAReport.js","names":[],"sources":["../../../../src/support/components/analytics/SLAReport.tsx"],"sourcesContent":["import { Shield, AlertTriangle } from 'lucide-react';\nimport { GlassCard } from '../ui';\n\ninterface SLAComplianceByPriority {\n priority: string;\n tickets: number;\n compliance: number;\n}\n\ninterface SLAReportProps {\n report: {\n period: {\n startDate: string;\n endDate: string;\n label: string;\n };\n totalTickets: number;\n firstResponseCompliance: number;\n resolutionCompliance: number;\n avgFirstResponseTime: number;\n avgResolutionTime: number;\n breachedTickets: number;\n byPriority: SLAComplianceByPriority[];\n };\n}\n\nexport function SLAReport({ report }: SLAReportProps) {\n return (\n <GlassCard\n treatment=\"insight\"\n className=\"p-6 border-border-seam animate-in fade-in-0 slide-in-from-bottom-2\"\n >\n <h2 className=\"text-xl font-semibold mb-4 flex items-center gap-2 text-primary\">\n <Shield size={20} />\n SLA Compliance Report\n </h2>\n\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6\">\n <div className=\"p-4 rounded-lg bg-bg-sunken transition-colors duration-200\">\n <p className=\"text-xs font-medium mb-1 text-tertiary\">First Response</p>\n <p\n className={`text-2xl font-bold tabular-nums ${\n report.firstResponseCompliance >= 90 ? 'text-success' : 'text-warning'\n }`}\n >\n {report.firstResponseCompliance.toFixed(1)}%\n </p>\n <p className=\"text-xs mt-1 text-tertiary\">\n Avg: {(report.avgFirstResponseTime / 60).toFixed(1)}h\n </p>\n </div>\n\n <div className=\"p-4 rounded-lg bg-bg-sunken transition-colors duration-200\">\n <p className=\"text-xs font-medium mb-1 text-tertiary\">Resolution</p>\n <p\n className={`text-2xl font-bold tabular-nums ${\n report.resolutionCompliance >= 90 ? 'text-success' : 'text-warning'\n }`}\n >\n {report.resolutionCompliance.toFixed(1)}%\n </p>\n <p className=\"text-xs mt-1 text-tertiary\">\n Avg: {(report.avgResolutionTime / 60).toFixed(1)}h\n </p>\n </div>\n\n <div className=\"p-4 rounded-lg bg-bg-sunken transition-colors duration-200\">\n <p className=\"text-xs font-medium mb-1 text-tertiary\">Total Tickets</p>\n <p className=\"text-2xl font-bold text-primary\">{report.totalTickets}</p>\n </div>\n\n <div\n className={`p-4 rounded-lg flex items-center gap-2 transition-colors duration-200 ${\n report.breachedTickets > 0 ? 'bg-error/10' : 'bg-bg-sunken'\n }`}\n >\n <AlertTriangle\n size={20}\n className={report.breachedTickets > 0 ? 'text-error' : 'text-tertiary'}\n />\n <div>\n <p className=\"text-xs font-medium text-tertiary\">Breached</p>\n <p\n className={`text-2xl font-bold ${\n report.breachedTickets > 0 ? 'text-error' : 'text-primary'\n }`}\n >\n {report.breachedTickets}\n </p>\n </div>\n </div>\n </div>\n\n <div>\n <h3 className=\"text-sm font-semibold mb-3 text-secondary\">Compliance by Priority</h3>\n <div className=\"space-y-2\">\n {report.byPriority.map((item) => (\n <div\n key={item.priority}\n className=\"flex items-center justify-between py-2 px-3 rounded bg-bg-sunken transition-colors duration-200 hover:bg-bg-sunken/80\"\n >\n <div className=\"flex items-center gap-3\">\n <span className=\"text-sm font-medium text-primary\">{item.priority}</span>\n <span className=\"text-xs text-tertiary\">{item.tickets} tickets</span>\n </div>\n <span\n className={`text-sm font-semibold ${\n item.compliance >= 90\n ? 'text-success'\n : item.compliance >= 70\n ? 'text-warning'\n : 'text-error'\n }`}\n >\n {item.compliance.toFixed(1)}%\n </span>\n </div>\n ))}\n </div>\n </div>\n </GlassCard>\n );\n}\n"],"mappings":";;;;AA0BA,SAAgB,EAAU,EAAE,aAA0B;AACpD,QACE,kBAAC,GAAD;EACE,WAAU;EACV,WAAU;YAFZ;GAIE,kBAAC,MAAD;IAAI,WAAU;cAAd,CACE,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA,EAAA,wBAEjB;;GAEL,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,OAAD;MAAK,WAAU;gBAAf;OACE,kBAAC,KAAD;QAAG,WAAU;kBAAyC;QAAkB,CAAA;OACxE,kBAAC,KAAD;QACE,WAAW,mCACT,EAAO,2BAA2B,KAAK,iBAAiB;kBAF5D,CAKG,EAAO,wBAAwB,QAAQ,EAAE,EAAC,IACzC;;OACJ,kBAAC,KAAD;QAAG,WAAU;kBAAb;SAA0C;UACjC,EAAO,uBAAuB,IAAI,QAAQ,EAAE;SAAC;SAClD;;OACA;;KAEN,kBAAC,OAAD;MAAK,WAAU;gBAAf;OACE,kBAAC,KAAD;QAAG,WAAU;kBAAyC;QAAc,CAAA;OACpE,kBAAC,KAAD;QACE,WAAW,mCACT,EAAO,wBAAwB,KAAK,iBAAiB;kBAFzD,CAKG,EAAO,qBAAqB,QAAQ,EAAE,EAAC,IACtC;;OACJ,kBAAC,KAAD;QAAG,WAAU;kBAAb;SAA0C;UACjC,EAAO,oBAAoB,IAAI,QAAQ,EAAE;SAAC;SAC/C;;OACA;;KAEN,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,KAAD;OAAG,WAAU;iBAAyC;OAAiB,CAAA,EACvE,kBAAC,KAAD;OAAG,WAAU;iBAAmC,EAAO;OAAiB,CAAA,CACpE;;KAEN,kBAAC,OAAD;MACE,WAAW,yEACT,EAAO,kBAAkB,IAAI,gBAAgB;gBAFjD,CAKE,kBAAC,GAAD;OACE,MAAM;OACN,WAAW,EAAO,kBAAkB,IAAI,eAAe;OACvD,CAAA,EACF,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,KAAD;OAAG,WAAU;iBAAoC;OAAY,CAAA,EAC7D,kBAAC,KAAD;OACE,WAAW,sBACT,EAAO,kBAAkB,IAAI,eAAe;iBAG7C,EAAO;OACN,CAAA,CACA,EAAA,CAAA,CACF;;KACF;;GAEN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;IAAI,WAAU;cAA4C;IAA2B,CAAA,EACrF,kBAAC,OAAD;IAAK,WAAU;cACZ,EAAO,WAAW,KAAK,MACtB,kBAAC,OAAD;KAEE,WAAU;eAFZ,CAIE,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,QAAD;OAAM,WAAU;iBAAoC,EAAK;OAAgB,CAAA,EACzE,kBAAC,QAAD;OAAM,WAAU;iBAAhB,CAAyC,EAAK,SAAQ,WAAe;SACjE;SACN,kBAAC,QAAD;MACE,WAAW,yBACT,EAAK,cAAc,KACf,iBACA,EAAK,cAAc,KACjB,iBACA;gBANV,CASG,EAAK,WAAW,QAAQ,EAAE,EAAC,IACvB;QACH;OAlBC,EAAK,SAkBN,CACN;IACE,CAAA,CACF,EAAA,CAAA;GACI"}
|
|
@@ -1,51 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { GlassCard as e } from "../ui.js";
|
|
2
|
+
import { Star as t, ThumbsUp as n } from "lucide-react";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
3
4
|
//#region src/support/components/analytics/SatisfactionDistribution.tsx
|
|
4
|
-
function
|
|
5
|
-
let
|
|
5
|
+
function a({ metrics: a }) {
|
|
6
|
+
let o = [
|
|
6
7
|
{
|
|
7
8
|
stars: 5,
|
|
8
|
-
count:
|
|
9
|
+
count: a.ratings.rating5
|
|
9
10
|
},
|
|
10
11
|
{
|
|
11
12
|
stars: 4,
|
|
12
|
-
count:
|
|
13
|
+
count: a.ratings.rating4
|
|
13
14
|
},
|
|
14
15
|
{
|
|
15
16
|
stars: 3,
|
|
16
|
-
count:
|
|
17
|
+
count: a.ratings.rating3
|
|
17
18
|
},
|
|
18
19
|
{
|
|
19
20
|
stars: 2,
|
|
20
|
-
count:
|
|
21
|
+
count: a.ratings.rating2
|
|
21
22
|
},
|
|
22
23
|
{
|
|
23
24
|
stars: 1,
|
|
24
|
-
count:
|
|
25
|
+
count: a.ratings.rating1
|
|
25
26
|
}
|
|
26
|
-
],
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
|
|
27
|
+
], s = Math.max(...o.map((e) => e.count));
|
|
28
|
+
return /* @__PURE__ */ i(e, {
|
|
29
|
+
treatment: "insight",
|
|
30
|
+
className: "p-6 border-border-seam animate-in fade-in-0 slide-in-from-bottom-2",
|
|
29
31
|
children: [
|
|
30
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ i("h2", {
|
|
31
33
|
className: "text-xl font-semibold mb-4 flex items-center gap-2 text-primary",
|
|
32
|
-
children: [/* @__PURE__ */ n
|
|
34
|
+
children: [/* @__PURE__ */ r(n, { size: 20 }), "Customer Satisfaction"]
|
|
33
35
|
}),
|
|
34
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ i("div", {
|
|
35
37
|
className: "grid grid-cols-3 gap-4 mb-6",
|
|
36
38
|
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ i("div", {
|
|
38
40
|
className: "text-center p-3 rounded-lg bg-bg-sunken transition-colors duration-200",
|
|
39
41
|
children: [
|
|
40
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ r("p", {
|
|
41
43
|
className: "text-xs font-medium mb-1 text-tertiary",
|
|
42
44
|
children: "Avg Rating"
|
|
43
45
|
}),
|
|
44
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ r("p", {
|
|
45
47
|
className: "text-2xl font-bold text-primary tabular-nums",
|
|
46
|
-
children:
|
|
48
|
+
children: a.averageRating.toFixed(1)
|
|
47
49
|
}),
|
|
48
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ r("div", {
|
|
49
51
|
className: "flex items-center justify-center gap-1 mt-1",
|
|
50
52
|
children: [...[
|
|
51
53
|
,
|
|
@@ -53,42 +55,42 @@ function i({ metrics: i }) {
|
|
|
53
55
|
,
|
|
54
56
|
,
|
|
55
57
|
,
|
|
56
|
-
]].map((
|
|
58
|
+
]].map((e, n) => /* @__PURE__ */ r(t, {
|
|
57
59
|
size: 12,
|
|
58
|
-
className:
|
|
59
|
-
},
|
|
60
|
+
className: n < Math.round(a.averageRating) ? "text-warning fill-warning" : "text-tertiary"
|
|
61
|
+
}, n))
|
|
60
62
|
})
|
|
61
63
|
]
|
|
62
64
|
}),
|
|
63
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ i("div", {
|
|
64
66
|
className: "text-center p-3 rounded-lg bg-bg-sunken transition-colors duration-200",
|
|
65
67
|
children: [
|
|
66
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ r("p", {
|
|
67
69
|
className: "text-xs font-medium mb-1 text-tertiary",
|
|
68
70
|
children: "CSAT"
|
|
69
71
|
}),
|
|
70
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ i("p", {
|
|
71
73
|
className: "text-2xl font-bold text-success tabular-nums",
|
|
72
|
-
children: [
|
|
74
|
+
children: [a.csat.toFixed(0), "%"]
|
|
73
75
|
}),
|
|
74
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ r("p", {
|
|
75
77
|
className: "text-xs mt-1 text-tertiary",
|
|
76
78
|
children: "Satisfaction"
|
|
77
79
|
})
|
|
78
80
|
]
|
|
79
81
|
}),
|
|
80
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ i("div", {
|
|
81
83
|
className: "text-center p-3 rounded-lg bg-bg-sunken transition-colors duration-200",
|
|
82
84
|
children: [
|
|
83
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ r("p", {
|
|
84
86
|
className: "text-xs font-medium mb-1 text-tertiary",
|
|
85
87
|
children: "NPS"
|
|
86
88
|
}),
|
|
87
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ r("p", {
|
|
88
90
|
className: "text-2xl font-bold text-accent tabular-nums",
|
|
89
|
-
children:
|
|
91
|
+
children: a.nps.toFixed(0)
|
|
90
92
|
}),
|
|
91
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ r("p", {
|
|
92
94
|
className: "text-xs mt-1 text-tertiary",
|
|
93
95
|
children: "Promoter Score"
|
|
94
96
|
})
|
|
@@ -96,55 +98,55 @@ function i({ metrics: i }) {
|
|
|
96
98
|
})
|
|
97
99
|
]
|
|
98
100
|
}),
|
|
99
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ i("div", { children: [/* @__PURE__ */ i("h3", {
|
|
100
102
|
className: "text-sm font-semibold mb-3 text-secondary",
|
|
101
103
|
children: [
|
|
102
104
|
"Rating Distribution (",
|
|
103
|
-
|
|
105
|
+
a.totalResponses,
|
|
104
106
|
" responses)"
|
|
105
107
|
]
|
|
106
|
-
}), /* @__PURE__ */
|
|
108
|
+
}), /* @__PURE__ */ r("div", {
|
|
107
109
|
className: "space-y-2",
|
|
108
|
-
children:
|
|
109
|
-
let
|
|
110
|
-
return /* @__PURE__ */
|
|
110
|
+
children: o.map((e) => {
|
|
111
|
+
let n = a.totalResponses > 0 ? e.count / a.totalResponses * 100 : 0, o = s > 0 ? e.count / s * 100 : 0;
|
|
112
|
+
return /* @__PURE__ */ i("div", {
|
|
111
113
|
className: "flex items-center gap-3",
|
|
112
|
-
children: [/* @__PURE__ */
|
|
114
|
+
children: [/* @__PURE__ */ i("div", {
|
|
113
115
|
className: "flex items-center gap-1 w-16",
|
|
114
|
-
children: [/* @__PURE__ */
|
|
116
|
+
children: [/* @__PURE__ */ r("span", {
|
|
115
117
|
className: "text-sm font-medium text-primary",
|
|
116
|
-
children:
|
|
117
|
-
}), /* @__PURE__ */
|
|
118
|
+
children: e.stars
|
|
119
|
+
}), /* @__PURE__ */ r(t, {
|
|
118
120
|
size: 14,
|
|
119
121
|
className: "text-warning fill-warning"
|
|
120
122
|
})]
|
|
121
|
-
}), /* @__PURE__ */
|
|
123
|
+
}), /* @__PURE__ */ i("div", {
|
|
122
124
|
className: "flex-1 flex items-center gap-2",
|
|
123
|
-
children: [/* @__PURE__ */
|
|
125
|
+
children: [/* @__PURE__ */ r("div", {
|
|
124
126
|
className: "flex-1 h-6 rounded bg-bg-sunken",
|
|
125
|
-
children: /* @__PURE__ */
|
|
127
|
+
children: /* @__PURE__ */ r("div", {
|
|
126
128
|
className: "h-full rounded transition-all duration-300 flex items-center justify-end pr-2 bg-action-primary-bg",
|
|
127
129
|
style: {
|
|
128
|
-
width: `${
|
|
129
|
-
minWidth:
|
|
130
|
+
width: `${o}%`,
|
|
131
|
+
minWidth: e.count > 0 ? "30px" : "0"
|
|
130
132
|
},
|
|
131
|
-
children:
|
|
133
|
+
children: e.count > 0 && /* @__PURE__ */ r("span", {
|
|
132
134
|
className: "text-xs font-medium text-action-primary-text",
|
|
133
|
-
children:
|
|
135
|
+
children: e.count
|
|
134
136
|
})
|
|
135
137
|
})
|
|
136
|
-
}), /* @__PURE__ */
|
|
138
|
+
}), /* @__PURE__ */ i("span", {
|
|
137
139
|
className: "text-xs w-12 text-right text-tertiary",
|
|
138
|
-
children: [
|
|
140
|
+
children: [n.toFixed(0), "%"]
|
|
139
141
|
})]
|
|
140
142
|
})]
|
|
141
|
-
},
|
|
143
|
+
}, e.stars);
|
|
142
144
|
})
|
|
143
145
|
})] })
|
|
144
146
|
]
|
|
145
147
|
});
|
|
146
148
|
}
|
|
147
149
|
//#endregion
|
|
148
|
-
export {
|
|
150
|
+
export { a as SatisfactionDistribution };
|
|
149
151
|
|
|
150
152
|
//# sourceMappingURL=SatisfactionDistribution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SatisfactionDistribution.js","names":[],"sources":["../../../../src/support/components/analytics/SatisfactionDistribution.tsx"],"sourcesContent":["import { ThumbsUp, Star } from 'lucide-react';\n\ninterface SatisfactionMetrics {\n period: {\n startDate: string;\n endDate: string;\n label: string;\n };\n totalResponses: number;\n averageRating: number;\n csat: number;\n nps: number;\n ratings: {\n rating1: number;\n rating2: number;\n rating3: number;\n rating4: number;\n rating5: number;\n };\n}\n\ninterface SatisfactionDistributionProps {\n metrics: SatisfactionMetrics;\n}\n\nexport function SatisfactionDistribution({ metrics }: SatisfactionDistributionProps) {\n const ratingsArray = [\n { stars: 5, count: metrics.ratings.rating5 },\n { stars: 4, count: metrics.ratings.rating4 },\n { stars: 3, count: metrics.ratings.rating3 },\n { stars: 2, count: metrics.ratings.rating2 },\n { stars: 1, count: metrics.ratings.rating1 },\n ];\n\n const maxCount = Math.max(...ratingsArray.map((r) => r.count));\n\n return (\n <
|
|
1
|
+
{"version":3,"file":"SatisfactionDistribution.js","names":[],"sources":["../../../../src/support/components/analytics/SatisfactionDistribution.tsx"],"sourcesContent":["import { ThumbsUp, Star } from 'lucide-react';\nimport { GlassCard } from '../ui';\n\ninterface SatisfactionMetrics {\n period: {\n startDate: string;\n endDate: string;\n label: string;\n };\n totalResponses: number;\n averageRating: number;\n csat: number;\n nps: number;\n ratings: {\n rating1: number;\n rating2: number;\n rating3: number;\n rating4: number;\n rating5: number;\n };\n}\n\ninterface SatisfactionDistributionProps {\n metrics: SatisfactionMetrics;\n}\n\nexport function SatisfactionDistribution({ metrics }: SatisfactionDistributionProps) {\n const ratingsArray = [\n { stars: 5, count: metrics.ratings.rating5 },\n { stars: 4, count: metrics.ratings.rating4 },\n { stars: 3, count: metrics.ratings.rating3 },\n { stars: 2, count: metrics.ratings.rating2 },\n { stars: 1, count: metrics.ratings.rating1 },\n ];\n\n const maxCount = Math.max(...ratingsArray.map((r) => r.count));\n\n return (\n <GlassCard\n treatment=\"insight\"\n className=\"p-6 border-border-seam animate-in fade-in-0 slide-in-from-bottom-2\"\n >\n <h2 className=\"text-xl font-semibold mb-4 flex items-center gap-2 text-primary\">\n <ThumbsUp size={20} />\n Customer Satisfaction\n </h2>\n\n <div className=\"grid grid-cols-3 gap-4 mb-6\">\n <div className=\"text-center p-3 rounded-lg bg-bg-sunken transition-colors duration-200\">\n <p className=\"text-xs font-medium mb-1 text-tertiary\">Avg Rating</p>\n <p className=\"text-2xl font-bold text-primary tabular-nums\">\n {metrics.averageRating.toFixed(1)}\n </p>\n <div className=\"flex items-center justify-center gap-1 mt-1\">\n {[...Array(5)].map((_, i) => (\n <Star\n key={i}\n size={12}\n className={\n i < Math.round(metrics.averageRating)\n ? 'text-warning fill-warning'\n : 'text-tertiary'\n }\n />\n ))}\n </div>\n </div>\n\n <div className=\"text-center p-3 rounded-lg bg-bg-sunken transition-colors duration-200\">\n <p className=\"text-xs font-medium mb-1 text-tertiary\">CSAT</p>\n <p className=\"text-2xl font-bold text-success tabular-nums\">{metrics.csat.toFixed(0)}%</p>\n <p className=\"text-xs mt-1 text-tertiary\">Satisfaction</p>\n </div>\n\n <div className=\"text-center p-3 rounded-lg bg-bg-sunken transition-colors duration-200\">\n <p className=\"text-xs font-medium mb-1 text-tertiary\">NPS</p>\n <p className=\"text-2xl font-bold text-accent tabular-nums\">{metrics.nps.toFixed(0)}</p>\n <p className=\"text-xs mt-1 text-tertiary\">Promoter Score</p>\n </div>\n </div>\n\n <div>\n <h3 className=\"text-sm font-semibold mb-3 text-secondary\">\n Rating Distribution ({metrics.totalResponses} responses)\n </h3>\n <div className=\"space-y-2\">\n {ratingsArray.map((item) => {\n const percentage =\n metrics.totalResponses > 0 ? (item.count / metrics.totalResponses) * 100 : 0;\n const widthPercent = maxCount > 0 ? (item.count / maxCount) * 100 : 0;\n\n return (\n <div key={item.stars} className=\"flex items-center gap-3\">\n <div className=\"flex items-center gap-1 w-16\">\n <span className=\"text-sm font-medium text-primary\">{item.stars}</span>\n <Star size={14} className=\"text-warning fill-warning\" />\n </div>\n <div className=\"flex-1 flex items-center gap-2\">\n <div className=\"flex-1 h-6 rounded bg-bg-sunken\">\n <div\n className=\"h-full rounded transition-all duration-300 flex items-center justify-end pr-2 bg-action-primary-bg\"\n style={{\n width: `${widthPercent}%`,\n minWidth: item.count > 0 ? '30px' : '0',\n }}\n >\n {item.count > 0 && (\n <span className=\"text-xs font-medium text-action-primary-text\">\n {item.count}\n </span>\n )}\n </div>\n </div>\n <span className=\"text-xs w-12 text-right text-tertiary\">\n {percentage.toFixed(0)}%\n </span>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n </GlassCard>\n );\n}\n"],"mappings":";;;;AA0BA,SAAgB,EAAyB,EAAE,cAA0C;CACnF,IAAM,IAAe;EACnB;GAAE,OAAO;GAAG,OAAO,EAAQ,QAAQ;GAAS;EAC5C;GAAE,OAAO;GAAG,OAAO,EAAQ,QAAQ;GAAS;EAC5C;GAAE,OAAO;GAAG,OAAO,EAAQ,QAAQ;GAAS;EAC5C;GAAE,OAAO;GAAG,OAAO,EAAQ,QAAQ;GAAS;EAC5C;GAAE,OAAO;GAAG,OAAO,EAAQ,QAAQ;GAAS;EAC7C,EAEK,IAAW,KAAK,IAAI,GAAG,EAAa,KAAK,MAAM,EAAE,MAAM,CAAC;AAE9D,QACE,kBAAC,GAAD;EACE,WAAU;EACV,WAAU;YAFZ;GAIE,kBAAC,MAAD;IAAI,WAAU;cAAd,CACE,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA,EAAA,wBAEnB;;GAEL,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,OAAD;MAAK,WAAU;gBAAf;OACE,kBAAC,KAAD;QAAG,WAAU;kBAAyC;QAAc,CAAA;OACpE,kBAAC,KAAD;QAAG,WAAU;kBACV,EAAQ,cAAc,QAAQ,EAAE;QAC/B,CAAA;OACJ,kBAAC,OAAD;QAAK,WAAU;kBACZ,CAAC,GAAG;;;;;;SAAQ,CAAC,CAAC,KAAK,GAAG,MACrB,kBAAC,GAAD;SAEE,MAAM;SACN,WACE,IAAI,KAAK,MAAM,EAAQ,cAAc,GACjC,8BACA;SAEN,EAPK,EAOL,CACF;QACE,CAAA;OACF;;KAEN,kBAAC,OAAD;MAAK,WAAU;gBAAf;OACE,kBAAC,KAAD;QAAG,WAAU;kBAAyC;QAAQ,CAAA;OAC9D,kBAAC,KAAD;QAAG,WAAU;kBAAb,CAA6D,EAAQ,KAAK,QAAQ,EAAE,EAAC,IAAK;;OAC1F,kBAAC,KAAD;QAAG,WAAU;kBAA6B;QAAgB,CAAA;OACtD;;KAEN,kBAAC,OAAD;MAAK,WAAU;gBAAf;OACE,kBAAC,KAAD;QAAG,WAAU;kBAAyC;QAAO,CAAA;OAC7D,kBAAC,KAAD;QAAG,WAAU;kBAA+C,EAAQ,IAAI,QAAQ,EAAE;QAAK,CAAA;OACvF,kBAAC,KAAD;QAAG,WAAU;kBAA6B;QAAkB,CAAA;OACxD;;KACF;;GAEN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;IAAI,WAAU;cAAd;KAA0D;KAClC,EAAQ;KAAe;KAC1C;OACL,kBAAC,OAAD;IAAK,WAAU;cACZ,EAAa,KAAK,MAAS;KAC1B,IAAM,IACJ,EAAQ,iBAAiB,IAAK,EAAK,QAAQ,EAAQ,iBAAkB,MAAM,GACvE,IAAe,IAAW,IAAK,EAAK,QAAQ,IAAY,MAAM;AAEpE,YACE,kBAAC,OAAD;MAAsB,WAAU;gBAAhC,CACE,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,QAAD;QAAM,WAAU;kBAAoC,EAAK;QAAa,CAAA,EACtE,kBAAC,GAAD;QAAM,MAAM;QAAI,WAAU;QAA8B,CAAA,CACpD;UACN,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,OAAD;QAAK,WAAU;kBACb,kBAAC,OAAD;SACE,WAAU;SACV,OAAO;UACL,OAAO,GAAG,EAAa;UACvB,UAAU,EAAK,QAAQ,IAAI,SAAS;UACrC;mBAEA,EAAK,QAAQ,KACZ,kBAAC,QAAD;UAAM,WAAU;oBACb,EAAK;UACD,CAAA;SAEL,CAAA;QACF,CAAA,EACN,kBAAC,QAAD;QAAM,WAAU;kBAAhB,CACG,EAAW,QAAQ,EAAE,EAAC,IAClB;UACH;SACF;QAzBI,EAAK,MAyBT;MAER;IACE,CAAA,CACF,EAAA,CAAA;GACI"}
|
|
@@ -1,55 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { GlassCard as e } from "../ui.js";
|
|
2
|
+
import { Award as t, Star as n } from "lucide-react";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
3
4
|
//#region src/support/components/analytics/TopAgents.tsx
|
|
4
|
-
function
|
|
5
|
-
let
|
|
5
|
+
function a({ agents: a }) {
|
|
6
|
+
let o = a.slice(0, 5), s = {
|
|
6
7
|
1: "bg-warning/10 text-warning",
|
|
7
8
|
2: "bg-bg-sunken text-text-secondary",
|
|
8
9
|
3: "bg-accent/10 text-accent"
|
|
9
10
|
};
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
return /* @__PURE__ */ i(e, {
|
|
12
|
+
treatment: "insight",
|
|
13
|
+
className: "p-6 border-border-seam animate-in fade-in-0 slide-in-from-bottom-2",
|
|
14
|
+
children: [/* @__PURE__ */ i("h2", {
|
|
13
15
|
className: "text-xl font-semibold mb-4 flex items-center gap-2 text-primary",
|
|
14
|
-
children: [/* @__PURE__ */
|
|
15
|
-
}), /* @__PURE__ */
|
|
16
|
+
children: [/* @__PURE__ */ r(t, { size: 20 }), "Top Performing Agents"]
|
|
17
|
+
}), /* @__PURE__ */ i("div", {
|
|
16
18
|
className: "space-y-4",
|
|
17
|
-
children: [
|
|
19
|
+
children: [o.map((e) => /* @__PURE__ */ i("div", {
|
|
18
20
|
className: "flex items-center gap-4 p-3 rounded-lg bg-bg-sunken transition-colors duration-200 hover:bg-bg-sunken/80",
|
|
19
|
-
children: [/* @__PURE__ */
|
|
20
|
-
className: `w-10 h-10 rounded-full flex items-center justify-center font-bold text-lg flex-shrink-0
|
|
21
|
-
children:
|
|
22
|
-
}), /* @__PURE__ */
|
|
21
|
+
children: [/* @__PURE__ */ r("div", {
|
|
22
|
+
className: `w-10 h-10 rounded-full flex items-center justify-center font-bold text-lg flex-shrink-0 ${s[e.rank] || "bg-bg-sunken text-text-secondary"}`,
|
|
23
|
+
children: e.rank <= 3 ? /* @__PURE__ */ r(t, { size: 18 }) : e.rank
|
|
24
|
+
}), /* @__PURE__ */ i("div", {
|
|
23
25
|
className: "flex-1 min-w-0",
|
|
24
|
-
children: [/* @__PURE__ */
|
|
26
|
+
children: [/* @__PURE__ */ i("div", {
|
|
25
27
|
className: "flex items-center justify-between mb-1",
|
|
26
|
-
children: [/* @__PURE__ */
|
|
28
|
+
children: [/* @__PURE__ */ r("p", {
|
|
27
29
|
className: "font-semibold truncate text-primary",
|
|
28
|
-
children:
|
|
29
|
-
}), /* @__PURE__ */
|
|
30
|
+
children: e.agent.user.name
|
|
31
|
+
}), /* @__PURE__ */ i("div", {
|
|
30
32
|
className: "flex items-center gap-1",
|
|
31
|
-
children: [/* @__PURE__ */ n
|
|
33
|
+
children: [/* @__PURE__ */ r(n, {
|
|
32
34
|
size: 14,
|
|
33
35
|
className: "text-warning fill-warning"
|
|
34
|
-
}), /* @__PURE__ */
|
|
36
|
+
}), /* @__PURE__ */ r("span", {
|
|
35
37
|
className: "text-sm font-medium text-primary",
|
|
36
|
-
children:
|
|
38
|
+
children: e.avgRating.toFixed(1)
|
|
37
39
|
})]
|
|
38
40
|
})]
|
|
39
|
-
}), /* @__PURE__ */
|
|
41
|
+
}), /* @__PURE__ */ i("div", {
|
|
40
42
|
className: "flex items-center justify-between",
|
|
41
|
-
children: [/* @__PURE__ */
|
|
43
|
+
children: [/* @__PURE__ */ r("p", {
|
|
42
44
|
className: "text-xs truncate text-tertiary",
|
|
43
|
-
children:
|
|
44
|
-
}), /* @__PURE__ */
|
|
45
|
+
children: e.agent.user.email
|
|
46
|
+
}), /* @__PURE__ */ i("p", {
|
|
45
47
|
className: "text-xs font-medium text-secondary",
|
|
46
|
-
children: [
|
|
48
|
+
children: [e.ticketsResolved, " resolved"]
|
|
47
49
|
})]
|
|
48
50
|
})]
|
|
49
51
|
})]
|
|
50
|
-
},
|
|
52
|
+
}, e.agent.id)), o.length === 0 && /* @__PURE__ */ r("div", {
|
|
51
53
|
className: "text-center py-8",
|
|
52
|
-
children: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ r("p", {
|
|
53
55
|
className: "text-tertiary",
|
|
54
56
|
children: "No agent data available"
|
|
55
57
|
})
|
|
@@ -58,6 +60,6 @@ function i({ agents: i }) {
|
|
|
58
60
|
});
|
|
59
61
|
}
|
|
60
62
|
//#endregion
|
|
61
|
-
export {
|
|
63
|
+
export { a as TopAgents };
|
|
62
64
|
|
|
63
65
|
//# sourceMappingURL=TopAgents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopAgents.js","names":[],"sources":["../../../../src/support/components/analytics/TopAgents.tsx"],"sourcesContent":["import { Award, Star } from 'lucide-react';\n\ninterface TopAgent {\n agent: {\n id: string;\n user: {\n id: string;\n name: string;\n email: string;\n avatarUrl?: string | null;\n };\n };\n ticketsResolved: number;\n avgRating: number;\n rank: number;\n}\n\ninterface TopAgentsProps {\n agents: TopAgent[];\n}\n\nexport function TopAgents({ agents }: TopAgentsProps) {\n const topAgents = agents.slice(0, 5);\n const rankClasses: Record<number, string> = {\n 1: 'bg-warning/10 text-warning',\n 2: 'bg-bg-sunken text-text-secondary',\n 3: 'bg-accent/10 text-accent',\n };\n\n return (\n <
|
|
1
|
+
{"version":3,"file":"TopAgents.js","names":[],"sources":["../../../../src/support/components/analytics/TopAgents.tsx"],"sourcesContent":["import { Award, Star } from 'lucide-react';\nimport { GlassCard } from '../ui';\n\ninterface TopAgent {\n agent: {\n id: string;\n user: {\n id: string;\n name: string;\n email: string;\n avatarUrl?: string | null;\n };\n };\n ticketsResolved: number;\n avgRating: number;\n rank: number;\n}\n\ninterface TopAgentsProps {\n agents: TopAgent[];\n}\n\nexport function TopAgents({ agents }: TopAgentsProps) {\n const topAgents = agents.slice(0, 5);\n const rankClasses: Record<number, string> = {\n 1: 'bg-warning/10 text-warning',\n 2: 'bg-bg-sunken text-text-secondary',\n 3: 'bg-accent/10 text-accent',\n };\n\n return (\n <GlassCard\n treatment=\"insight\"\n className=\"p-6 border-border-seam animate-in fade-in-0 slide-in-from-bottom-2\"\n >\n <h2 className=\"text-xl font-semibold mb-4 flex items-center gap-2 text-primary\">\n <Award size={20} />\n Top Performing Agents\n </h2>\n\n <div className=\"space-y-4\">\n {topAgents.map((agent) => {\n return (\n <div\n key={agent.agent.id}\n className=\"flex items-center gap-4 p-3 rounded-lg bg-bg-sunken transition-colors duration-200 hover:bg-bg-sunken/80\"\n >\n <div\n className={`w-10 h-10 rounded-full flex items-center justify-center font-bold text-lg flex-shrink-0 ${rankClasses[agent.rank] || 'bg-bg-sunken text-text-secondary'}`}\n >\n {agent.rank <= 3 ? <Award size={18} /> : agent.rank}\n </div>\n\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center justify-between mb-1\">\n <p className=\"font-semibold truncate text-primary\">{agent.agent.user.name}</p>\n <div className=\"flex items-center gap-1\">\n <Star size={14} className=\"text-warning fill-warning\" />\n <span className=\"text-sm font-medium text-primary\">\n {agent.avgRating.toFixed(1)}\n </span>\n </div>\n </div>\n <div className=\"flex items-center justify-between\">\n <p className=\"text-xs truncate text-tertiary\">{agent.agent.user.email}</p>\n <p className=\"text-xs font-medium text-secondary\">\n {agent.ticketsResolved} resolved\n </p>\n </div>\n </div>\n </div>\n );\n })}\n\n {topAgents.length === 0 && (\n <div className=\"text-center py-8\">\n <p className=\"text-tertiary\">No agent data available</p>\n </div>\n )}\n </div>\n </GlassCard>\n );\n}\n"],"mappings":";;;;AAsBA,SAAgB,EAAU,EAAE,aAA0B;CACpD,IAAM,IAAY,EAAO,MAAM,GAAG,EAAE,EAC9B,IAAsC;EAC1C,GAAG;EACH,GAAG;EACH,GAAG;EACJ;AAED,QACE,kBAAC,GAAD;EACE,WAAU;EACV,WAAU;YAFZ,CAIE,kBAAC,MAAD;GAAI,WAAU;aAAd,CACE,kBAAC,GAAD,EAAO,MAAM,IAAM,CAAA,EAAA,wBAEhB;MAEL,kBAAC,OAAD;GAAK,WAAU;aAAf,CACG,EAAU,KAAK,MAEZ,kBAAC,OAAD;IAEE,WAAU;cAFZ,CAIE,kBAAC,OAAD;KACE,WAAW,2FAA2F,EAAY,EAAM,SAAS;eAEhI,EAAM,QAAQ,IAAI,kBAAC,GAAD,EAAO,MAAM,IAAM,CAAA,GAAG,EAAM;KAC3C,CAAA,EAEN,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,KAAD;OAAG,WAAU;iBAAuC,EAAM,MAAM,KAAK;OAAS,CAAA,EAC9E,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,GAAD;QAAM,MAAM;QAAI,WAAU;QAA8B,CAAA,EACxD,kBAAC,QAAD;QAAM,WAAU;kBACb,EAAM,UAAU,QAAQ,EAAE;QACtB,CAAA,CACH;SACF;SACN,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,KAAD;OAAG,WAAU;iBAAkC,EAAM,MAAM,KAAK;OAAU,CAAA,EAC1E,kBAAC,KAAD;OAAG,WAAU;iBAAb,CACG,EAAM,iBAAgB,YACrB;SACA;QACF;OACF;MA1BC,EAAM,MAAM,GA0Bb,CAER,EAED,EAAU,WAAW,KACpB,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,KAAD;KAAG,WAAU;eAAgB;KAA2B,CAAA;IACpD,CAAA,CAEJ;KACI"}
|
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { GlassCard as e } from "../ui.js";
|
|
2
|
+
import { TrendingUp as t } from "lucide-react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
4
|
//#region src/support/components/analytics/TrendChart.tsx
|
|
4
|
-
function
|
|
5
|
-
if (!
|
|
6
|
-
let
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
function i({ trends: i, period: a }) {
|
|
6
|
+
if (!i || i.length === 0) return null;
|
|
7
|
+
let o = Math.max(...i.map((e) => e.value)), s = Math.min(...i.map((e) => e.value)), c = o - s || 1;
|
|
8
|
+
return /* @__PURE__ */ r(e, {
|
|
9
|
+
treatment: "insight",
|
|
10
|
+
className: "p-6 border-border-seam animate-in fade-in-0 slide-in-from-bottom-2",
|
|
11
|
+
children: [/* @__PURE__ */ n("div", {
|
|
10
12
|
className: "flex items-center justify-between mb-6",
|
|
11
|
-
children: /* @__PURE__ */
|
|
13
|
+
children: /* @__PURE__ */ r("div", { children: [/* @__PURE__ */ r("h2", {
|
|
12
14
|
className: "text-xl font-semibold flex items-center gap-2 text-primary",
|
|
13
|
-
children: [/* @__PURE__ */ t
|
|
14
|
-
}), /* @__PURE__ */
|
|
15
|
+
children: [/* @__PURE__ */ n(t, { size: 20 }), "Ticket Volume Trends"]
|
|
16
|
+
}), /* @__PURE__ */ n("p", {
|
|
15
17
|
className: "text-sm mt-1 text-secondary",
|
|
16
|
-
children:
|
|
18
|
+
children: a.label
|
|
17
19
|
})] })
|
|
18
|
-
}), /* @__PURE__ */
|
|
20
|
+
}), /* @__PURE__ */ n("div", {
|
|
19
21
|
className: "space-y-2",
|
|
20
|
-
children:
|
|
21
|
-
let
|
|
22
|
-
return /* @__PURE__ */
|
|
22
|
+
children: i.map((e) => {
|
|
23
|
+
let t = (e.value - s) / c * 100, i = new Date(e.timestamp);
|
|
24
|
+
return /* @__PURE__ */ r("div", {
|
|
23
25
|
className: "flex items-center gap-3 transition-colors duration-200 hover:bg-bg-sunken/50 p-1 rounded",
|
|
24
|
-
children: [/* @__PURE__ */
|
|
26
|
+
children: [/* @__PURE__ */ n("span", {
|
|
25
27
|
className: "text-xs w-20 text-right text-tertiary",
|
|
26
28
|
children: e.label || i.toLocaleDateString("en-US", {
|
|
27
29
|
month: "short",
|
|
28
30
|
day: "numeric"
|
|
29
31
|
})
|
|
30
|
-
}), /* @__PURE__ */
|
|
32
|
+
}), /* @__PURE__ */ r("div", {
|
|
31
33
|
className: "flex-1 flex items-center gap-2",
|
|
32
|
-
children: [/* @__PURE__ */
|
|
34
|
+
children: [/* @__PURE__ */ n("div", {
|
|
33
35
|
className: "h-8 rounded transition-all duration-300 bg-action-primary-bg/80 hover:bg-action-primary-bg",
|
|
34
|
-
style: { width: `${Math.max(
|
|
35
|
-
}), /* @__PURE__ */
|
|
36
|
+
style: { width: `${Math.max(t, 2)}%` }
|
|
37
|
+
}), /* @__PURE__ */ n("span", {
|
|
36
38
|
className: "text-sm font-medium text-primary",
|
|
37
39
|
children: e.value
|
|
38
40
|
})]
|
|
@@ -43,6 +45,6 @@ function r({ trends: r, period: i }) {
|
|
|
43
45
|
});
|
|
44
46
|
}
|
|
45
47
|
//#endregion
|
|
46
|
-
export {
|
|
48
|
+
export { i as TrendChart };
|
|
47
49
|
|
|
48
50
|
//# sourceMappingURL=TrendChart.js.map
|