@burdenoff/microfe-support 2026.830.1 → 2026.830.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/index.js +2 -1
- package/dist/support/SupportAdminRoot.js +31 -34
- package/dist/support/SupportAdminRoot.js.map +1 -1
- package/dist/support/SupportUserRoot.js +19 -22
- package/dist/support/SupportUserRoot.js.map +1 -1
- package/dist/support/components/PageLayout.d.ts +1 -1
- package/dist/support/components/PageLayout.js +46 -44
- package/dist/support/components/PageLayout.js.map +1 -1
- package/dist/support/components/analytics/CategoryBreakdown.js +24 -23
- package/dist/support/components/analytics/CategoryBreakdown.js.map +1 -1
- package/dist/support/components/analytics/PriorityBreakdown.js +27 -26
- package/dist/support/components/analytics/PriorityBreakdown.js.map +1 -1
- package/dist/support/components/analytics/SLAReport.js +48 -54
- package/dist/support/components/analytics/SLAReport.js.map +1 -1
- package/dist/support/components/analytics/SatisfactionDistribution.js +56 -59
- package/dist/support/components/analytics/SatisfactionDistribution.js.map +1 -1
- package/dist/support/components/analytics/TopAgents.js +27 -26
- package/dist/support/components/analytics/TopAgents.js.map +1 -1
- package/dist/support/components/analytics/TrendChart.js +23 -21
- package/dist/support/components/analytics/TrendChart.js.map +1 -1
- package/dist/support/components/kb/ArticleForm.js +145 -132
- package/dist/support/components/kb/ArticleForm.js.map +1 -1
- package/dist/support/components/settings/CannedResponsesSettings.js +104 -103
- package/dist/support/components/settings/CannedResponsesSettings.js.map +1 -1
- package/dist/support/components/settings/SLAPoliciesSettings.js +120 -123
- package/dist/support/components/settings/SLAPoliciesSettings.js.map +1 -1
- package/dist/support/components/settings/TicketCategoriesSettings.js +175 -180
- package/dist/support/components/settings/TicketCategoriesSettings.js.map +1 -1
- package/dist/support/components/tickets/AttachmentList.js +21 -20
- package/dist/support/components/tickets/AttachmentList.js.map +1 -1
- package/dist/support/components/tickets/MessageComposer.js +35 -35
- package/dist/support/components/tickets/MessageThread.js +55 -54
- package/dist/support/components/tickets/MessageThread.js.map +1 -1
- package/dist/support/components/tickets/TicketDetailHeader.js +62 -57
- package/dist/support/components/tickets/TicketDetailHeader.js.map +1 -1
- package/dist/support/components/tickets/TicketHeader.js +47 -47
- package/dist/support/components/tickets/TicketSidebar.js +122 -121
- package/dist/support/components/tickets/TicketSidebar.js.map +1 -1
- package/dist/support/hooks/index.d.ts +1 -0
- package/dist/support/hooks/index.js +1 -0
- package/dist/support/hooks/useTr.d.ts +16 -0
- package/dist/support/hooks/useTr.js +12 -0
- package/dist/support/hooks/useTr.js.map +1 -0
- package/dist/support/index.d.ts +1 -0
- package/dist/support/index.js +2 -1
- package/dist/support/pages/AnalyticsPage.js +151 -145
- package/dist/support/pages/AnalyticsPage.js.map +1 -1
- package/dist/support/pages/ArticleDetailAdminPage.js +134 -147
- package/dist/support/pages/ArticleDetailAdminPage.js.map +1 -1
- package/dist/support/pages/ArticleDetailUserPage.js +70 -79
- package/dist/support/pages/ArticleDetailUserPage.js.map +1 -1
- package/dist/support/pages/ContactInquiriesPage.js +140 -139
- package/dist/support/pages/ContactInquiriesPage.js.map +1 -1
- package/dist/support/pages/ContactInquiryDetailPage.js +259 -232
- package/dist/support/pages/ContactInquiryDetailPage.js.map +1 -1
- package/dist/support/pages/CreateArticlePage.js +57 -56
- package/dist/support/pages/CreateArticlePage.js.map +1 -1
- package/dist/support/pages/CreateTicketPage.js +151 -146
- package/dist/support/pages/CreateTicketPage.js.map +1 -1
- package/dist/support/pages/EditArticlePage.js +80 -79
- package/dist/support/pages/EditArticlePage.js.map +1 -1
- package/dist/support/pages/KnowledgeBaseAdminPage.js +92 -99
- package/dist/support/pages/KnowledgeBaseAdminPage.js.map +1 -1
- package/dist/support/pages/KnowledgeBaseUserPage.js +85 -92
- package/dist/support/pages/KnowledgeBaseUserPage.js.map +1 -1
- package/dist/support/pages/SettingsPage.js +88 -87
- package/dist/support/pages/SettingsPage.js.map +1 -1
- package/dist/support/pages/TicketDetailAdminPage.js +91 -90
- package/dist/support/pages/TicketDetailAdminPage.js.map +1 -1
- package/dist/support/pages/TicketDetailUserPage.js +120 -118
- package/dist/support/pages/TicketDetailUserPage.js.map +1 -1
- package/dist/support/pages/TicketListPage.js +139 -139
- package/dist/support/translations/en.d.ts +814 -0
- package/dist/support/translations/en.js +779 -0
- package/dist/support/translations/en.js.map +1 -0
- package/dist/support/translations/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,46 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { useTr as e } from "../../hooks/useTr.js";
|
|
2
|
+
import { GlassCard as t } from "../ui.js";
|
|
3
|
+
import { ticketPriorityDotClasses as n } from "../../utils/uiTokens.js";
|
|
4
|
+
import { AlertCircle as r } from "lucide-react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
6
|
//#region src/support/components/analytics/PriorityBreakdown.tsx
|
|
6
|
-
var
|
|
7
|
-
...
|
|
8
|
-
URGENT:
|
|
9
|
-
MEDIUM:
|
|
7
|
+
var o = {
|
|
8
|
+
...n,
|
|
9
|
+
URGENT: n.CRITICAL,
|
|
10
|
+
MEDIUM: n.NORMAL
|
|
10
11
|
};
|
|
11
|
-
function
|
|
12
|
-
let
|
|
13
|
-
return /* @__PURE__ */
|
|
12
|
+
function s({ data: n }) {
|
|
13
|
+
let s = e(), c = n.reduce((e, t) => e + t.count, 0);
|
|
14
|
+
return /* @__PURE__ */ a(t, {
|
|
14
15
|
treatment: "insight",
|
|
15
16
|
className: "p-6 border-border-seam animate-in fade-in-0 slide-in-from-bottom-2",
|
|
16
|
-
children: [/* @__PURE__ */
|
|
17
|
+
children: [/* @__PURE__ */ a("h2", {
|
|
17
18
|
className: "text-xl font-semibold mb-4 flex items-center gap-2 text-primary",
|
|
18
|
-
children: [/* @__PURE__ */ r
|
|
19
|
-
}), /* @__PURE__ */
|
|
19
|
+
children: [/* @__PURE__ */ i(r, { size: 20 }), s("support.analytics.priorityBreakdown.title", "Tickets by Priority")]
|
|
20
|
+
}), /* @__PURE__ */ i("div", {
|
|
20
21
|
className: "space-y-4",
|
|
21
|
-
children:
|
|
22
|
-
let t =
|
|
23
|
-
return /* @__PURE__ */
|
|
22
|
+
children: n.map((e) => {
|
|
23
|
+
let t = c > 0 ? e.count / c * 100 : 0, n = o[e.priority] || "bg-muted-foreground", r = e.priority.toLowerCase();
|
|
24
|
+
return /* @__PURE__ */ a("div", { children: [/* @__PURE__ */ a("div", {
|
|
24
25
|
className: "flex items-center justify-between mb-2",
|
|
25
|
-
children: [/* @__PURE__ */
|
|
26
|
+
children: [/* @__PURE__ */ a("div", {
|
|
26
27
|
className: "flex items-center gap-2",
|
|
27
|
-
children: [/* @__PURE__ */
|
|
28
|
+
children: [/* @__PURE__ */ i("div", { className: `w-3 h-3 rounded-full ${n}` }), /* @__PURE__ */ i("span", {
|
|
28
29
|
className: "font-medium text-primary",
|
|
29
|
-
children: e.priority
|
|
30
|
+
children: s(`support.shared.priority.${r}`, e.priority)
|
|
30
31
|
})]
|
|
31
|
-
}), /* @__PURE__ */
|
|
32
|
+
}), /* @__PURE__ */ a("div", {
|
|
32
33
|
className: "flex items-center gap-2",
|
|
33
|
-
children: [/* @__PURE__ */
|
|
34
|
+
children: [/* @__PURE__ */ a("span", {
|
|
34
35
|
className: "text-sm text-tertiary tabular-nums",
|
|
35
36
|
children: [t.toFixed(0), "%"]
|
|
36
|
-
}), /* @__PURE__ */
|
|
37
|
+
}), /* @__PURE__ */ i("span", {
|
|
37
38
|
className: "font-semibold text-primary tabular-nums",
|
|
38
39
|
children: e.count
|
|
39
40
|
})]
|
|
40
41
|
})]
|
|
41
|
-
}), /* @__PURE__ */
|
|
42
|
+
}), /* @__PURE__ */ i("div", {
|
|
42
43
|
className: "h-2 rounded-full bg-bg-sunken",
|
|
43
|
-
children: /* @__PURE__ */
|
|
44
|
+
children: /* @__PURE__ */ i("div", {
|
|
44
45
|
className: `h-full rounded-full transition-all duration-300 ${n}`,
|
|
45
46
|
style: { width: `${t}%` },
|
|
46
47
|
"data-priority": e.priority
|
|
@@ -51,6 +52,6 @@ function o({ data: t }) {
|
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
54
|
//#endregion
|
|
54
|
-
export {
|
|
55
|
+
export { s as PriorityBreakdown };
|
|
55
56
|
|
|
56
57
|
//# sourceMappingURL=PriorityBreakdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PriorityBreakdown.js","names":[],"sources":["../../../../src/support/components/analytics/PriorityBreakdown.tsx"],"sourcesContent":["import { AlertCircle } from 'lucide-react';\nimport { ticketPriorityDotClasses } from '../../utils/uiTokens';\nimport { GlassCard } from '../ui';\n\ninterface PriorityCount {\n priority: string;\n count: number;\n}\n\ninterface PriorityBreakdownProps {\n data: PriorityCount[];\n}\n\nconst priorityColors: Record<string, string> = {\n ...ticketPriorityDotClasses,\n URGENT: ticketPriorityDotClasses.CRITICAL,\n MEDIUM: ticketPriorityDotClasses.NORMAL,\n};\n\nexport function PriorityBreakdown({ data }: PriorityBreakdownProps) {\n const total = data.reduce((sum, item) => sum + item.count, 0);\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 <AlertCircle size={20} />\n Tickets by Priority\n </h2>\n\n <div className=\"space-y-4\">\n {data.map((item) => {\n const percentage = total > 0 ? (item.count / total) * 100 : 0;\n const colorClass = priorityColors[item.priority] || 'bg-muted-foreground';\n\n return (\n <div key={item.priority}>\n <div className=\"flex items-center justify-between mb-2\">\n <div className=\"flex items-center gap-2\">\n <div className={`w-3 h-3 rounded-full ${colorClass}`} />\n <span className=\"font-medium text-primary\"
|
|
1
|
+
{"version":3,"file":"PriorityBreakdown.js","names":[],"sources":["../../../../src/support/components/analytics/PriorityBreakdown.tsx"],"sourcesContent":["import { AlertCircle } from 'lucide-react';\nimport { ticketPriorityDotClasses } from '../../utils/uiTokens';\nimport { GlassCard } from '../ui';\nimport { useTr } from '../../hooks/useTr';\n\ninterface PriorityCount {\n priority: string;\n count: number;\n}\n\ninterface PriorityBreakdownProps {\n data: PriorityCount[];\n}\n\nconst priorityColors: Record<string, string> = {\n ...ticketPriorityDotClasses,\n URGENT: ticketPriorityDotClasses.CRITICAL,\n MEDIUM: ticketPriorityDotClasses.NORMAL,\n};\n\nexport function PriorityBreakdown({ data }: PriorityBreakdownProps) {\n const tr = useTr();\n const total = data.reduce((sum, item) => sum + item.count, 0);\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 <AlertCircle size={20} />\n {tr('support.analytics.priorityBreakdown.title', 'Tickets by Priority')}\n </h2>\n\n <div className=\"space-y-4\">\n {data.map((item) => {\n const percentage = total > 0 ? (item.count / total) * 100 : 0;\n const colorClass = priorityColors[item.priority] || 'bg-muted-foreground';\n const priorityKey = item.priority.toLowerCase();\n\n return (\n <div key={item.priority}>\n <div className=\"flex items-center justify-between mb-2\">\n <div className=\"flex items-center gap-2\">\n <div className={`w-3 h-3 rounded-full ${colorClass}`} />\n <span className=\"font-medium text-primary\">\n {tr(`support.shared.priority.${priorityKey}`, item.priority)}\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm text-tertiary tabular-nums\">\n {percentage.toFixed(0)}%\n </span>\n <span className=\"font-semibold text-primary tabular-nums\">{item.count}</span>\n </div>\n </div>\n <div className=\"h-2 rounded-full bg-bg-sunken\">\n <div\n className={`h-full rounded-full transition-all duration-300 ${colorClass}`}\n style={{\n width: `${percentage}%`,\n }}\n data-priority={item.priority}\n />\n </div>\n </div>\n );\n })}\n </div>\n </GlassCard>\n );\n}\n"],"mappings":";;;;;;AAcA,IAAM,IAAyC;CAC7C,GAAG;CACH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ET,CAAC;EACE,CAAA,CACI;;AAEf"}
|
|
@@ -1,103 +1,97 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useTr as e } from "../../hooks/useTr.js";
|
|
2
|
+
import { GlassCard as t } from "../ui.js";
|
|
3
|
+
import { AlertTriangle as n, Shield as r } from "lucide-react";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
5
|
//#region src/support/components/analytics/SLAReport.tsx
|
|
5
|
-
function
|
|
6
|
-
|
|
6
|
+
function o({ report: o }) {
|
|
7
|
+
let s = e();
|
|
8
|
+
return /* @__PURE__ */ a(t, {
|
|
7
9
|
treatment: "insight",
|
|
8
10
|
className: "p-6 border-border-seam animate-in fade-in-0 slide-in-from-bottom-2",
|
|
9
11
|
children: [
|
|
10
|
-
/* @__PURE__ */
|
|
12
|
+
/* @__PURE__ */ a("h2", {
|
|
11
13
|
className: "text-xl font-semibold mb-4 flex items-center gap-2 text-primary",
|
|
12
|
-
children: [/* @__PURE__ */ r
|
|
14
|
+
children: [/* @__PURE__ */ i(r, { size: 20 }), s("support.analytics.slaReport.title", "SLA Compliance Report")]
|
|
13
15
|
}),
|
|
14
|
-
/* @__PURE__ */
|
|
16
|
+
/* @__PURE__ */ a("div", {
|
|
15
17
|
className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6",
|
|
16
18
|
children: [
|
|
17
|
-
/* @__PURE__ */
|
|
19
|
+
/* @__PURE__ */ a("div", {
|
|
18
20
|
className: "p-4 rounded-lg bg-bg-sunken transition-colors duration-200",
|
|
19
21
|
children: [
|
|
20
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ i("p", {
|
|
21
23
|
className: "text-xs font-medium mb-1 text-tertiary",
|
|
22
|
-
children: "First Response"
|
|
24
|
+
children: s("support.analytics.slaReport.firstResponse", "First Response")
|
|
23
25
|
}),
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
className: `text-2xl font-bold tabular-nums ${
|
|
26
|
-
children: [
|
|
26
|
+
/* @__PURE__ */ a("p", {
|
|
27
|
+
className: `text-2xl font-bold tabular-nums ${o.firstResponseCompliance >= 90 ? "text-success" : "text-warning"}`,
|
|
28
|
+
children: [o.firstResponseCompliance.toFixed(1), "%"]
|
|
27
29
|
}),
|
|
28
30
|
/* @__PURE__ */ i("p", {
|
|
29
31
|
className: "text-xs mt-1 text-tertiary",
|
|
30
|
-
children:
|
|
31
|
-
"Avg: ",
|
|
32
|
-
(a.avgFirstResponseTime / 60).toFixed(1),
|
|
33
|
-
"h"
|
|
34
|
-
]
|
|
32
|
+
children: s("support.analytics.slaReport.avg", "Avg: {{value}}h", { value: (o.avgFirstResponseTime / 60).toFixed(1) })
|
|
35
33
|
})
|
|
36
34
|
]
|
|
37
35
|
}),
|
|
38
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ a("div", {
|
|
39
37
|
className: "p-4 rounded-lg bg-bg-sunken transition-colors duration-200",
|
|
40
38
|
children: [
|
|
41
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ i("p", {
|
|
42
40
|
className: "text-xs font-medium mb-1 text-tertiary",
|
|
43
|
-
children: "Resolution"
|
|
41
|
+
children: s("support.analytics.slaReport.resolution", "Resolution")
|
|
44
42
|
}),
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
className: `text-2xl font-bold tabular-nums ${
|
|
47
|
-
children: [
|
|
43
|
+
/* @__PURE__ */ a("p", {
|
|
44
|
+
className: `text-2xl font-bold tabular-nums ${o.resolutionCompliance >= 90 ? "text-success" : "text-warning"}`,
|
|
45
|
+
children: [o.resolutionCompliance.toFixed(1), "%"]
|
|
48
46
|
}),
|
|
49
47
|
/* @__PURE__ */ i("p", {
|
|
50
48
|
className: "text-xs mt-1 text-tertiary",
|
|
51
|
-
children:
|
|
52
|
-
"Avg: ",
|
|
53
|
-
(a.avgResolutionTime / 60).toFixed(1),
|
|
54
|
-
"h"
|
|
55
|
-
]
|
|
49
|
+
children: s("support.analytics.slaReport.avg", "Avg: {{value}}h", { value: (o.avgResolutionTime / 60).toFixed(1) })
|
|
56
50
|
})
|
|
57
51
|
]
|
|
58
52
|
}),
|
|
59
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ a("div", {
|
|
60
54
|
className: "p-4 rounded-lg bg-bg-sunken transition-colors duration-200",
|
|
61
|
-
children: [/* @__PURE__ */
|
|
55
|
+
children: [/* @__PURE__ */ i("p", {
|
|
62
56
|
className: "text-xs font-medium mb-1 text-tertiary",
|
|
63
|
-
children: "Total Tickets"
|
|
64
|
-
}), /* @__PURE__ */
|
|
57
|
+
children: s("support.analytics.slaReport.totalTickets", "Total Tickets")
|
|
58
|
+
}), /* @__PURE__ */ i("p", {
|
|
65
59
|
className: "text-2xl font-bold text-primary",
|
|
66
|
-
children:
|
|
60
|
+
children: o.totalTickets
|
|
67
61
|
})]
|
|
68
62
|
}),
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
className: `p-4 rounded-lg flex items-center gap-2 transition-colors duration-200 ${
|
|
71
|
-
children: [/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ a("div", {
|
|
64
|
+
className: `p-4 rounded-lg flex items-center gap-2 transition-colors duration-200 ${o.breachedTickets > 0 ? "bg-error/10" : "bg-bg-sunken"}`,
|
|
65
|
+
children: [/* @__PURE__ */ i(n, {
|
|
72
66
|
size: 20,
|
|
73
|
-
className:
|
|
74
|
-
}), /* @__PURE__ */
|
|
67
|
+
className: o.breachedTickets > 0 ? "text-error" : "text-tertiary"
|
|
68
|
+
}), /* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("p", {
|
|
75
69
|
className: "text-xs font-medium text-tertiary",
|
|
76
|
-
children: "Breached"
|
|
77
|
-
}), /* @__PURE__ */
|
|
78
|
-
className: `text-2xl font-bold ${
|
|
79
|
-
children:
|
|
70
|
+
children: s("support.analytics.slaReport.breached", "Breached")
|
|
71
|
+
}), /* @__PURE__ */ i("p", {
|
|
72
|
+
className: `text-2xl font-bold ${o.breachedTickets > 0 ? "text-error" : "text-primary"}`,
|
|
73
|
+
children: o.breachedTickets
|
|
80
74
|
})] })]
|
|
81
75
|
})
|
|
82
76
|
]
|
|
83
77
|
}),
|
|
84
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("h3", {
|
|
85
79
|
className: "text-sm font-semibold mb-3 text-secondary",
|
|
86
|
-
children: "Compliance by Priority"
|
|
87
|
-
}), /* @__PURE__ */
|
|
80
|
+
children: s("support.analytics.slaReport.byPriority", "Compliance by Priority")
|
|
81
|
+
}), /* @__PURE__ */ i("div", {
|
|
88
82
|
className: "space-y-2",
|
|
89
|
-
children:
|
|
83
|
+
children: o.byPriority.map((e) => /* @__PURE__ */ a("div", {
|
|
90
84
|
className: "flex items-center justify-between py-2 px-3 rounded bg-bg-sunken transition-colors duration-200 hover:bg-bg-sunken/80",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
85
|
+
children: [/* @__PURE__ */ a("div", {
|
|
92
86
|
className: "flex items-center gap-3",
|
|
93
|
-
children: [/* @__PURE__ */
|
|
87
|
+
children: [/* @__PURE__ */ i("span", {
|
|
94
88
|
className: "text-sm font-medium text-primary",
|
|
95
|
-
children: e.priority
|
|
89
|
+
children: s(`support.shared.priority.${e.priority.toLowerCase()}`, e.priority)
|
|
96
90
|
}), /* @__PURE__ */ i("span", {
|
|
97
91
|
className: "text-xs text-tertiary",
|
|
98
|
-
children:
|
|
92
|
+
children: s("support.analytics.slaReport.ticketsCount", "{{count}} tickets", { count: e.tickets })
|
|
99
93
|
})]
|
|
100
|
-
}), /* @__PURE__ */
|
|
94
|
+
}), /* @__PURE__ */ a("span", {
|
|
101
95
|
className: `text-sm font-semibold ${e.compliance >= 90 ? "text-success" : e.compliance >= 70 ? "text-warning" : "text-error"}`,
|
|
102
96
|
children: [e.compliance.toFixed(1), "%"]
|
|
103
97
|
})]
|
|
@@ -107,6 +101,6 @@ function a({ report: a }) {
|
|
|
107
101
|
});
|
|
108
102
|
}
|
|
109
103
|
//#endregion
|
|
110
|
-
export {
|
|
104
|
+
export { o as SLAReport };
|
|
111
105
|
|
|
112
106
|
//# 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';\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\"
|
|
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';\nimport { useTr } from '../../hooks/useTr';\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 const tr = useTr();\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 <Shield size={20} />\n {tr('support.analytics.slaReport.title', '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\">\n {tr('support.analytics.slaReport.firstResponse', 'First Response')}\n </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 {tr('support.analytics.slaReport.avg', 'Avg: {{value}}h', {\n value: (report.avgFirstResponseTime / 60).toFixed(1),\n })}\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\">\n {tr('support.analytics.slaReport.resolution', 'Resolution')}\n </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 {tr('support.analytics.slaReport.avg', 'Avg: {{value}}h', {\n value: (report.avgResolutionTime / 60).toFixed(1),\n })}\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\">\n {tr('support.analytics.slaReport.totalTickets', 'Total Tickets')}\n </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\">\n {tr('support.analytics.slaReport.breached', 'Breached')}\n </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\">\n {tr('support.analytics.slaReport.byPriority', 'Compliance by Priority')}\n </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\">\n {tr(`support.shared.priority.${item.priority.toLowerCase()}`, item.priority)}\n </span>\n <span className=\"text-xs text-tertiary\">\n {tr('support.analytics.slaReport.ticketsCount', '{{count}} tickets', {\n count: item.tickets,\n })}\n </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":";;;;;AA2BA,SAAgB,EAAU,EAAE,aAA0B;CACpD,IAAM,IAAK,EAAM;CAEjB,OACE,kBAAC,GAAD;EACE,WAAU;EACV,WAAU;EAFZ,UAAA;GAIE,kBAAC,MAAD;IAAI,WAAU;IAAd,UAAA,CACE,kBAAC,GAAD,EAAQ,MAAM,GAAK,CAAA,GAClB,EAAG,qCAAqC,uBAAuB,CAC9D;;G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A,EAAG,wCAAwC,UAAU;MACrD,CAAA,GACH,kBAAC,KAAD;OACE,WAAW,sBACT,EAAO,kBAAkB,IAAI,eAAe;OAG7C,UAAA,EAAO;MACP,CAAA,CACA,EAAA,CAAA,CACF;;IACF;;GAEL,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;IAAI,WAAU;IACX,UAAA,EAAG,0CAA0C,wBAAwB;GACpE,CAAA,GACJ,kBAAC,OAAD;IAAK,WAAU;IACZ,UAAA,EAAO,WAAW,KAAK,MACtB,kBAAC,OAAD;KAEE,WAAU;KAFZ,UAAA,CAIE,kBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACE,kBAAC,QAAD;OAAM,WAAU;OACb,UAAA,EAAG,2BAA2B,EAAK,SAAS,YAAY,KAAK,EAAK,QAAQ;MACvE,CAAA,GACN,kBAAC,QAAD;OAAM,WAAU;OACb,UAAA,EAAG,4CAA4C,qBAAqB,EACnE,OAAO,EAAK,QACd,CAAC;MACG,CAAA,CACH;KACL,CAAA,GAAA,kBAAC,QAAD;MACE,WAAW,yBACT,EAAK,cAAc,KACf,iBACA,EAAK,cAAc,KACjB,iBACA;MANV,UAAA,CASG,EAAK,WAAW,QAAQ,CAAC,GAAE,GACxB;KACH,CAAA,CAAA;IAxBE,GAAA,EAAK,QAwBP,CACN;GACE,CAAA,CACF,EAAA,CAAA;EACI;;AAEf"}
|
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useTr as e } from "../../hooks/useTr.js";
|
|
2
|
+
import { GlassCard as t } from "../ui.js";
|
|
3
|
+
import { Star as n, ThumbsUp as r } from "lucide-react";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
5
|
//#region src/support/components/analytics/SatisfactionDistribution.tsx
|
|
5
|
-
function
|
|
6
|
-
let
|
|
6
|
+
function o({ metrics: o }) {
|
|
7
|
+
let s = e(), c = [
|
|
7
8
|
{
|
|
8
9
|
stars: 5,
|
|
9
|
-
count:
|
|
10
|
+
count: o.ratings.rating5
|
|
10
11
|
},
|
|
11
12
|
{
|
|
12
13
|
stars: 4,
|
|
13
|
-
count:
|
|
14
|
+
count: o.ratings.rating4
|
|
14
15
|
},
|
|
15
16
|
{
|
|
16
17
|
stars: 3,
|
|
17
|
-
count:
|
|
18
|
+
count: o.ratings.rating3
|
|
18
19
|
},
|
|
19
20
|
{
|
|
20
21
|
stars: 2,
|
|
21
|
-
count:
|
|
22
|
+
count: o.ratings.rating2
|
|
22
23
|
},
|
|
23
24
|
{
|
|
24
25
|
stars: 1,
|
|
25
|
-
count:
|
|
26
|
+
count: o.ratings.rating1
|
|
26
27
|
}
|
|
27
|
-
],
|
|
28
|
-
return /* @__PURE__ */
|
|
28
|
+
], l = Math.max(...c.map((e) => e.count));
|
|
29
|
+
return /* @__PURE__ */ a(t, {
|
|
29
30
|
treatment: "insight",
|
|
30
31
|
className: "p-6 border-border-seam animate-in fade-in-0 slide-in-from-bottom-2",
|
|
31
32
|
children: [
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ a("h2", {
|
|
33
34
|
className: "text-xl font-semibold mb-4 flex items-center gap-2 text-primary",
|
|
34
|
-
children: [/* @__PURE__ */ r
|
|
35
|
+
children: [/* @__PURE__ */ i(r, { size: 20 }), s("support.analytics.satisfaction.title", "Customer Satisfaction")]
|
|
35
36
|
}),
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ a("div", {
|
|
37
38
|
className: "grid grid-cols-3 gap-4 mb-6",
|
|
38
39
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ a("div", {
|
|
40
41
|
className: "text-center p-3 rounded-lg bg-bg-sunken transition-colors duration-200",
|
|
41
42
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ i("p", {
|
|
43
44
|
className: "text-xs font-medium mb-1 text-tertiary",
|
|
44
|
-
children: "Avg Rating"
|
|
45
|
+
children: s("support.analytics.satisfaction.avgRating", "Avg Rating")
|
|
45
46
|
}),
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ i("p", {
|
|
47
48
|
className: "text-2xl font-bold text-primary tabular-nums",
|
|
48
|
-
children:
|
|
49
|
+
children: o.averageRating.toFixed(1)
|
|
49
50
|
}),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ i("div", {
|
|
51
52
|
className: "flex items-center justify-center gap-1 mt-1",
|
|
52
53
|
children: [...[
|
|
53
54
|
,
|
|
@@ -55,89 +56,85 @@ function a({ metrics: a }) {
|
|
|
55
56
|
,
|
|
56
57
|
,
|
|
57
58
|
,
|
|
58
|
-
]].map((e,
|
|
59
|
+
]].map((e, t) => /* @__PURE__ */ i(n, {
|
|
59
60
|
size: 12,
|
|
60
|
-
className:
|
|
61
|
-
},
|
|
61
|
+
className: t < Math.round(o.averageRating) ? "text-warning fill-warning" : "text-tertiary"
|
|
62
|
+
}, t))
|
|
62
63
|
})
|
|
63
64
|
]
|
|
64
65
|
}),
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ a("div", {
|
|
66
67
|
className: "text-center p-3 rounded-lg bg-bg-sunken transition-colors duration-200",
|
|
67
68
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ i("p", {
|
|
69
70
|
className: "text-xs font-medium mb-1 text-tertiary",
|
|
70
|
-
children: "CSAT"
|
|
71
|
+
children: s("support.analytics.satisfaction.csat", "CSAT")
|
|
71
72
|
}),
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ a("p", {
|
|
73
74
|
className: "text-2xl font-bold text-success tabular-nums",
|
|
74
|
-
children: [
|
|
75
|
+
children: [o.csat.toFixed(0), "%"]
|
|
75
76
|
}),
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ i("p", {
|
|
77
78
|
className: "text-xs mt-1 text-tertiary",
|
|
78
|
-
children: "Satisfaction"
|
|
79
|
+
children: s("support.analytics.satisfaction.satisfaction", "Satisfaction")
|
|
79
80
|
})
|
|
80
81
|
]
|
|
81
82
|
}),
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ a("div", {
|
|
83
84
|
className: "text-center p-3 rounded-lg bg-bg-sunken transition-colors duration-200",
|
|
84
85
|
children: [
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ i("p", {
|
|
86
87
|
className: "text-xs font-medium mb-1 text-tertiary",
|
|
87
|
-
children: "NPS"
|
|
88
|
+
children: s("support.analytics.satisfaction.nps", "NPS")
|
|
88
89
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ i("p", {
|
|
90
91
|
className: "text-2xl font-bold text-accent tabular-nums",
|
|
91
|
-
children:
|
|
92
|
+
children: o.nps.toFixed(0)
|
|
92
93
|
}),
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ i("p", {
|
|
94
95
|
className: "text-xs mt-1 text-tertiary",
|
|
95
|
-
children: "Promoter Score"
|
|
96
|
+
children: s("support.analytics.satisfaction.promoterScore", "Promoter Score")
|
|
96
97
|
})
|
|
97
98
|
]
|
|
98
99
|
})
|
|
99
100
|
]
|
|
100
101
|
}),
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("h3", {
|
|
102
103
|
className: "text-sm font-semibold mb-3 text-secondary",
|
|
103
|
-
children:
|
|
104
|
-
|
|
105
|
-
a.totalResponses,
|
|
106
|
-
" responses)"
|
|
107
|
-
]
|
|
108
|
-
}), /* @__PURE__ */ r("div", {
|
|
104
|
+
children: s("support.analytics.satisfaction.distribution", "Rating Distribution ({{count}} responses)", { count: o.totalResponses })
|
|
105
|
+
}), /* @__PURE__ */ i("div", {
|
|
109
106
|
className: "space-y-2",
|
|
110
|
-
children:
|
|
111
|
-
let
|
|
112
|
-
return /* @__PURE__ */
|
|
107
|
+
children: c.map((e) => {
|
|
108
|
+
let t = o.totalResponses > 0 ? e.count / o.totalResponses * 100 : 0, r = l > 0 ? e.count / l * 100 : 0;
|
|
109
|
+
return /* @__PURE__ */ a("div", {
|
|
113
110
|
className: "flex items-center gap-3",
|
|
114
|
-
children: [/* @__PURE__ */
|
|
111
|
+
children: [/* @__PURE__ */ a("div", {
|
|
115
112
|
className: "flex items-center gap-1 w-16",
|
|
116
|
-
children: [/* @__PURE__ */
|
|
113
|
+
children: [/* @__PURE__ */ i("span", {
|
|
117
114
|
className: "text-sm font-medium text-primary",
|
|
118
115
|
children: e.stars
|
|
119
|
-
}), /* @__PURE__ */
|
|
116
|
+
}), /* @__PURE__ */ i(n, {
|
|
120
117
|
size: 14,
|
|
121
118
|
className: "text-warning fill-warning"
|
|
122
119
|
})]
|
|
123
|
-
}), /* @__PURE__ */
|
|
120
|
+
}), /* @__PURE__ */ a("div", {
|
|
124
121
|
className: "flex-1 flex items-center gap-2",
|
|
125
|
-
children: [/* @__PURE__ */
|
|
122
|
+
children: [/* @__PURE__ */ i("div", {
|
|
126
123
|
className: "flex-1 h-6 rounded bg-bg-sunken",
|
|
127
|
-
children: /* @__PURE__ */
|
|
124
|
+
children: /* @__PURE__ */ i("div", {
|
|
128
125
|
className: "h-full rounded transition-all duration-300 flex items-center justify-end pr-2 bg-action-primary-bg",
|
|
129
126
|
style: {
|
|
130
|
-
width: `${
|
|
127
|
+
width: `${r}%`,
|
|
131
128
|
minWidth: e.count > 0 ? "30px" : "0"
|
|
132
129
|
},
|
|
133
|
-
children: e.count > 0 && /* @__PURE__ */
|
|
130
|
+
children: e.count > 0 && /* @__PURE__ */ i("span", {
|
|
134
131
|
className: "text-xs font-medium text-action-primary-text",
|
|
135
132
|
children: e.count
|
|
136
133
|
})
|
|
137
134
|
})
|
|
138
|
-
}), /* @__PURE__ */
|
|
135
|
+
}), /* @__PURE__ */ a("span", {
|
|
139
136
|
className: "text-xs w-12 text-right text-tertiary",
|
|
140
|
-
children: [
|
|
137
|
+
children: [t.toFixed(0), "%"]
|
|
141
138
|
})]
|
|
142
139
|
})]
|
|
143
140
|
}, e.stars);
|
|
@@ -147,6 +144,6 @@ function a({ metrics: a }) {
|
|
|
147
144
|
});
|
|
148
145
|
}
|
|
149
146
|
//#endregion
|
|
150
|
-
export {
|
|
147
|
+
export { o as SatisfactionDistribution };
|
|
151
148
|
|
|
152
149
|
//# 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';\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\"
|
|
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';\nimport { useTr } from '../../hooks/useTr';\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 tr = useTr();\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 {tr('support.analytics.satisfaction.title', '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\">\n {tr('support.analytics.satisfaction.avgRating', 'Avg Rating')}\n </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\">\n {tr('support.analytics.satisfaction.csat', 'CSAT')}\n </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\">\n {tr('support.analytics.satisfaction.satisfaction', 'Satisfaction')}\n </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\">\n {tr('support.analytics.satisfaction.nps', 'NPS')}\n </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\">\n {tr('support.analytics.satisfaction.promoterScore', 'Promoter Score')}\n </p>\n </div>\n </div>\n\n <div>\n <h3 className=\"text-sm font-semibold mb-3 text-secondary\">\n {tr(\n 'support.analytics.satisfaction.distribution',\n 'Rating Distribution ({{count}} responses)',\n { count: metrics.totalResponses }\n )}\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":";;;;;AA2BA,SAAgB,EAAyB,EAAE,cAA0C;CACnF,IAAM,IAAK,EAAM,GACX,IAAe;EACnB;GAAE,OAAO;GAAG,OAAO,EAAQ,QAAQ;EAAQ;EAC3C;GAAE,OAAO;GAAG,OAAO,EAAQ,QAAQ;EAAQ;EAC3C;GAAE,OAAO;GAAG,OAAO,EAAQ,QAAQ;EAAQ;EAC3C;GAAE,OAAO;GAAG,OAAO,EAAQ,QAAQ;EAAQ;EAC3C;GAAE,OAAO;GAAG,OAAO,EAAQ,QAAQ;EAAQ;CAC7C,GAEM,IAAW,KAAK,IAAI,GAAG,EAAa,KAAK,MAAM,EAAE,KAAK,CAAC;CAE7D,OACE,kBAAC,GAAD;EACE,WAAU;EACV,WAAU;EAFZ,UAAA;GAIE,kBAAC,MAAD;IAAI,WAAU;IAAd,UAAA,CACE,kBAAC,GAAD,EAAU,MAAM,GAAK,CAAA,GACpB,EAAG,wCAAwC,uBAAuB,CACjE;;GAEJ,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,kBAAC,OAAD;MAAK,WAAU;MAAf,UAAA;OACE,kBAAC,KAAD;QAAG,WAAU;QACV,UAAA,EAAG,4CAA4C,YAAY;OAC3D,CAAA;OACH,kBAAC,KAAD;QAAG,WAAU;QACV,UAAA,EAAQ,cAAc,QAAQ,CAAC;OAC/B,CAAA;OACH,kBAAC,OAAD;QAAK,WAAU;QACZ,UAAA,CAAC,GAAG;;;;;;QAAO,CAAC,CAAC,CAAC,KAAK,GAAG,MACrB,kBAAC,GAAD;SAEE,MAAM;SACN,WACE,IAAI,KAAK,MAAM,EAAQ,aAAa,IAChC,8BACA;QAEP,GAPM,CAON,CACF;OACE,CAAA;MACF;;KAEL,kBAAC,OAAD;MAAK,W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