@burdenoff/microfe-support 2026.827.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,377 +1,372 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { useTr as e } from "../../hooks/useTr.js";
|
|
2
|
+
import { CATEGORY_COLOR_OPTIONS as t, getCategoryColorOption as n, getCategorySwatchClass as r } from "../../utils/categoryColors.js";
|
|
3
|
+
import { useEffect as i, useRef as a, useState as o } from "react";
|
|
4
|
+
import { AlertCircle as ee, CheckCircle as s, Edit2 as c, FolderOpen as l, GripVertical as u, Loader2 as d, Plus as f, ToggleLeft as p, ToggleRight as m, Trash2 as h } from "lucide-react";
|
|
5
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
6
|
+
import { AlertDialog as y, AlertDialogAction as b, AlertDialogCancel as x, AlertDialogContent as S, AlertDialogDescription as C, AlertDialogFooter as w, AlertDialogHeader as T, AlertDialogTitle as E, ResponsiveDialog as te, ResponsiveDialogContent as ne, ResponsiveDialogHeader as D, ResponsiveDialogTitle as O } from "@burdenoff/fe-libs/ui";
|
|
6
7
|
//#region src/support/components/settings/TicketCategoriesSettings.tsx
|
|
7
8
|
var k = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, ""), A = {
|
|
8
9
|
name: "",
|
|
9
10
|
slug: "",
|
|
10
11
|
description: "",
|
|
11
|
-
color:
|
|
12
|
+
color: t[0].value,
|
|
12
13
|
icon: "",
|
|
13
14
|
isActive: !0
|
|
14
15
|
};
|
|
15
16
|
function j({ categories: j, onCreate: M, onUpdate: N, onDelete: P }) {
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
let F = e(), [I, L] = o(!1), [R, z] = o(null), [B, V] = o(A), [H, U] = o(!1), [W, G] = o(null), [K, q] = o(null), [J, Y] = o(null), X = a(null);
|
|
18
|
+
i(() => () => {
|
|
19
|
+
X.current && clearTimeout(X.current);
|
|
19
20
|
}, []);
|
|
20
|
-
let
|
|
21
|
-
|
|
21
|
+
let Z = (e, t) => {
|
|
22
|
+
Y({
|
|
22
23
|
type: e,
|
|
23
24
|
message: t
|
|
24
|
-
}),
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
25
|
+
}), X.current && clearTimeout(X.current), X.current = setTimeout(() => Y(null), 3e3);
|
|
26
|
+
}, Q = () => {
|
|
27
|
+
z(null), V(A), L(!0);
|
|
28
|
+
}, re = (e) => {
|
|
29
|
+
z(e), V({
|
|
29
30
|
name: e.name,
|
|
30
31
|
slug: e.slug,
|
|
31
32
|
description: e.description || "",
|
|
32
|
-
color:
|
|
33
|
+
color: n(e.color).value,
|
|
33
34
|
icon: e.icon || "",
|
|
34
35
|
isActive: e.isActive ?? !0,
|
|
35
36
|
parentId: e.parentId
|
|
36
|
-
}),
|
|
37
|
+
}), L(!0);
|
|
37
38
|
}, $ = () => {
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
...
|
|
39
|
+
L(!1), z(null), V(A);
|
|
40
|
+
}, ie = (e) => {
|
|
41
|
+
V({
|
|
42
|
+
...B,
|
|
42
43
|
name: e,
|
|
43
|
-
slug:
|
|
44
|
+
slug: R ? B.slug : k(e)
|
|
44
45
|
});
|
|
45
|
-
},
|
|
46
|
-
if (e.preventDefault(), !(!
|
|
47
|
-
|
|
46
|
+
}, ae = async (e) => {
|
|
47
|
+
if (e.preventDefault(), !(!B.name.trim() || !B.slug.trim())) {
|
|
48
|
+
U(!0);
|
|
48
49
|
try {
|
|
49
|
-
|
|
50
|
+
R?.id ? (await N(R.id, B), Z("success", F("support.settings.categories.notifications.updated", "Category updated successfully!"))) : (await M(B), Z("success", F("support.settings.categories.notifications.created", "Category created successfully!"))), $();
|
|
50
51
|
} catch {
|
|
51
|
-
|
|
52
|
+
Z("error", R ? F("support.settings.categories.errors.updateFailed", "Failed to update category.") : F("support.settings.categories.errors.createFailed", "Failed to create category."));
|
|
52
53
|
} finally {
|
|
53
|
-
|
|
54
|
+
U(!1);
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
|
-
},
|
|
57
|
+
}, oe = (e, t) => {
|
|
57
58
|
if (t > 0) {
|
|
58
|
-
|
|
59
|
+
Z("error", F("support.settings.categories.errors.deleteBlocked", "Cannot delete category with {{count}} articles. Move articles first.", { count: t }));
|
|
59
60
|
return;
|
|
60
61
|
}
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
let e =
|
|
62
|
+
q(e);
|
|
63
|
+
}, se = async () => {
|
|
64
|
+
let e = K;
|
|
64
65
|
if (e) {
|
|
65
|
-
|
|
66
|
+
q(null), G(e);
|
|
66
67
|
try {
|
|
67
|
-
await P(e),
|
|
68
|
+
await P(e), Z("success", F("support.settings.categories.notifications.deleted", "Category deleted successfully!"));
|
|
68
69
|
} catch {
|
|
69
|
-
|
|
70
|
+
Z("error", F("support.settings.categories.errors.deleteFailed", "Failed to delete category."));
|
|
70
71
|
} finally {
|
|
71
|
-
|
|
72
|
+
G(null);
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
|
-
},
|
|
75
|
+
}, ce = async (e) => {
|
|
75
76
|
if (e.id) try {
|
|
76
|
-
await N(e.id, { isActive: !e.isActive }),
|
|
77
|
+
await N(e.id, { isActive: !e.isActive }), Z("success", e.isActive ? F("support.settings.categories.notifications.deactivated", "Category deactivated.") : F("support.settings.categories.notifications.activated", "Category activated."));
|
|
77
78
|
} catch {
|
|
78
|
-
|
|
79
|
+
Z("error", F("support.settings.categories.errors.statusUpdateFailed", "Failed to update category status."));
|
|
79
80
|
}
|
|
80
|
-
},
|
|
81
|
-
return /* @__PURE__ */
|
|
81
|
+
}, le = [...j].sort((e, t) => (e.displayOrder ?? 0) - (t.displayOrder ?? 0));
|
|
82
|
+
return /* @__PURE__ */ v("div", {
|
|
82
83
|
className: "space-y-6",
|
|
83
84
|
children: [
|
|
84
|
-
|
|
85
|
-
className: `fixed right-4 top-[calc(var(--header-height,4rem)+1rem)] z-[200] flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-200 ${
|
|
86
|
-
children: [
|
|
85
|
+
J && /* @__PURE__ */ v("div", {
|
|
86
|
+
className: `fixed right-4 top-[calc(var(--header-height,4rem)+1rem)] z-[200] flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-200 ${J.type === "success" ? "bg-status-success-bg-subtle text-status-success-text border-border-subtle" : "bg-status-error-bg-subtle text-status-error-text border-border-subtle"}`,
|
|
87
|
+
children: [J.type === "success" ? /* @__PURE__ */ _(s, {
|
|
87
88
|
size: 20,
|
|
88
89
|
className: "text-status-success-text"
|
|
89
|
-
}) : /* @__PURE__ */
|
|
90
|
+
}) : /* @__PURE__ */ _(ee, {
|
|
90
91
|
size: 20,
|
|
91
92
|
className: "text-status-error-text"
|
|
92
|
-
}), /* @__PURE__ */
|
|
93
|
+
}), /* @__PURE__ */ _("span", {
|
|
93
94
|
className: "font-medium",
|
|
94
|
-
children:
|
|
95
|
+
children: J.message
|
|
95
96
|
})]
|
|
96
97
|
}),
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
open:
|
|
98
|
+
/* @__PURE__ */ _(te, {
|
|
99
|
+
open: I,
|
|
99
100
|
onOpenChange: (e) => {
|
|
100
101
|
e || $();
|
|
101
102
|
},
|
|
102
|
-
children: /* @__PURE__ */
|
|
103
|
+
children: /* @__PURE__ */ v(ne, {
|
|
103
104
|
className: "w-full max-w-lg max-h-[90vh] overflow-y-auto",
|
|
104
|
-
children: [/* @__PURE__ */
|
|
105
|
-
onSubmit:
|
|
105
|
+
children: [/* @__PURE__ */ _(D, { children: /* @__PURE__ */ _(O, { children: R ? F("support.settings.categories.modal.editTitle", "Edit Category") : F("support.settings.categories.modal.createTitle", "Create Category") }) }), /* @__PURE__ */ v("form", {
|
|
106
|
+
onSubmit: ae,
|
|
106
107
|
className: "space-y-5",
|
|
107
108
|
children: [
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
|
|
109
110
|
htmlFor: "ticket-category-name",
|
|
110
111
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
111
|
-
children: ["Category Name
|
|
112
|
-
|
|
113
|
-
children: "*"
|
|
114
|
-
})]
|
|
115
|
-
}), /* @__PURE__ */ g("input", {
|
|
112
|
+
children: [F("support.settings.categories.form.nameLabel", "Category Name"), " *"]
|
|
113
|
+
}), /* @__PURE__ */ _("input", {
|
|
116
114
|
id: "ticket-category-name",
|
|
117
115
|
type: "text",
|
|
118
|
-
"aria-label": "Category Name",
|
|
119
|
-
value:
|
|
120
|
-
onChange: (e) =>
|
|
121
|
-
placeholder: "e.g., Technical Support",
|
|
116
|
+
"aria-label": F("support.settings.categories.form.nameLabel", "Category Name"),
|
|
117
|
+
value: B.name,
|
|
118
|
+
onChange: (e) => ie(e.target.value),
|
|
119
|
+
placeholder: F("support.settings.categories.form.namePlaceholder", "e.g., Technical Support"),
|
|
122
120
|
className: "w-full px-4 py-2.5 rounded-lg border border-border-default bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
|
|
123
121
|
required: !0
|
|
124
122
|
})] }),
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ v("div", { children: [
|
|
124
|
+
/* @__PURE__ */ v("label", {
|
|
127
125
|
htmlFor: "ticket-category-slug",
|
|
128
126
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
129
|
-
children: ["
|
|
130
|
-
className: "text-status-error-text",
|
|
131
|
-
children: "*"
|
|
132
|
-
})]
|
|
127
|
+
children: [F("support.settings.categories.form.slugLabel", "Slug"), " *"]
|
|
133
128
|
}),
|
|
134
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ _("input", {
|
|
135
130
|
id: "ticket-category-slug",
|
|
136
131
|
type: "text",
|
|
137
|
-
"aria-label": "Slug",
|
|
138
|
-
value:
|
|
139
|
-
onChange: (e) =>
|
|
140
|
-
...
|
|
132
|
+
"aria-label": F("support.settings.categories.form.slugLabel", "Slug"),
|
|
133
|
+
value: B.slug,
|
|
134
|
+
onChange: (e) => V({
|
|
135
|
+
...B,
|
|
141
136
|
slug: e.target.value
|
|
142
137
|
}),
|
|
143
|
-
placeholder: "technical-support",
|
|
138
|
+
placeholder: F("support.settings.categories.form.slugPlaceholder", "technical-support"),
|
|
144
139
|
className: "w-full px-4 py-2.5 rounded-lg border border-border-default bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
|
|
145
140
|
required: !0
|
|
146
141
|
}),
|
|
147
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ _("p", {
|
|
148
143
|
className: "text-xs text-text-secondary mt-1",
|
|
149
|
-
children: "URL-friendly identifier (auto-generated from name)"
|
|
144
|
+
children: F("support.settings.categories.form.slugHint", "URL-friendly identifier (auto-generated from name)")
|
|
150
145
|
})
|
|
151
146
|
] }),
|
|
152
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
|
|
153
148
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
154
149
|
htmlFor: "ticketcategoriessettings-description-0",
|
|
155
|
-
children: "Description"
|
|
156
|
-
}), /* @__PURE__ */
|
|
150
|
+
children: F("support.settings.categories.form.descriptionLabel", "Description")
|
|
151
|
+
}), /* @__PURE__ */ _("textarea", {
|
|
157
152
|
id: "ticketcategoriessettings-description-0",
|
|
158
|
-
"aria-label": "Description",
|
|
159
|
-
value:
|
|
160
|
-
onChange: (e) =>
|
|
161
|
-
...
|
|
153
|
+
"aria-label": F("support.settings.categories.form.descriptionLabel", "Description"),
|
|
154
|
+
value: B.description,
|
|
155
|
+
onChange: (e) => V({
|
|
156
|
+
...B,
|
|
162
157
|
description: e.target.value
|
|
163
158
|
}),
|
|
164
|
-
placeholder: "Brief description of this category...",
|
|
159
|
+
placeholder: F("support.settings.categories.form.descriptionPlaceholder", "Brief description of this category..."),
|
|
165
160
|
rows: 3,
|
|
166
161
|
className: "w-full px-4 py-2.5 rounded-lg border border-border-default bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary resize-none"
|
|
167
162
|
})] }),
|
|
168
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("span", {
|
|
169
164
|
id: "ticket-category-color-heading",
|
|
170
165
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
171
|
-
children: "Color"
|
|
172
|
-
}), /* @__PURE__ */
|
|
166
|
+
children: F("support.settings.categories.form.colorLabel", "Color")
|
|
167
|
+
}), /* @__PURE__ */ v("div", {
|
|
173
168
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center",
|
|
174
|
-
children: [/* @__PURE__ */
|
|
169
|
+
children: [/* @__PURE__ */ _("div", {
|
|
175
170
|
className: "flex flex-wrap gap-2",
|
|
176
|
-
children:
|
|
171
|
+
children: t.map((e) => /* @__PURE__ */ _("button", {
|
|
177
172
|
type: "button",
|
|
178
|
-
onClick: () =>
|
|
179
|
-
...
|
|
173
|
+
onClick: () => V({
|
|
174
|
+
...B,
|
|
180
175
|
color: e.value
|
|
181
176
|
}),
|
|
182
|
-
className: `min-h-11 min-w-11 rounded-full border-2 transition-all ${e.swatchClass} ${
|
|
183
|
-
"aria-label":
|
|
177
|
+
className: `min-h-11 min-w-11 rounded-full border-2 transition-all ${e.swatchClass} ${B.color === e.value ? "border-foreground scale-110" : "border-transparent"}`,
|
|
178
|
+
"aria-label": F("support.settings.categories.form.colorAria", "Use {{color}} category color", { color: e.label })
|
|
184
179
|
}, e.value))
|
|
185
|
-
}), /* @__PURE__ */
|
|
180
|
+
}), /* @__PURE__ */ _("select", {
|
|
186
181
|
"aria-labelledby": "ticket-category-color-heading",
|
|
187
|
-
value:
|
|
188
|
-
onChange: (e) =>
|
|
189
|
-
...
|
|
182
|
+
value: B.color,
|
|
183
|
+
onChange: (e) => V({
|
|
184
|
+
...B,
|
|
190
185
|
color: e.target.value
|
|
191
186
|
}),
|
|
192
187
|
className: "min-h-11 rounded-lg border border-border-default bg-bg-surface px-3 text-sm text-text-primary",
|
|
193
|
-
children:
|
|
188
|
+
children: t.map((e) => /* @__PURE__ */ _("option", {
|
|
194
189
|
value: e.value,
|
|
195
190
|
children: e.label
|
|
196
191
|
}, e.value))
|
|
197
192
|
})]
|
|
198
193
|
})] }),
|
|
199
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
|
|
200
195
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
201
196
|
htmlFor: "ticketcategoriessettings-icon-emoji-2",
|
|
202
|
-
children: "Icon (emoji)"
|
|
203
|
-
}), /* @__PURE__ */
|
|
197
|
+
children: F("support.settings.categories.form.iconLabel", "Icon (emoji)")
|
|
198
|
+
}), /* @__PURE__ */ _("input", {
|
|
204
199
|
id: "ticketcategoriessettings-icon-emoji-2",
|
|
205
200
|
type: "text",
|
|
206
|
-
"aria-label": "Icon (emoji)",
|
|
207
|
-
value:
|
|
208
|
-
onChange: (e) =>
|
|
209
|
-
...
|
|
201
|
+
"aria-label": F("support.settings.categories.form.iconLabel", "Icon (emoji)"),
|
|
202
|
+
value: B.icon,
|
|
203
|
+
onChange: (e) => V({
|
|
204
|
+
...B,
|
|
210
205
|
icon: e.target.value
|
|
211
206
|
}),
|
|
212
|
-
placeholder: "e.g., 🛠️",
|
|
207
|
+
placeholder: F("support.settings.categories.form.iconPlaceholder", "e.g., 🛠️"),
|
|
213
208
|
className: "w-full px-4 py-2.5 rounded-lg border border-border-default bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
|
|
214
209
|
maxLength: 4
|
|
215
210
|
})] }),
|
|
216
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ v("label", {
|
|
217
212
|
className: "flex items-center gap-3 cursor-pointer",
|
|
218
|
-
children: [/* @__PURE__ */
|
|
213
|
+
children: [/* @__PURE__ */ _("input", {
|
|
219
214
|
type: "checkbox",
|
|
220
|
-
"aria-label": "Active",
|
|
221
|
-
checked:
|
|
222
|
-
onChange: (e) =>
|
|
223
|
-
...
|
|
215
|
+
"aria-label": F("support.settings.categories.form.activeLabel", "Active"),
|
|
216
|
+
checked: B.isActive,
|
|
217
|
+
onChange: (e) => V({
|
|
218
|
+
...B,
|
|
224
219
|
isActive: e.target.checked
|
|
225
220
|
}),
|
|
226
221
|
className: "size-4 rounded border-border-default text-primary focus:ring-primary"
|
|
227
|
-
}), /* @__PURE__ */
|
|
222
|
+
}), /* @__PURE__ */ _("span", {
|
|
228
223
|
className: "text-sm text-text-primary",
|
|
229
|
-
children: "Active"
|
|
224
|
+
children: F("support.settings.categories.form.activeLabel", "Active")
|
|
230
225
|
})]
|
|
231
226
|
}),
|
|
232
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ v("div", {
|
|
233
228
|
className: "flex flex-col gap-3 pt-4 sm:flex-row",
|
|
234
|
-
children: [/* @__PURE__ */
|
|
229
|
+
children: [/* @__PURE__ */ _("button", {
|
|
235
230
|
type: "submit",
|
|
236
|
-
disabled:
|
|
231
|
+
disabled: H || !B.name.trim() || !B.slug.trim(),
|
|
237
232
|
className: "min-h-11 flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
238
|
-
children:
|
|
233
|
+
children: H ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(d, {
|
|
239
234
|
size: 18,
|
|
240
235
|
className: "animate-spin"
|
|
241
|
-
}),
|
|
242
|
-
}), /* @__PURE__ */
|
|
236
|
+
}), R ? F("support.settings.categories.actions.updating", "Updating...") : F("support.settings.categories.actions.creating", "Creating...")] }) : /* @__PURE__ */ _(g, { children: R ? F("support.settings.categories.actions.update", "Update Category") : F("support.settings.categories.actions.create", "Create Category") })
|
|
237
|
+
}), /* @__PURE__ */ _("button", {
|
|
243
238
|
type: "button",
|
|
244
239
|
onClick: $,
|
|
245
240
|
className: "min-h-11 px-4 py-2.5 rounded-lg border border-border-default hover:bg-bg-sunken transition-colors",
|
|
246
|
-
children: "Cancel"
|
|
241
|
+
children: F("support.settings.categories.actions.cancel", "Cancel")
|
|
247
242
|
})]
|
|
248
243
|
})
|
|
249
244
|
]
|
|
250
245
|
})]
|
|
251
246
|
})
|
|
252
247
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ v("div", {
|
|
254
249
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
255
|
-
children: [/* @__PURE__ */
|
|
250
|
+
children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("h2", {
|
|
256
251
|
className: "text-xl font-semibold mb-2 text-text-primary",
|
|
257
|
-
children: "Ticket Categories"
|
|
258
|
-
}), /* @__PURE__ */
|
|
252
|
+
children: F("support.settings.categories.title", "Ticket Categories")
|
|
253
|
+
}), /* @__PURE__ */ _("p", {
|
|
259
254
|
className: "text-sm text-text-secondary",
|
|
260
|
-
children: "Organize tickets and knowledge base articles by category"
|
|
261
|
-
})] }), /* @__PURE__ */
|
|
255
|
+
children: F("support.settings.categories.subtitle", "Organize tickets and knowledge base articles by category")
|
|
256
|
+
})] }), /* @__PURE__ */ v("button", {
|
|
262
257
|
type: "button",
|
|
263
|
-
onClick:
|
|
258
|
+
onClick: Q,
|
|
264
259
|
className: "min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg transition-colors bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90",
|
|
265
|
-
children: [/* @__PURE__ */
|
|
260
|
+
children: [/* @__PURE__ */ _(f, { size: 20 }), F("support.settings.categories.actions.new", "New Category")]
|
|
266
261
|
})]
|
|
267
262
|
}),
|
|
268
|
-
/* @__PURE__ */
|
|
263
|
+
/* @__PURE__ */ v("div", {
|
|
269
264
|
className: "space-y-2",
|
|
270
|
-
children: [
|
|
265
|
+
children: [le.map((e) => /* @__PURE__ */ v("div", {
|
|
271
266
|
className: `p-4 rounded-lg border bg-bg-surface flex flex-col gap-4 sm:flex-row sm:items-center ${e.isActive === !1 ? "border-border-seam/50 opacity-60" : "border-border-seam"}`,
|
|
272
267
|
children: [
|
|
273
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ _("div", {
|
|
274
269
|
className: "text-text-secondary cursor-grab",
|
|
275
|
-
children: /* @__PURE__ */
|
|
276
|
-
}),
|
|
277
|
-
/* @__PURE__ */ g("div", {
|
|
278
|
-
className: `size-10 rounded-lg flex items-center justify-center text-on-accent text-xl flex-shrink-0 ${n(e.color)}`,
|
|
279
|
-
children: e.icon || /* @__PURE__ */ g(c, { size: 20 })
|
|
270
|
+
children: /* @__PURE__ */ _(u, { size: 20 })
|
|
280
271
|
}),
|
|
281
272
|
/* @__PURE__ */ _("div", {
|
|
273
|
+
className: `size-10 rounded-lg flex items-center justify-center text-on-accent text-xl flex-shrink-0 ${r(e.color)}`,
|
|
274
|
+
children: e.icon || /* @__PURE__ */ _(l, { size: 20 })
|
|
275
|
+
}),
|
|
276
|
+
/* @__PURE__ */ v("div", {
|
|
282
277
|
className: "flex-1 min-w-0",
|
|
283
278
|
children: [
|
|
284
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ v("div", {
|
|
285
280
|
className: "flex items-center gap-2",
|
|
286
|
-
children: [/* @__PURE__ */
|
|
281
|
+
children: [/* @__PURE__ */ _("h3", {
|
|
287
282
|
className: "font-semibold text-text-primary",
|
|
288
283
|
children: e.name
|
|
289
|
-
}), e.isActive === !1 && /* @__PURE__ */
|
|
284
|
+
}), e.isActive === !1 && /* @__PURE__ */ _("span", {
|
|
290
285
|
className: "text-xs px-2 py-0.5 rounded bg-bg-sunken text-text-secondary",
|
|
291
|
-
children: "Inactive"
|
|
286
|
+
children: F("support.settings.categories.inactiveBadge", "Inactive")
|
|
292
287
|
})]
|
|
293
288
|
}),
|
|
294
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ v("p", {
|
|
295
290
|
className: "text-sm text-text-secondary",
|
|
296
291
|
children: [
|
|
297
292
|
"/",
|
|
298
293
|
e.slug,
|
|
299
|
-
" •
|
|
300
|
-
|
|
301
|
-
" articles"
|
|
294
|
+
" •",
|
|
295
|
+
" ",
|
|
296
|
+
F("support.settings.categories.articleCount", "{{count}} articles", { count: e.articleCount ?? 0 })
|
|
302
297
|
]
|
|
303
298
|
}),
|
|
304
|
-
e.description && /* @__PURE__ */
|
|
299
|
+
e.description && /* @__PURE__ */ _("p", {
|
|
305
300
|
className: "text-xs text-text-secondary mt-1 line-clamp-1",
|
|
306
301
|
children: e.description
|
|
307
302
|
})
|
|
308
303
|
]
|
|
309
304
|
}),
|
|
310
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ v("div", {
|
|
311
306
|
className: "flex w-full items-center justify-end gap-1 sm:w-auto",
|
|
312
307
|
children: [
|
|
313
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ _("button", {
|
|
314
309
|
type: "button",
|
|
315
|
-
onClick: () =>
|
|
310
|
+
onClick: () => ce(e),
|
|
316
311
|
className: "min-h-11 min-w-11 p-2 rounded hover:bg-bg-sunken text-text-secondary transition-colors",
|
|
317
|
-
title: e.isActive ? "Deactivate" : "Activate",
|
|
318
|
-
"aria-label": e.isActive ? "Deactivate category" : "Activate category",
|
|
319
|
-
children: e.isActive ? /* @__PURE__ */
|
|
312
|
+
title: e.isActive ? F("support.settings.categories.actions.deactivate", "Deactivate") : F("support.settings.categories.actions.activate", "Activate"),
|
|
313
|
+
"aria-label": e.isActive ? F("support.settings.categories.aria.deactivate", "Deactivate category") : F("support.settings.categories.aria.activate", "Activate category"),
|
|
314
|
+
children: e.isActive ? /* @__PURE__ */ _(m, {
|
|
320
315
|
size: 20,
|
|
321
316
|
className: "text-status-success-text"
|
|
322
|
-
}) : /* @__PURE__ */
|
|
317
|
+
}) : /* @__PURE__ */ _(p, { size: 20 })
|
|
323
318
|
}),
|
|
324
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ _("button", {
|
|
325
320
|
type: "button",
|
|
326
|
-
onClick: () =>
|
|
321
|
+
onClick: () => re(e),
|
|
327
322
|
className: "min-h-11 min-w-11 p-2 rounded hover:bg-bg-sunken text-text-secondary transition-colors",
|
|
328
|
-
title: "Edit category",
|
|
329
|
-
"aria-label": "Edit category",
|
|
330
|
-
children: /* @__PURE__ */
|
|
323
|
+
title: F("support.settings.categories.actions.edit", "Edit category"),
|
|
324
|
+
"aria-label": F("support.settings.categories.aria.edit", "Edit category"),
|
|
325
|
+
children: /* @__PURE__ */ _(c, { size: 18 })
|
|
331
326
|
}),
|
|
332
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ _("button", {
|
|
333
328
|
type: "button",
|
|
334
|
-
onClick: () => e.id &&
|
|
335
|
-
disabled:
|
|
329
|
+
onClick: () => e.id && oe(e.id, e.articleCount ?? 0),
|
|
330
|
+
disabled: W === e.id,
|
|
336
331
|
className: "min-h-11 min-w-11 p-2 rounded hover:bg-bg-sunken text-status-error-text transition-colors disabled:opacity-50",
|
|
337
|
-
title: "Delete category",
|
|
338
|
-
"aria-label": "Delete category",
|
|
339
|
-
children:
|
|
332
|
+
title: F("support.settings.categories.actions.delete", "Delete category"),
|
|
333
|
+
"aria-label": F("support.settings.categories.aria.delete", "Delete category"),
|
|
334
|
+
children: W === e.id ? /* @__PURE__ */ _(d, {
|
|
340
335
|
size: 18,
|
|
341
336
|
className: "animate-spin"
|
|
342
|
-
}) : /* @__PURE__ */
|
|
337
|
+
}) : /* @__PURE__ */ _(h, { size: 18 })
|
|
343
338
|
})
|
|
344
339
|
]
|
|
345
340
|
})
|
|
346
341
|
]
|
|
347
|
-
}, e.id)), j.length === 0 && /* @__PURE__ */
|
|
342
|
+
}, e.id)), j.length === 0 && /* @__PURE__ */ v("div", {
|
|
348
343
|
className: "text-center py-12 border border-dashed border-border-subtle rounded-lg",
|
|
349
344
|
children: [
|
|
350
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ _(l, {
|
|
351
346
|
size: 48,
|
|
352
347
|
className: "text-text-secondary mx-auto"
|
|
353
348
|
}),
|
|
354
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ _("p", {
|
|
355
350
|
className: "mt-4 text-text-secondary",
|
|
356
|
-
children: "No categories configured"
|
|
351
|
+
children: F("support.settings.categories.empty.title", "No categories configured")
|
|
357
352
|
}),
|
|
358
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ _("button", {
|
|
359
354
|
type: "button",
|
|
360
|
-
onClick:
|
|
355
|
+
onClick: Q,
|
|
361
356
|
className: "mt-4 text-primary hover:underline",
|
|
362
|
-
children: "Create your first category"
|
|
357
|
+
children: F("support.settings.categories.empty.createLink", "Create your first category")
|
|
363
358
|
})
|
|
364
359
|
]
|
|
365
360
|
})]
|
|
366
361
|
}),
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
-
open:
|
|
362
|
+
/* @__PURE__ */ _(y, {
|
|
363
|
+
open: K !== null,
|
|
369
364
|
onOpenChange: (e) => {
|
|
370
|
-
e ||
|
|
365
|
+
e || q(null);
|
|
371
366
|
},
|
|
372
|
-
children: /* @__PURE__ */
|
|
373
|
-
onClick:
|
|
374
|
-
children: "Delete"
|
|
367
|
+
children: /* @__PURE__ */ v(S, { children: [/* @__PURE__ */ v(T, { children: [/* @__PURE__ */ _(E, { children: F("support.settings.categories.deleteDialog.title", "Delete category?") }), /* @__PURE__ */ _(C, { children: F("support.settings.categories.deleteDialog.description", "Are you sure you want to delete this category? This action cannot be undone.") })] }), /* @__PURE__ */ v(w, { children: [/* @__PURE__ */ _(x, { children: F("support.settings.categories.deleteDialog.cancel", "Cancel") }), /* @__PURE__ */ _(b, {
|
|
368
|
+
onClick: se,
|
|
369
|
+
children: F("support.settings.categories.deleteDialog.confirm", "Delete")
|
|
375
370
|
})] })] })
|
|
376
371
|
})
|
|
377
372
|
]
|