@burdenoff/microfe-support 2026.519.1 → 2026.521.1
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/generated/global-operations.js +18 -48
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.js.map +1 -1
- package/dist/index.js +8 -7
- package/dist/node_modules/marked/lib/marked.esm.js +1 -1
- package/dist/support/SupportAdminRoot.js +35 -26
- package/dist/support/SupportAdminRoot.js.map +1 -1
- package/dist/support/SupportUserRoot.js +29 -20
- package/dist/support/SupportUserRoot.js.map +1 -1
- package/dist/support/components/NotificationToast.js +1 -1
- package/dist/support/components/NotificationToast.js.map +1 -1
- package/dist/support/components/analytics/CategoryBreakdown.js +22 -37
- package/dist/support/components/analytics/CategoryBreakdown.js.map +1 -1
- package/dist/support/components/analytics/PriorityBreakdown.js +28 -33
- package/dist/support/components/analytics/PriorityBreakdown.js.map +1 -1
- package/dist/support/components/analytics/TopAgents.js +35 -42
- package/dist/support/components/analytics/TopAgents.js.map +1 -1
- package/dist/support/components/kb/ArticleForm.js +26 -13
- package/dist/support/components/kb/ArticleForm.js.map +1 -1
- package/dist/support/components/settings/CannedResponsesSettings.js +9 -7
- package/dist/support/components/settings/CannedResponsesSettings.js.map +1 -1
- package/dist/support/components/settings/SLAPoliciesSettings.js +10 -8
- package/dist/support/components/settings/SLAPoliciesSettings.js.map +1 -1
- package/dist/support/components/settings/TicketCategoriesSettings.js +169 -168
- package/dist/support/components/settings/TicketCategoriesSettings.js.map +1 -1
- package/dist/support/components/tickets/MessageComposer.js +4 -3
- package/dist/support/components/tickets/MessageComposer.js.map +1 -1
- package/dist/support/components/tickets/MessageThread.js +1 -1
- package/dist/support/components/tickets/MessageThread.js.map +1 -1
- package/dist/support/components/tickets/TicketDetailHeader.js +41 -52
- package/dist/support/components/tickets/TicketDetailHeader.js.map +1 -1
- package/dist/support/components/tickets/TicketHeader.js +70 -80
- package/dist/support/components/tickets/TicketHeader.js.map +1 -1
- package/dist/support/components/tickets/TicketSidebar.js +77 -82
- package/dist/support/components/tickets/TicketSidebar.js.map +1 -1
- package/dist/support/events/rybbit.js +35 -0
- package/dist/support/events/rybbit.js.map +1 -0
- package/dist/support/hooks/useAnalyticsOperations.js +41 -41
- package/dist/support/hooks/useAnalyticsOperations.js.map +1 -1
- package/dist/support/hooks/useKnowledgeBaseOperations.js +50 -52
- package/dist/support/hooks/useKnowledgeBaseOperations.js.map +1 -1
- package/dist/support/hooks/useTicketListOperations.js +51 -0
- package/dist/support/hooks/useTicketListOperations.js.map +1 -0
- package/dist/support/hooks/useTicketOperations.js +74 -109
- package/dist/support/hooks/useTicketOperations.js.map +1 -1
- package/dist/support/index.js +2 -1
- package/dist/support/pages/ArticleDetailAdminPage.js +148 -151
- package/dist/support/pages/ArticleDetailAdminPage.js.map +1 -1
- package/dist/support/pages/ArticleDetailUserPage.js +67 -72
- package/dist/support/pages/ArticleDetailUserPage.js.map +1 -1
- package/dist/support/pages/ContactInquiriesPage.js +128 -123
- package/dist/support/pages/ContactInquiriesPage.js.map +1 -1
- package/dist/support/pages/ContactInquiryDetailPage.js +154 -96
- package/dist/support/pages/ContactInquiryDetailPage.js.map +1 -1
- package/dist/support/pages/CreateArticlePage.js +42 -42
- package/dist/support/pages/CreateArticlePage.js.map +1 -1
- package/dist/support/pages/CreateTicketPage.js +20 -11
- package/dist/support/pages/CreateTicketPage.js.map +1 -1
- package/dist/support/pages/EditArticlePage.js +66 -64
- package/dist/support/pages/EditArticlePage.js.map +1 -1
- package/dist/support/pages/KnowledgeBaseAdminPage.js +80 -85
- package/dist/support/pages/KnowledgeBaseAdminPage.js.map +1 -1
- package/dist/support/pages/KnowledgeBaseUserPage.js +73 -78
- package/dist/support/pages/KnowledgeBaseUserPage.js.map +1 -1
- package/dist/support/pages/SettingsPage.js +3 -3
- package/dist/support/pages/SettingsPage.js.map +1 -1
- package/dist/support/pages/TicketDetailAdminPage.js +28 -21
- package/dist/support/pages/TicketDetailAdminPage.js.map +1 -1
- package/dist/support/pages/TicketDetailUserPage.js +121 -111
- package/dist/support/pages/TicketDetailUserPage.js.map +1 -1
- package/dist/support/pages/TicketListPage.js +170 -196
- package/dist/support/pages/TicketListPage.js.map +1 -1
- package/dist/support/store/supportStore.js +43 -34
- package/dist/support/store/supportStore.js.map +1 -1
- package/dist/support/utils/categoryColors.js +64 -0
- package/dist/support/utils/categoryColors.js.map +1 -0
- package/dist/support/utils/index.js +38 -26
- package/dist/support/utils/index.js.map +1 -1
- package/dist/support/utils/ticketFilters.js +43 -0
- package/dist/support/utils/ticketFilters.js.map +1 -0
- package/dist/support/utils/uiTokens.js +44 -0
- package/dist/support/utils/uiTokens.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,242 +1,241 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { CATEGORY_COLOR_OPTIONS as e, getCategoryColorOption as t, getCategorySwatchClass as n } from "../../utils/categoryColors.js";
|
|
2
|
+
import { useEffect as r, useRef as i, useState as a } from "react";
|
|
3
|
+
import { AlertCircle as o, 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, X as g } from "lucide-react";
|
|
4
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
4
5
|
//#region src/support/components/settings/TicketCategoriesSettings.tsx
|
|
5
|
-
var
|
|
6
|
-
"#ef4444",
|
|
7
|
-
"#f97316",
|
|
8
|
-
"#eab308",
|
|
9
|
-
"#22c55e",
|
|
10
|
-
"#14b8a6",
|
|
11
|
-
"#3b82f6",
|
|
12
|
-
"#8b5cf6",
|
|
13
|
-
"#ec4899",
|
|
14
|
-
"#6b7280"
|
|
15
|
-
], g = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, ""), _ = {
|
|
6
|
+
var b = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, ""), x = {
|
|
16
7
|
name: "",
|
|
17
8
|
slug: "",
|
|
18
9
|
description: "",
|
|
19
|
-
color:
|
|
10
|
+
color: e[0].value,
|
|
20
11
|
icon: "",
|
|
21
12
|
isActive: !0
|
|
22
13
|
};
|
|
23
|
-
function
|
|
24
|
-
let [
|
|
25
|
-
|
|
14
|
+
function S({ categories: S, onCreate: C, onUpdate: w, onDelete: T }) {
|
|
15
|
+
let [E, D] = a(!1), [O, k] = a(null), [A, j] = a(x), [M, N] = a(!1), [P, F] = a(null), [I, L] = a(null), R = i(null);
|
|
16
|
+
r(() => () => {
|
|
17
|
+
R.current && clearTimeout(R.current);
|
|
18
|
+
}, []);
|
|
19
|
+
let z = (e, t) => {
|
|
20
|
+
L({
|
|
26
21
|
type: e,
|
|
27
22
|
message: t
|
|
28
|
-
}), setTimeout(() =>
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
|
|
23
|
+
}), R.current && clearTimeout(R.current), R.current = setTimeout(() => L(null), 3e3);
|
|
24
|
+
}, B = () => {
|
|
25
|
+
k(null), j(x), D(!0);
|
|
26
|
+
}, V = (e) => {
|
|
27
|
+
k(e), j({
|
|
33
28
|
name: e.name,
|
|
34
29
|
slug: e.slug,
|
|
35
30
|
description: e.description || "",
|
|
36
|
-
color: e.color
|
|
31
|
+
color: t(e.color).value,
|
|
37
32
|
icon: e.icon || "",
|
|
38
33
|
isActive: e.isActive ?? !0,
|
|
39
34
|
parentId: e.parentId
|
|
40
|
-
}),
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
...
|
|
35
|
+
}), D(!0);
|
|
36
|
+
}, H = () => {
|
|
37
|
+
D(!1), k(null), j(x);
|
|
38
|
+
}, U = (e) => {
|
|
39
|
+
j({
|
|
40
|
+
...A,
|
|
46
41
|
name: e,
|
|
47
|
-
slug:
|
|
42
|
+
slug: O ? A.slug : b(e)
|
|
48
43
|
});
|
|
49
|
-
},
|
|
50
|
-
if (e.preventDefault(), !(!
|
|
51
|
-
|
|
44
|
+
}, W = async (e) => {
|
|
45
|
+
if (e.preventDefault(), !(!A.name.trim() || !A.slug.trim())) {
|
|
46
|
+
N(!0);
|
|
52
47
|
try {
|
|
53
|
-
|
|
48
|
+
O?.id ? (await w(O.id, A), z("success", "Category updated successfully!")) : (await C(A), z("success", "Category created successfully!")), H();
|
|
54
49
|
} catch {
|
|
55
|
-
|
|
50
|
+
z("error", `Failed to ${O ? "update" : "create"} category.`);
|
|
56
51
|
} finally {
|
|
57
|
-
|
|
52
|
+
N(!1);
|
|
58
53
|
}
|
|
59
54
|
}
|
|
60
|
-
},
|
|
55
|
+
}, G = async (e, t) => {
|
|
61
56
|
if (t > 0) {
|
|
62
|
-
|
|
57
|
+
z("error", `Cannot delete category with ${t} articles. Move articles first.`);
|
|
63
58
|
return;
|
|
64
59
|
}
|
|
65
60
|
if (confirm("Are you sure you want to delete this category?")) {
|
|
66
|
-
|
|
61
|
+
F(e);
|
|
67
62
|
try {
|
|
68
|
-
await
|
|
63
|
+
await T(e), z("success", "Category deleted successfully!");
|
|
69
64
|
} catch {
|
|
70
|
-
|
|
65
|
+
z("error", "Failed to delete category.");
|
|
71
66
|
} finally {
|
|
72
|
-
|
|
67
|
+
F(null);
|
|
73
68
|
}
|
|
74
69
|
}
|
|
75
|
-
},
|
|
70
|
+
}, K = async (e) => {
|
|
76
71
|
if (e.id) try {
|
|
77
|
-
await
|
|
72
|
+
await w(e.id, { isActive: !e.isActive }), z("success", `Category ${e.isActive ? "deactivated" : "activated"} successfully!`);
|
|
78
73
|
} catch {
|
|
79
|
-
|
|
74
|
+
z("error", "Failed to update category status.");
|
|
80
75
|
}
|
|
81
|
-
},
|
|
82
|
-
return /* @__PURE__ */
|
|
76
|
+
}, q = [...S].sort((e, t) => (e.displayOrder ?? 0) - (t.displayOrder ?? 0));
|
|
77
|
+
return /* @__PURE__ */ y("div", {
|
|
83
78
|
className: "space-y-6",
|
|
84
79
|
children: [
|
|
85
|
-
|
|
86
|
-
className: `fixed
|
|
87
|
-
children: [
|
|
80
|
+
I && /* @__PURE__ */ y("div", {
|
|
81
|
+
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-300 ${I.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"}`,
|
|
82
|
+
children: [I.type === "success" ? /* @__PURE__ */ v(s, {
|
|
88
83
|
size: 20,
|
|
89
84
|
className: "text-status-success-text"
|
|
90
|
-
}) : /* @__PURE__ */
|
|
85
|
+
}) : /* @__PURE__ */ v(o, {
|
|
91
86
|
size: 20,
|
|
92
87
|
className: "text-destructive"
|
|
93
|
-
}), /* @__PURE__ */
|
|
88
|
+
}), /* @__PURE__ */ v("span", {
|
|
94
89
|
className: "font-medium",
|
|
95
|
-
children:
|
|
90
|
+
children: I.message
|
|
96
91
|
})]
|
|
97
92
|
}),
|
|
98
|
-
|
|
93
|
+
E && /* @__PURE__ */ v("div", {
|
|
99
94
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-overlay",
|
|
100
95
|
role: "dialog",
|
|
101
96
|
"aria-modal": "true",
|
|
102
97
|
"aria-labelledby": "ticket-category-modal-title",
|
|
103
|
-
children: /* @__PURE__ */
|
|
98
|
+
children: /* @__PURE__ */ y("div", {
|
|
104
99
|
className: "bg-background rounded-xl p-6 w-full max-w-lg mx-4 shadow-2xl border max-h-[90vh] overflow-y-auto",
|
|
105
|
-
children: [/* @__PURE__ */
|
|
100
|
+
children: [/* @__PURE__ */ y("div", {
|
|
106
101
|
className: "flex items-center justify-between mb-6",
|
|
107
|
-
children: [/* @__PURE__ */
|
|
102
|
+
children: [/* @__PURE__ */ v("h3", {
|
|
108
103
|
id: "ticket-category-modal-title",
|
|
109
104
|
className: "text-xl font-semibold text-foreground",
|
|
110
|
-
children:
|
|
111
|
-
}), /* @__PURE__ */
|
|
112
|
-
onClick:
|
|
113
|
-
className: "p-2 rounded-lg hover:bg-muted text-muted-foreground",
|
|
114
|
-
|
|
105
|
+
children: O ? "Edit Category" : "Create Category"
|
|
106
|
+
}), /* @__PURE__ */ v("button", {
|
|
107
|
+
onClick: H,
|
|
108
|
+
className: "min-h-11 min-w-11 p-2 rounded-lg hover:bg-muted text-muted-foreground",
|
|
109
|
+
"aria-label": "Close category dialog",
|
|
110
|
+
children: /* @__PURE__ */ v(g, { size: 20 })
|
|
115
111
|
})]
|
|
116
|
-
}), /* @__PURE__ */
|
|
117
|
-
onSubmit:
|
|
112
|
+
}), /* @__PURE__ */ y("form", {
|
|
113
|
+
onSubmit: W,
|
|
118
114
|
className: "space-y-5",
|
|
119
115
|
children: [
|
|
120
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
|
|
121
117
|
className: "block text-sm font-medium text-foreground mb-2",
|
|
122
|
-
children: ["Category Name ", /* @__PURE__ */
|
|
118
|
+
children: ["Category Name ", /* @__PURE__ */ v("span", {
|
|
123
119
|
className: "text-destructive",
|
|
124
120
|
children: "*"
|
|
125
121
|
})]
|
|
126
|
-
}), /* @__PURE__ */
|
|
122
|
+
}), /* @__PURE__ */ v("input", {
|
|
127
123
|
type: "text",
|
|
128
|
-
value:
|
|
129
|
-
onChange: (e) =>
|
|
124
|
+
value: A.name,
|
|
125
|
+
onChange: (e) => U(e.target.value),
|
|
130
126
|
placeholder: "e.g., Technical Support",
|
|
131
127
|
className: "w-full px-4 py-2.5 rounded-lg border border-input bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
|
|
132
128
|
required: !0
|
|
133
129
|
})] }),
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ y("div", { children: [
|
|
131
|
+
/* @__PURE__ */ y("label", {
|
|
136
132
|
className: "block text-sm font-medium text-foreground mb-2",
|
|
137
|
-
children: ["Slug ", /* @__PURE__ */
|
|
133
|
+
children: ["Slug ", /* @__PURE__ */ v("span", {
|
|
138
134
|
className: "text-destructive",
|
|
139
135
|
children: "*"
|
|
140
136
|
})]
|
|
141
137
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ v("input", {
|
|
143
139
|
type: "text",
|
|
144
|
-
value:
|
|
145
|
-
onChange: (e) =>
|
|
146
|
-
...
|
|
140
|
+
value: A.slug,
|
|
141
|
+
onChange: (e) => j({
|
|
142
|
+
...A,
|
|
147
143
|
slug: e.target.value
|
|
148
144
|
}),
|
|
149
145
|
placeholder: "technical-support",
|
|
150
146
|
className: "w-full px-4 py-2.5 rounded-lg border border-input bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
|
|
151
147
|
required: !0
|
|
152
148
|
}),
|
|
153
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ v("p", {
|
|
154
150
|
className: "text-xs text-muted-foreground mt-1",
|
|
155
151
|
children: "URL-friendly identifier (auto-generated from name)"
|
|
156
152
|
})
|
|
157
153
|
] }),
|
|
158
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
159
155
|
className: "block text-sm font-medium text-foreground mb-2",
|
|
160
156
|
children: "Description"
|
|
161
|
-
}), /* @__PURE__ */
|
|
162
|
-
value:
|
|
163
|
-
onChange: (e) =>
|
|
164
|
-
...
|
|
157
|
+
}), /* @__PURE__ */ v("textarea", {
|
|
158
|
+
value: A.description,
|
|
159
|
+
onChange: (e) => j({
|
|
160
|
+
...A,
|
|
165
161
|
description: e.target.value
|
|
166
162
|
}),
|
|
167
163
|
placeholder: "Brief description of this category...",
|
|
168
164
|
rows: 3,
|
|
169
165
|
className: "w-full px-4 py-2.5 rounded-lg border border-input bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary resize-none"
|
|
170
166
|
})] }),
|
|
171
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
172
168
|
className: "block text-sm font-medium text-foreground mb-2",
|
|
173
169
|
children: "Color"
|
|
174
|
-
}), /* @__PURE__ */
|
|
175
|
-
className: "flex
|
|
176
|
-
children: [/* @__PURE__ */
|
|
177
|
-
className: "flex gap-2",
|
|
178
|
-
children:
|
|
170
|
+
}), /* @__PURE__ */ y("div", {
|
|
171
|
+
className: "flex flex-col gap-3 sm:flex-row sm:items-center",
|
|
172
|
+
children: [/* @__PURE__ */ v("div", {
|
|
173
|
+
className: "flex flex-wrap gap-2",
|
|
174
|
+
children: e.map((e) => /* @__PURE__ */ v("button", {
|
|
179
175
|
type: "button",
|
|
180
|
-
onClick: () =>
|
|
181
|
-
...
|
|
182
|
-
color: e
|
|
176
|
+
onClick: () => j({
|
|
177
|
+
...A,
|
|
178
|
+
color: e.value
|
|
183
179
|
}),
|
|
184
|
-
className: `
|
|
185
|
-
|
|
186
|
-
}, e))
|
|
187
|
-
}), /* @__PURE__ */
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
...E,
|
|
180
|
+
className: `min-h-11 min-w-11 rounded-full border-2 transition-all ${e.swatchClass} ${A.color === e.value ? "border-foreground scale-110" : "border-transparent hover:scale-105"}`,
|
|
181
|
+
"aria-label": `Use ${e.label} category color`
|
|
182
|
+
}, e.value))
|
|
183
|
+
}), /* @__PURE__ */ v("select", {
|
|
184
|
+
value: A.color,
|
|
185
|
+
onChange: (e) => j({
|
|
186
|
+
...A,
|
|
192
187
|
color: e.target.value
|
|
193
188
|
}),
|
|
194
|
-
className: "
|
|
189
|
+
className: "min-h-11 rounded-lg border border-input bg-background px-3 text-sm text-foreground",
|
|
190
|
+
children: e.map((e) => /* @__PURE__ */ v("option", {
|
|
191
|
+
value: e.value,
|
|
192
|
+
children: e.label
|
|
193
|
+
}, e.value))
|
|
195
194
|
})]
|
|
196
195
|
})] }),
|
|
197
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
198
197
|
className: "block text-sm font-medium text-foreground mb-2",
|
|
199
198
|
children: "Icon (emoji)"
|
|
200
|
-
}), /* @__PURE__ */
|
|
199
|
+
}), /* @__PURE__ */ v("input", {
|
|
201
200
|
type: "text",
|
|
202
|
-
value:
|
|
203
|
-
onChange: (e) =>
|
|
204
|
-
...
|
|
201
|
+
value: A.icon,
|
|
202
|
+
onChange: (e) => j({
|
|
203
|
+
...A,
|
|
205
204
|
icon: e.target.value
|
|
206
205
|
}),
|
|
207
206
|
placeholder: "e.g., 🛠️",
|
|
208
207
|
className: "w-full px-4 py-2.5 rounded-lg border border-input bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
|
|
209
208
|
maxLength: 4
|
|
210
209
|
})] }),
|
|
211
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ y("label", {
|
|
212
211
|
className: "flex items-center gap-3 cursor-pointer",
|
|
213
|
-
children: [/* @__PURE__ */
|
|
212
|
+
children: [/* @__PURE__ */ v("input", {
|
|
214
213
|
type: "checkbox",
|
|
215
|
-
checked:
|
|
216
|
-
onChange: (e) =>
|
|
217
|
-
...
|
|
214
|
+
checked: A.isActive,
|
|
215
|
+
onChange: (e) => j({
|
|
216
|
+
...A,
|
|
218
217
|
isActive: e.target.checked
|
|
219
218
|
}),
|
|
220
219
|
className: "w-4 h-4 rounded border-input text-primary focus:ring-primary"
|
|
221
|
-
}), /* @__PURE__ */
|
|
220
|
+
}), /* @__PURE__ */ v("span", {
|
|
222
221
|
className: "text-sm text-foreground",
|
|
223
222
|
children: "Active"
|
|
224
223
|
})]
|
|
225
224
|
}),
|
|
226
|
-
/* @__PURE__ */
|
|
227
|
-
className: "flex gap-3 pt-4",
|
|
228
|
-
children: [/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ y("div", {
|
|
226
|
+
className: "flex flex-col gap-3 pt-4 sm:flex-row",
|
|
227
|
+
children: [/* @__PURE__ */ v("button", {
|
|
229
228
|
type: "submit",
|
|
230
|
-
disabled:
|
|
231
|
-
className: "flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
232
|
-
children:
|
|
229
|
+
disabled: M || !A.name.trim() || !A.slug.trim(),
|
|
230
|
+
className: "min-h-11 flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
231
|
+
children: M ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(d, {
|
|
233
232
|
size: 18,
|
|
234
233
|
className: "animate-spin"
|
|
235
|
-
}),
|
|
236
|
-
}), /* @__PURE__ */
|
|
234
|
+
}), O ? "Updating..." : "Creating..."] }) : /* @__PURE__ */ v(_, { children: O ? "Update Category" : "Create Category" })
|
|
235
|
+
}), /* @__PURE__ */ v("button", {
|
|
237
236
|
type: "button",
|
|
238
|
-
onClick:
|
|
239
|
-
className: "px-4 py-2.5 rounded-lg border border-input hover:bg-muted transition-colors",
|
|
237
|
+
onClick: H,
|
|
238
|
+
className: "min-h-11 px-4 py-2.5 rounded-lg border border-input hover:bg-muted transition-colors",
|
|
240
239
|
children: "Cancel"
|
|
241
240
|
})]
|
|
242
241
|
})
|
|
@@ -244,48 +243,47 @@ function v({ categories: v, onCreate: y, onUpdate: b, onDelete: x }) {
|
|
|
244
243
|
})]
|
|
245
244
|
})
|
|
246
245
|
}),
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
-
className: "flex items-center justify-between",
|
|
249
|
-
children: [/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ y("div", {
|
|
247
|
+
className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
248
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h2", {
|
|
250
249
|
className: "text-xl font-semibold mb-2 text-foreground",
|
|
251
250
|
children: "Ticket Categories"
|
|
252
|
-
}), /* @__PURE__ */
|
|
251
|
+
}), /* @__PURE__ */ v("p", {
|
|
253
252
|
className: "text-sm text-muted-foreground",
|
|
254
253
|
children: "Organize tickets and knowledge base articles by category"
|
|
255
|
-
})] }), /* @__PURE__ */
|
|
256
|
-
onClick:
|
|
257
|
-
className: "flex items-center gap-2 px-4 py-2 rounded-lg transition-colors bg-primary text-primary-foreground hover:bg-primary/90",
|
|
258
|
-
children: [/* @__PURE__ */
|
|
254
|
+
})] }), /* @__PURE__ */ y("button", {
|
|
255
|
+
onClick: B,
|
|
256
|
+
className: "min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg transition-colors bg-primary text-primary-foreground hover:bg-primary/90",
|
|
257
|
+
children: [/* @__PURE__ */ v(f, { size: 20 }), "New Category"]
|
|
259
258
|
})]
|
|
260
259
|
}),
|
|
261
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ y("div", {
|
|
262
261
|
className: "space-y-2",
|
|
263
|
-
children: [
|
|
264
|
-
className: `p-4 rounded-lg border bg-background flex
|
|
262
|
+
children: [q.map((e) => /* @__PURE__ */ y("div", {
|
|
263
|
+
className: `p-4 rounded-lg border bg-background flex flex-col gap-4 sm:flex-row sm:items-center ${e.isActive === !1 ? "border-border/50 opacity-60" : "border-border"}`,
|
|
265
264
|
children: [
|
|
266
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ v("div", {
|
|
267
266
|
className: "text-muted-foreground cursor-grab",
|
|
268
|
-
children: /* @__PURE__ */
|
|
267
|
+
children: /* @__PURE__ */ v(u, { size: 20 })
|
|
269
268
|
}),
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
className:
|
|
272
|
-
|
|
273
|
-
children: e.icon || /* @__PURE__ */ p(i, { size: 20 })
|
|
269
|
+
/* @__PURE__ */ v("div", {
|
|
270
|
+
className: `w-10 h-10 rounded-lg flex items-center justify-center text-on-accent text-xl flex-shrink-0 ${n(e.color)}`,
|
|
271
|
+
children: e.icon || /* @__PURE__ */ v(l, { size: 20 })
|
|
274
272
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ y("div", {
|
|
276
274
|
className: "flex-1 min-w-0",
|
|
277
275
|
children: [
|
|
278
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ y("div", {
|
|
279
277
|
className: "flex items-center gap-2",
|
|
280
|
-
children: [/* @__PURE__ */
|
|
278
|
+
children: [/* @__PURE__ */ v("h3", {
|
|
281
279
|
className: "font-semibold text-foreground",
|
|
282
280
|
children: e.name
|
|
283
|
-
}), e.isActive === !1 && /* @__PURE__ */
|
|
281
|
+
}), e.isActive === !1 && /* @__PURE__ */ v("span", {
|
|
284
282
|
className: "text-xs px-2 py-0.5 rounded bg-muted text-muted-foreground",
|
|
285
283
|
children: "Inactive"
|
|
286
284
|
})]
|
|
287
285
|
}),
|
|
288
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ y("p", {
|
|
289
287
|
className: "text-sm text-muted-foreground",
|
|
290
288
|
children: [
|
|
291
289
|
"/",
|
|
@@ -295,56 +293,59 @@ function v({ categories: v, onCreate: y, onUpdate: b, onDelete: x }) {
|
|
|
295
293
|
" articles"
|
|
296
294
|
]
|
|
297
295
|
}),
|
|
298
|
-
e.description && /* @__PURE__ */
|
|
296
|
+
e.description && /* @__PURE__ */ v("p", {
|
|
299
297
|
className: "text-xs text-muted-foreground mt-1 line-clamp-1",
|
|
300
298
|
children: e.description
|
|
301
299
|
})
|
|
302
300
|
]
|
|
303
301
|
}),
|
|
304
|
-
/* @__PURE__ */
|
|
305
|
-
className: "flex items-center gap-1",
|
|
302
|
+
/* @__PURE__ */ y("div", {
|
|
303
|
+
className: "flex w-full items-center justify-end gap-1 sm:w-auto",
|
|
306
304
|
children: [
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
onClick: () =>
|
|
309
|
-
className: "p-2 rounded hover:bg-muted text-muted-foreground transition-colors",
|
|
305
|
+
/* @__PURE__ */ v("button", {
|
|
306
|
+
onClick: () => K(e),
|
|
307
|
+
className: "min-h-11 min-w-11 p-2 rounded hover:bg-muted text-muted-foreground transition-colors",
|
|
310
308
|
title: e.isActive ? "Deactivate" : "Activate",
|
|
311
|
-
|
|
309
|
+
"aria-label": e.isActive ? "Deactivate category" : "Activate category",
|
|
310
|
+
children: e.isActive ? /* @__PURE__ */ v(m, {
|
|
312
311
|
size: 20,
|
|
313
312
|
className: "text-status-success-text"
|
|
314
|
-
}) : /* @__PURE__ */ p
|
|
313
|
+
}) : /* @__PURE__ */ v(p, { size: 20 })
|
|
315
314
|
}),
|
|
316
|
-
/* @__PURE__ */
|
|
317
|
-
onClick: () =>
|
|
318
|
-
className: "p-2 rounded hover:bg-muted text-muted-foreground transition-colors",
|
|
315
|
+
/* @__PURE__ */ v("button", {
|
|
316
|
+
onClick: () => V(e),
|
|
317
|
+
className: "min-h-11 min-w-11 p-2 rounded hover:bg-muted text-muted-foreground transition-colors",
|
|
319
318
|
title: "Edit category",
|
|
320
|
-
|
|
319
|
+
"aria-label": "Edit category",
|
|
320
|
+
children: /* @__PURE__ */ v(c, { size: 18 })
|
|
321
321
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
onClick: () => e.id &&
|
|
324
|
-
disabled:
|
|
325
|
-
className: "p-2 rounded hover:bg-muted text-status-error-text transition-colors disabled:opacity-50",
|
|
322
|
+
/* @__PURE__ */ v("button", {
|
|
323
|
+
onClick: () => e.id && G(e.id, e.articleCount ?? 0),
|
|
324
|
+
disabled: P === e.id,
|
|
325
|
+
className: "min-h-11 min-w-11 p-2 rounded hover:bg-muted text-status-error-text transition-colors disabled:opacity-50",
|
|
326
326
|
title: "Delete category",
|
|
327
|
-
|
|
327
|
+
"aria-label": "Delete category",
|
|
328
|
+
children: P === e.id ? /* @__PURE__ */ v(d, {
|
|
328
329
|
size: 18,
|
|
329
330
|
className: "animate-spin"
|
|
330
|
-
}) : /* @__PURE__ */
|
|
331
|
+
}) : /* @__PURE__ */ v(h, { size: 18 })
|
|
331
332
|
})
|
|
332
333
|
]
|
|
333
334
|
})
|
|
334
335
|
]
|
|
335
|
-
}, e.id)),
|
|
336
|
+
}, e.id)), S.length === 0 && /* @__PURE__ */ y("div", {
|
|
336
337
|
className: "text-center py-12 border border-dashed border-border rounded-lg",
|
|
337
338
|
children: [
|
|
338
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ v(l, {
|
|
339
340
|
size: 48,
|
|
340
341
|
className: "text-muted-foreground mx-auto"
|
|
341
342
|
}),
|
|
342
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ v("p", {
|
|
343
344
|
className: "mt-4 text-muted-foreground",
|
|
344
345
|
children: "No categories configured"
|
|
345
346
|
}),
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
onClick:
|
|
347
|
+
/* @__PURE__ */ v("button", {
|
|
348
|
+
onClick: B,
|
|
348
349
|
className: "mt-4 text-primary hover:underline",
|
|
349
350
|
children: "Create your first category"
|
|
350
351
|
})
|
|
@@ -355,6 +356,6 @@ function v({ categories: v, onCreate: y, onUpdate: b, onDelete: x }) {
|
|
|
355
356
|
});
|
|
356
357
|
}
|
|
357
358
|
//#endregion
|
|
358
|
-
export {
|
|
359
|
+
export { S as TicketCategoriesSettings };
|
|
359
360
|
|
|
360
361
|
//# sourceMappingURL=TicketCategoriesSettings.js.map
|