@burdenoff/microfe-support 2026.625.2 → 2026.626.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/support/components/ui.js +2 -2
- package/dist/support/pages/AnalyticsPage.js +144 -113
- package/dist/support/pages/AnalyticsPage.js.map +1 -1
- package/dist/support/pages/ArticleDetailAdminPage.js +150 -113
- package/dist/support/pages/ArticleDetailAdminPage.js.map +1 -1
- package/dist/support/pages/ArticleDetailUserPage.js +90 -83
- package/dist/support/pages/ArticleDetailUserPage.js.map +1 -1
- package/dist/support/pages/ContactInquiriesPage.js +48 -44
- package/dist/support/pages/ContactInquiriesPage.js.map +1 -1
- package/dist/support/pages/ContactInquiryDetailPage.js +225 -205
- package/dist/support/pages/ContactInquiryDetailPage.js.map +1 -1
- package/dist/support/pages/CreateArticlePage.js +50 -46
- package/dist/support/pages/CreateArticlePage.js.map +1 -1
- package/dist/support/pages/CreateTicketPage.js +122 -116
- package/dist/support/pages/CreateTicketPage.js.map +1 -1
- package/dist/support/pages/EditArticlePage.js +76 -80
- package/dist/support/pages/EditArticlePage.js.map +1 -1
- package/dist/support/pages/JobApplicationDetailPage.js +292 -269
- package/dist/support/pages/JobApplicationDetailPage.js.map +1 -1
- package/dist/support/pages/JobApplicationsPage.js +50 -46
- package/dist/support/pages/JobApplicationsPage.js.map +1 -1
- package/dist/support/pages/KnowledgeBaseAdminPage.js +84 -81
- package/dist/support/pages/KnowledgeBaseAdminPage.js.map +1 -1
- package/dist/support/pages/KnowledgeBaseUserPage.js +76 -75
- package/dist/support/pages/KnowledgeBaseUserPage.js.map +1 -1
- package/dist/support/pages/SettingsPage.js +215 -182
- package/dist/support/pages/SettingsPage.js.map +1 -1
- package/dist/support/pages/TicketDetailAdminPage.js +158 -128
- package/dist/support/pages/TicketDetailAdminPage.js.map +1 -1
- package/dist/support/pages/TicketDetailUserPage.js +174 -141
- package/dist/support/pages/TicketDetailUserPage.js.map +1 -1
- package/dist/support/pages/TicketListPage.js +171 -170
- package/dist/support/pages/TicketListPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,166 +1,166 @@
|
|
|
1
1
|
import { useSupport as e } from "../providers/SupportProvider.js";
|
|
2
|
-
import { Badge as t, Button as n, CTAOverflowMenu as ee } from "../components/ui.js";
|
|
3
|
-
import { EmptyState as
|
|
4
|
-
import { getCategoryBadgeClass as
|
|
5
|
-
import { useKnowledgeBaseOperations as
|
|
6
|
-
import { purify as
|
|
7
|
-
import { nativeConfirm as
|
|
2
|
+
import { Badge as t, Button as n, CTAOverflowMenu as r, EmphasisPanel as ee, NextSteps as te } from "../components/ui.js";
|
|
3
|
+
import { EmptyState as ne, LoadingState as i, PageLayout as a } from "../components/PageLayout.js";
|
|
4
|
+
import { getCategoryBadgeClass as o } from "../utils/categoryColors.js";
|
|
5
|
+
import { useKnowledgeBaseOperations as re } from "../hooks/useKnowledgeBaseOperations.js";
|
|
6
|
+
import { purify as ie } from "../../node_modules/dompurify/dist/purify.es.js";
|
|
7
|
+
import { nativeConfirm as ae, nativeImpact as oe, nativeNotify as s } from "../../utils/nativeBridge.js";
|
|
8
8
|
import { useEffect as c, useRef as l, useState as u } from "react";
|
|
9
|
-
import { AlertCircle as
|
|
10
|
-
import { useNavigate as
|
|
9
|
+
import { AlertCircle as d, Archive as f, ArrowLeft as p, Calendar as m, CheckCircle as h, Edit as g, Eye as se, Globe as _, GlobeLock as v, Loader2 as y, Tag as ce, ThumbsDown as le, ThumbsUp as ue, Trash2 as b, User as de } from "lucide-react";
|
|
10
|
+
import { useNavigate as fe, useParams as pe } from "react-router-dom";
|
|
11
11
|
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
12
|
-
import { AlertDialog as
|
|
12
|
+
import { AlertDialog as me, AlertDialogAction as he, AlertDialogCancel as w, AlertDialogContent as T, AlertDialogDescription as E, AlertDialogFooter as D, AlertDialogHeader as O, AlertDialogTitle as k } from "@burdenoff/fe-libs/ui";
|
|
13
13
|
//#region src/support/pages/ArticleDetailAdminPage.tsx
|
|
14
14
|
function A() {
|
|
15
|
-
let { slug: A } =
|
|
15
|
+
let { slug: A } = pe(), j = fe(), { basePath: M = "" } = e(), { articleDetail: N, articleLoading: P, articleError: F, voteArticle: I, recordView: L, ratingArticle: R, deleteArticle: ge, publishArticle: _e, unpublishArticle: ve, archiveArticle: ye, deletingArticle: z, publishingArticle: B, unpublishingArticle: V, archivingArticle: H } = re(A), [be, U] = u(!1), [W, G] = u(null), K = l(null), q = l(null);
|
|
16
16
|
c(() => {
|
|
17
17
|
N?.id && L(N.id);
|
|
18
18
|
}, [N?.id, L]), c(() => () => {
|
|
19
|
-
|
|
19
|
+
K.current && clearTimeout(K.current), q.current && clearTimeout(q.current);
|
|
20
20
|
}, []);
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
},
|
|
21
|
+
let J = () => {
|
|
22
|
+
q.current && clearTimeout(q.current), q.current = setTimeout(() => G(null), 3e3);
|
|
23
|
+
}, xe = (e) => {
|
|
24
|
+
K.current && clearTimeout(K.current), K.current = setTimeout(() => j(e), 1e3);
|
|
25
|
+
}, Y = async (e) => {
|
|
26
26
|
if (N) try {
|
|
27
27
|
await I(N.id, e);
|
|
28
28
|
} catch (e) {
|
|
29
29
|
console.error("Failed to vote:", e);
|
|
30
30
|
}
|
|
31
|
-
},
|
|
31
|
+
}, X = async () => {
|
|
32
32
|
if (N) {
|
|
33
33
|
try {
|
|
34
|
-
await
|
|
34
|
+
await ge(N.id), G({
|
|
35
35
|
type: "success",
|
|
36
36
|
message: "Article deleted successfully!"
|
|
37
|
-
}), s("success"),
|
|
37
|
+
}), s("success"), xe(`${M}/kb`);
|
|
38
38
|
} catch {
|
|
39
|
-
|
|
39
|
+
G({
|
|
40
40
|
type: "error",
|
|
41
41
|
message: "Failed to delete article."
|
|
42
|
-
}), s("error"),
|
|
42
|
+
}), s("error"), J();
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
U(!1);
|
|
45
45
|
}
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
let e = await
|
|
46
|
+
}, Se = async () => {
|
|
47
|
+
oe("medium");
|
|
48
|
+
let e = await ae({
|
|
49
49
|
title: "Delete Article",
|
|
50
50
|
message: "Delete this article? This cannot be undone.",
|
|
51
51
|
okButtonTitle: "Delete",
|
|
52
52
|
cancelButtonTitle: "Cancel"
|
|
53
53
|
});
|
|
54
54
|
if (e === null) {
|
|
55
|
-
|
|
55
|
+
U(!0);
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
|
-
e && await
|
|
59
|
-
},
|
|
58
|
+
e && await X();
|
|
59
|
+
}, Z = async () => {
|
|
60
60
|
if (N) try {
|
|
61
|
-
await
|
|
61
|
+
await _e(N.id), G({
|
|
62
62
|
type: "success",
|
|
63
63
|
message: "Article published successfully!"
|
|
64
|
-
}),
|
|
64
|
+
}), J();
|
|
65
65
|
} catch {
|
|
66
|
-
|
|
66
|
+
G({
|
|
67
67
|
type: "error",
|
|
68
68
|
message: "Failed to publish article."
|
|
69
|
-
}),
|
|
69
|
+
}), J();
|
|
70
70
|
}
|
|
71
|
-
},
|
|
71
|
+
}, Q = async () => {
|
|
72
72
|
if (N) try {
|
|
73
|
-
await
|
|
73
|
+
await ve(N.id), G({
|
|
74
74
|
type: "success",
|
|
75
75
|
message: "Article unpublished."
|
|
76
|
-
}),
|
|
76
|
+
}), J();
|
|
77
77
|
} catch {
|
|
78
|
-
|
|
78
|
+
G({
|
|
79
79
|
type: "error",
|
|
80
80
|
message: "Failed to unpublish article."
|
|
81
|
-
}),
|
|
81
|
+
}), J();
|
|
82
82
|
}
|
|
83
|
-
},
|
|
83
|
+
}, Ce = async () => {
|
|
84
84
|
if (N) try {
|
|
85
|
-
await
|
|
85
|
+
await ye(N.id), G({
|
|
86
86
|
type: "success",
|
|
87
87
|
message: "Article archived."
|
|
88
|
-
}),
|
|
88
|
+
}), J();
|
|
89
89
|
} catch {
|
|
90
|
-
|
|
90
|
+
G({
|
|
91
91
|
type: "error",
|
|
92
92
|
message: "Failed to archive article."
|
|
93
|
-
}),
|
|
93
|
+
}), J();
|
|
94
94
|
}
|
|
95
|
-
}, $ =
|
|
95
|
+
}, $ = z || B || V || H, we = [
|
|
96
96
|
...N?.status === "DRAFT" ? [{
|
|
97
97
|
label: "Publish",
|
|
98
|
-
icon:
|
|
98
|
+
icon: B ? /* @__PURE__ */ S(y, {
|
|
99
99
|
size: 16,
|
|
100
100
|
className: "animate-spin"
|
|
101
101
|
}) : /* @__PURE__ */ S(_, { size: 16 }),
|
|
102
|
-
onSelect: () => void
|
|
102
|
+
onSelect: () => void Z(),
|
|
103
103
|
disabled: $
|
|
104
104
|
}] : [],
|
|
105
105
|
...N?.status === "PUBLISHED" ? [{
|
|
106
106
|
label: "Unpublish",
|
|
107
|
-
icon:
|
|
107
|
+
icon: V ? /* @__PURE__ */ S(y, {
|
|
108
108
|
size: 16,
|
|
109
109
|
className: "animate-spin"
|
|
110
110
|
}) : /* @__PURE__ */ S(v, { size: 16 }),
|
|
111
|
-
onSelect: () => void
|
|
111
|
+
onSelect: () => void Q(),
|
|
112
112
|
disabled: $
|
|
113
113
|
}, {
|
|
114
114
|
label: "Archive",
|
|
115
|
-
icon:
|
|
115
|
+
icon: H ? /* @__PURE__ */ S(y, {
|
|
116
116
|
size: 16,
|
|
117
117
|
className: "animate-spin"
|
|
118
|
-
}) : /* @__PURE__ */ S(
|
|
119
|
-
onSelect: () => void
|
|
118
|
+
}) : /* @__PURE__ */ S(f, { size: 16 }),
|
|
119
|
+
onSelect: () => void Ce(),
|
|
120
120
|
disabled: $
|
|
121
121
|
}] : [],
|
|
122
122
|
{
|
|
123
123
|
label: "Delete",
|
|
124
124
|
icon: /* @__PURE__ */ S(b, { size: 16 }),
|
|
125
125
|
intent: "destructive",
|
|
126
|
-
onSelect: () => void
|
|
126
|
+
onSelect: () => void Se(),
|
|
127
127
|
disabled: $
|
|
128
128
|
}
|
|
129
129
|
];
|
|
130
|
-
return P ? /* @__PURE__ */ S(
|
|
130
|
+
return P ? /* @__PURE__ */ S(a, {
|
|
131
131
|
showHeader: !1,
|
|
132
|
-
children: /* @__PURE__ */ S(
|
|
133
|
-
}) : F || !N ? /* @__PURE__ */ S(
|
|
132
|
+
children: /* @__PURE__ */ S(i, { message: "Loading article…" })
|
|
133
|
+
}) : F || !N ? /* @__PURE__ */ S(a, {
|
|
134
134
|
showHeader: !1,
|
|
135
|
-
children: /* @__PURE__ */ S(
|
|
135
|
+
children: /* @__PURE__ */ S(ne, {
|
|
136
136
|
illustration: "empty-search",
|
|
137
137
|
title: "Article not found",
|
|
138
138
|
description: "The article you're looking for doesn't exist or has been removed.",
|
|
139
139
|
action: /* @__PURE__ */ C(n, {
|
|
140
140
|
onClick: () => j(`${M}/kb`),
|
|
141
|
-
children: [/* @__PURE__ */ S(
|
|
141
|
+
children: [/* @__PURE__ */ S(p, { size: 18 }), "Back to Knowledge Base"]
|
|
142
142
|
})
|
|
143
143
|
})
|
|
144
144
|
}) : /* @__PURE__ */ C("div", {
|
|
145
145
|
className: "flex flex-col h-full",
|
|
146
146
|
children: [
|
|
147
|
-
|
|
148
|
-
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 ${
|
|
149
|
-
children: [
|
|
147
|
+
W && /* @__PURE__ */ C("div", {
|
|
148
|
+
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 ${W.type === "success" ? "bg-success/10 text-success border-success/30" : "bg-error/10 text-error border-error/30"}`,
|
|
149
|
+
children: [W.type === "success" ? /* @__PURE__ */ S(h, {
|
|
150
150
|
size: 20,
|
|
151
151
|
className: "text-success"
|
|
152
|
-
}) : /* @__PURE__ */ S(
|
|
152
|
+
}) : /* @__PURE__ */ S(d, {
|
|
153
153
|
size: 20,
|
|
154
154
|
className: "text-error"
|
|
155
155
|
}), /* @__PURE__ */ S("span", {
|
|
156
156
|
className: "font-medium",
|
|
157
|
-
children:
|
|
157
|
+
children: W.message
|
|
158
158
|
})]
|
|
159
159
|
}),
|
|
160
|
-
/* @__PURE__ */ S(
|
|
161
|
-
open:
|
|
160
|
+
/* @__PURE__ */ S(me, {
|
|
161
|
+
open: be,
|
|
162
162
|
onOpenChange: (e) => {
|
|
163
|
-
e ||
|
|
163
|
+
e || U(!1);
|
|
164
164
|
},
|
|
165
165
|
children: /* @__PURE__ */ C(T, {
|
|
166
166
|
className: "max-w-md",
|
|
@@ -168,16 +168,16 @@ function A() {
|
|
|
168
168
|
"Are you sure you want to delete \"",
|
|
169
169
|
N.title,
|
|
170
170
|
"\"? This action cannot be undone."
|
|
171
|
-
] })] }), /* @__PURE__ */ C(D, { children: [/* @__PURE__ */ S(
|
|
171
|
+
] })] }), /* @__PURE__ */ C(D, { children: [/* @__PURE__ */ S(he, {
|
|
172
172
|
asChild: !0,
|
|
173
173
|
children: /* @__PURE__ */ S(n, {
|
|
174
174
|
variant: "destructive",
|
|
175
175
|
onClick: (e) => {
|
|
176
|
-
e.preventDefault(),
|
|
176
|
+
e.preventDefault(), X();
|
|
177
177
|
},
|
|
178
|
-
disabled:
|
|
178
|
+
disabled: z,
|
|
179
179
|
className: "flex-1",
|
|
180
|
-
children:
|
|
180
|
+
children: z ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(y, {
|
|
181
181
|
size: 16,
|
|
182
182
|
className: "animate-spin"
|
|
183
183
|
}), "Deleting…"] }) : /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(b, { size: 16 }), "Delete"] })
|
|
@@ -201,22 +201,22 @@ function A() {
|
|
|
201
201
|
variant: "ghost",
|
|
202
202
|
size: "sm",
|
|
203
203
|
onClick: () => j(`${M}/kb`),
|
|
204
|
-
children: [/* @__PURE__ */ S(
|
|
205
|
-
}), /* @__PURE__ */ S(
|
|
204
|
+
children: [/* @__PURE__ */ S(p, { size: 20 }), "Back to Knowledge Base"]
|
|
205
|
+
}), /* @__PURE__ */ S(r, {
|
|
206
206
|
primary: {
|
|
207
207
|
label: "Edit",
|
|
208
|
-
icon: /* @__PURE__ */ S(
|
|
208
|
+
icon: /* @__PURE__ */ S(g, { size: 16 }),
|
|
209
209
|
onSelect: () => j("edit"),
|
|
210
210
|
disabled: $
|
|
211
211
|
},
|
|
212
|
-
actions:
|
|
212
|
+
actions: we
|
|
213
213
|
})]
|
|
214
214
|
}),
|
|
215
215
|
/* @__PURE__ */ C("div", {
|
|
216
216
|
className: "flex items-center gap-3 mb-3",
|
|
217
217
|
children: [N.category && /* @__PURE__ */ S(t, {
|
|
218
218
|
variant: "outline",
|
|
219
|
-
className:
|
|
219
|
+
className: o(N.category.color),
|
|
220
220
|
children: N.category.name
|
|
221
221
|
}), (() => {
|
|
222
222
|
switch (N.status) {
|
|
@@ -236,7 +236,7 @@ function A() {
|
|
|
236
236
|
});
|
|
237
237
|
case "ARCHIVED": return /* @__PURE__ */ C(t, {
|
|
238
238
|
className: "bg-bg-sunken text-tertiary",
|
|
239
|
-
children: [/* @__PURE__ */ S(
|
|
239
|
+
children: [/* @__PURE__ */ S(f, {
|
|
240
240
|
size: 12,
|
|
241
241
|
className: "mr-1"
|
|
242
242
|
}), "Archived"]
|
|
@@ -254,21 +254,21 @@ function A() {
|
|
|
254
254
|
children: [
|
|
255
255
|
N.author && /* @__PURE__ */ C("div", {
|
|
256
256
|
className: "flex items-center gap-2",
|
|
257
|
-
children: [/* @__PURE__ */ S(
|
|
257
|
+
children: [/* @__PURE__ */ S(de, { size: 16 }), /* @__PURE__ */ S("span", { children: N.author.name })]
|
|
258
258
|
}),
|
|
259
259
|
N.publishedAt && /* @__PURE__ */ C("div", {
|
|
260
260
|
className: "flex items-center gap-2",
|
|
261
|
-
children: [/* @__PURE__ */ S(
|
|
261
|
+
children: [/* @__PURE__ */ S(m, { size: 16 }), /* @__PURE__ */ S("span", { children: new Date(N.publishedAt).toLocaleDateString() })]
|
|
262
262
|
}),
|
|
263
263
|
/* @__PURE__ */ C("div", {
|
|
264
264
|
className: "flex items-center gap-2",
|
|
265
|
-
children: [/* @__PURE__ */ S(
|
|
265
|
+
children: [/* @__PURE__ */ S(se, { size: 16 }), /* @__PURE__ */ C("span", { children: [N.viewCount, " views"] })]
|
|
266
266
|
})
|
|
267
267
|
]
|
|
268
268
|
}),
|
|
269
269
|
N.tags && N.tags.length > 0 && /* @__PURE__ */ C("div", {
|
|
270
270
|
className: "flex flex-wrap items-center gap-2 mt-4",
|
|
271
|
-
children: [/* @__PURE__ */ S(
|
|
271
|
+
children: [/* @__PURE__ */ S(ce, {
|
|
272
272
|
size: 16,
|
|
273
273
|
className: "text-text-secondary"
|
|
274
274
|
}), N.tags.map((e) => /* @__PURE__ */ S(t, {
|
|
@@ -281,47 +281,84 @@ function A() {
|
|
|
281
281
|
}),
|
|
282
282
|
/* @__PURE__ */ S("div", {
|
|
283
283
|
className: "flex-1 overflow-y-auto p-4 sm:p-6",
|
|
284
|
-
children: /* @__PURE__ */
|
|
284
|
+
children: /* @__PURE__ */ C("div", {
|
|
285
285
|
className: "max-w-4xl mx-auto",
|
|
286
|
-
children: /* @__PURE__ */ S(
|
|
286
|
+
children: [/* @__PURE__ */ S(te, {
|
|
287
|
+
storageKey: "support-article-detail-admin",
|
|
288
|
+
title: "Manage this article",
|
|
289
|
+
className: "mb-6",
|
|
290
|
+
steps: [
|
|
291
|
+
{
|
|
292
|
+
id: "edit",
|
|
293
|
+
label: "Edit the article",
|
|
294
|
+
description: "Update the content, category or tags.",
|
|
295
|
+
onClick: () => j("edit")
|
|
296
|
+
},
|
|
297
|
+
...N.status === "DRAFT" ? [{
|
|
298
|
+
id: "publish",
|
|
299
|
+
label: "Publish it",
|
|
300
|
+
description: "Make this article visible to customers.",
|
|
301
|
+
onClick: () => void Z()
|
|
302
|
+
}] : [{
|
|
303
|
+
id: "unpublish",
|
|
304
|
+
label: "Unpublish or archive",
|
|
305
|
+
description: "Hide it from customers while you revise.",
|
|
306
|
+
onClick: () => void Q(),
|
|
307
|
+
done: N.status === "ARCHIVED"
|
|
308
|
+
}],
|
|
309
|
+
{
|
|
310
|
+
id: "back-kb",
|
|
311
|
+
label: "Back to the knowledge base",
|
|
312
|
+
description: "Return to the full list of articles.",
|
|
313
|
+
onClick: () => j(`${M}/kb`)
|
|
314
|
+
}
|
|
315
|
+
]
|
|
316
|
+
}), /* @__PURE__ */ S("div", {
|
|
287
317
|
className: "prose prose-lg max-w-none dark:prose-invert text-text-primary",
|
|
288
|
-
dangerouslySetInnerHTML: { __html:
|
|
289
|
-
})
|
|
318
|
+
dangerouslySetInnerHTML: { __html: ie.sanitize(N.content) }
|
|
319
|
+
})]
|
|
290
320
|
})
|
|
291
321
|
}),
|
|
292
322
|
/* @__PURE__ */ S("div", {
|
|
293
323
|
className: "border-t border-border-subtle bg-bg-surface p-4 sm:p-6",
|
|
294
|
-
children: /* @__PURE__ */ C(
|
|
295
|
-
className: "max-w-4xl mx-auto",
|
|
296
|
-
children: [
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
324
|
+
children: /* @__PURE__ */ C(ee, {
|
|
325
|
+
className: "max-w-4xl mx-auto p-5",
|
|
326
|
+
children: [
|
|
327
|
+
/* @__PURE__ */ S("h3", {
|
|
328
|
+
className: "text-lg font-semibold mb-1 text-text-primary",
|
|
329
|
+
children: "Was this article helpful?"
|
|
330
|
+
}),
|
|
331
|
+
/* @__PURE__ */ S("p", {
|
|
332
|
+
className: "mb-4 text-sm text-text-secondary",
|
|
333
|
+
children: "See how readers rate this guide — low scores are a cue to revise it."
|
|
334
|
+
}),
|
|
335
|
+
/* @__PURE__ */ C("div", {
|
|
336
|
+
className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",
|
|
337
|
+
children: [/* @__PURE__ */ C(n, {
|
|
338
|
+
variant: "outline",
|
|
339
|
+
onClick: () => Y(!0),
|
|
340
|
+
disabled: R,
|
|
341
|
+
className: "px-6",
|
|
342
|
+
children: [
|
|
343
|
+
/* @__PURE__ */ S(ue, { size: 20 }),
|
|
344
|
+
"Yes (",
|
|
345
|
+
N.helpfulCount,
|
|
346
|
+
")"
|
|
347
|
+
]
|
|
348
|
+
}), /* @__PURE__ */ C(n, {
|
|
349
|
+
variant: "outline",
|
|
350
|
+
onClick: () => Y(!1),
|
|
351
|
+
disabled: R,
|
|
352
|
+
className: "px-6",
|
|
353
|
+
children: [
|
|
354
|
+
/* @__PURE__ */ S(le, { size: 20 }),
|
|
355
|
+
"No (",
|
|
356
|
+
N.notHelpfulCount,
|
|
357
|
+
")"
|
|
358
|
+
]
|
|
359
|
+
})]
|
|
360
|
+
})
|
|
361
|
+
]
|
|
325
362
|
})
|
|
326
363
|
})
|
|
327
364
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleDetailAdminPage.js","names":[],"sources":["../../../src/support/pages/ArticleDetailAdminPage.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { useParams, useNavigate } from 'react-router-dom';\nimport DOMPurify from 'dompurify';\nimport {\n ArrowLeft,\n ThumbsUp,\n ThumbsDown,\n Eye,\n Calendar,\n User,\n Tag,\n Edit,\n Trash2,\n Globe,\n GlobeLock,\n Archive,\n AlertCircle,\n CheckCircle,\n Loader2,\n} from 'lucide-react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from '@burdenoff/fe-libs/ui';\nimport { Button, Badge, CTAOverflowMenu } from '../components/ui';\nimport type { CTAAction } from '@burdenoff/fe-libs/ui';\nimport { useKnowledgeBaseOperations } from '../hooks/useKnowledgeBaseOperations';\nimport { PageLayout, LoadingState, EmptyState } from '../components/PageLayout';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\nimport { useSupport } from '../providers/SupportProvider';\nimport { getCategoryBadgeClass } from '../utils/categoryColors';\n\n/**\n * Admin-facing article detail page.\n *\n * Full controls: edit, publish, unpublish, archive, delete,\n * status badges, in addition to article content and voting.\n */\nexport function ArticleDetailAdminPage() {\n const { slug } = useParams<{ slug: string }>();\n const navigate = useNavigate();\n const { basePath = '' } = useSupport();\n const {\n articleDetail,\n articleLoading,\n articleError,\n voteArticle,\n recordView,\n ratingArticle,\n deleteArticle,\n publishArticle,\n unpublishArticle,\n archiveArticle,\n deletingArticle,\n publishingArticle,\n unpublishingArticle,\n archivingArticle,\n } = useKnowledgeBaseOperations(slug);\n\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\n const [notification, setNotification] = useState<{\n type: 'success' | 'error';\n message: string;\n } | null>(null);\n const navigateTimerRef = useRef<ReturnType<typeof setTimeout>>(null);\n const notificationTimerRef = useRef<ReturnType<typeof setTimeout>>(null);\n\n useEffect(() => {\n if (articleDetail?.id) {\n recordView(articleDetail.id);\n }\n }, [articleDetail?.id, recordView]);\n\n // Cleanup timers on unmount to avoid state updates on unmounted component\n useEffect(() => {\n return () => {\n if (navigateTimerRef.current) clearTimeout(navigateTimerRef.current);\n if (notificationTimerRef.current) clearTimeout(notificationTimerRef.current);\n };\n }, []);\n\n const scheduleNotificationDismiss = () => {\n if (notificationTimerRef.current) clearTimeout(notificationTimerRef.current);\n notificationTimerRef.current = setTimeout(() => setNotification(null), 3000);\n };\n\n const scheduleNavigate = (path: string) => {\n if (navigateTimerRef.current) clearTimeout(navigateTimerRef.current);\n navigateTimerRef.current = setTimeout(() => navigate(path), 1000);\n };\n\n const handleVote = async (helpful: boolean) => {\n if (!articleDetail) return;\n try {\n await voteArticle(articleDetail.id, helpful);\n } catch (error) {\n console.error('Failed to vote:', error);\n }\n };\n\n const handleDelete = async () => {\n if (!articleDetail) return;\n try {\n await deleteArticle(articleDetail.id);\n setNotification({ type: 'success', message: 'Article deleted successfully!' });\n void nativeNotify('success');\n scheduleNavigate(`${basePath}/kb`);\n } catch {\n setNotification({ type: 'error', message: 'Failed to delete article.' });\n void nativeNotify('error');\n scheduleNotificationDismiss();\n }\n setShowDeleteConfirm(false);\n };\n\n const requestDelete = async () => {\n void nativeImpact('medium');\n const result = await nativeConfirm({\n title: 'Delete Article',\n message: 'Delete this article? This cannot be undone.',\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n if (result === null) {\n setShowDeleteConfirm(true);\n return;\n }\n if (result) {\n await handleDelete();\n }\n };\n\n const handlePublish = async () => {\n if (!articleDetail) return;\n try {\n await publishArticle(articleDetail.id);\n setNotification({ type: 'success', message: 'Article published successfully!' });\n scheduleNotificationDismiss();\n } catch {\n setNotification({ type: 'error', message: 'Failed to publish article.' });\n scheduleNotificationDismiss();\n }\n };\n\n const handleUnpublish = async () => {\n if (!articleDetail) return;\n try {\n await unpublishArticle(articleDetail.id);\n setNotification({ type: 'success', message: 'Article unpublished.' });\n scheduleNotificationDismiss();\n } catch {\n setNotification({ type: 'error', message: 'Failed to unpublish article.' });\n scheduleNotificationDismiss();\n }\n };\n\n const handleArchive = async () => {\n if (!articleDetail) return;\n try {\n await archiveArticle(articleDetail.id);\n setNotification({ type: 'success', message: 'Article archived.' });\n scheduleNotificationDismiss();\n } catch {\n setNotification({ type: 'error', message: 'Failed to archive article.' });\n scheduleNotificationDismiss();\n }\n };\n\n const isProcessing =\n deletingArticle || publishingArticle || unpublishingArticle || archivingArticle;\n\n const lifecycleActions: CTAAction[] = [\n ...(articleDetail?.status === 'DRAFT'\n ? [\n {\n label: 'Publish',\n icon: publishingArticle ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : (\n <Globe size={16} />\n ),\n onSelect: () => void handlePublish(),\n disabled: isProcessing,\n },\n ]\n : []),\n ...(articleDetail?.status === 'PUBLISHED'\n ? [\n {\n label: 'Unpublish',\n icon: unpublishingArticle ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : (\n <GlobeLock size={16} />\n ),\n onSelect: () => void handleUnpublish(),\n disabled: isProcessing,\n },\n {\n label: 'Archive',\n icon: archivingArticle ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : (\n <Archive size={16} />\n ),\n onSelect: () => void handleArchive(),\n disabled: isProcessing,\n },\n ]\n : []),\n {\n label: 'Delete',\n icon: <Trash2 size={16} />,\n intent: 'destructive' as const,\n onSelect: () => void requestDelete(),\n disabled: isProcessing,\n },\n ];\n\n if (articleLoading) {\n return (\n <PageLayout showHeader={false}>\n <LoadingState message=\"Loading article…\" />\n </PageLayout>\n );\n }\n\n if (articleError || !articleDetail) {\n return (\n <PageLayout showHeader={false}>\n <EmptyState\n illustration=\"empty-search\"\n title=\"Article not found\"\n description=\"The article you're looking for doesn't exist or has been removed.\"\n action={\n <Button onClick={() => navigate(`${basePath}/kb`)}>\n <ArrowLeft size={18} />\n Back to Knowledge Base\n </Button>\n }\n />\n </PageLayout>\n );\n }\n\n const getStatusBadge = () => {\n switch (articleDetail.status) {\n case 'PUBLISHED':\n return (\n <Badge className=\"bg-success/10 text-success\">\n <Globe size={12} className=\"mr-1\" />\n Published\n </Badge>\n );\n case 'DRAFT':\n return (\n <Badge className=\"bg-warning/10 text-warning\">\n <GlobeLock size={12} className=\"mr-1\" />\n Draft\n </Badge>\n );\n case 'ARCHIVED':\n return (\n <Badge className=\"bg-bg-sunken text-tertiary\">\n <Archive size={12} className=\"mr-1\" />\n Archived\n </Badge>\n );\n default:\n return null;\n }\n };\n\n return (\n <div className=\"flex flex-col h-full\">\n {/* Notification */}\n {notification && (\n <div\n 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 ${\n notification.type === 'success'\n ? 'bg-success/10 text-success border-success/30'\n : 'bg-error/10 text-error border-error/30'\n }`}\n >\n {notification.type === 'success' ? (\n <CheckCircle size={20} className=\"text-success\" />\n ) : (\n <AlertCircle size={20} className=\"text-error\" />\n )}\n <span className=\"font-medium\">{notification.message}</span>\n </div>\n )}\n\n {/* Delete Confirmation Modal */}\n <AlertDialog\n open={showDeleteConfirm}\n onOpenChange={(open) => {\n if (!open) setShowDeleteConfirm(false);\n }}\n >\n <AlertDialogContent className=\"max-w-md\">\n <AlertDialogHeader>\n <AlertDialogTitle>Delete Article?</AlertDialogTitle>\n <AlertDialogDescription>\n Are you sure you want to delete "{articleDetail.title}"? This action cannot\n be undone.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogAction asChild>\n <Button\n variant=\"destructive\"\n onClick={(e) => {\n e.preventDefault();\n void handleDelete();\n }}\n disabled={deletingArticle}\n className=\"flex-1\"\n >\n {deletingArticle ? (\n <>\n <Loader2 size={16} className=\"animate-spin\" />\n Deleting…\n </>\n ) : (\n <>\n <Trash2 size={16} />\n Delete\n </>\n )}\n </Button>\n </AlertDialogAction>\n <AlertDialogCancel asChild>\n <Button variant=\"outline\" className=\"flex-1\">\n Cancel\n </Button>\n </AlertDialogCancel>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n\n {/* Header */}\n <div className=\"border-b border-border-subtle p-4 sm:p-6\">\n <div className=\"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <Button variant=\"ghost\" size=\"sm\" onClick={() => navigate(`${basePath}/kb`)}>\n <ArrowLeft size={20} />\n Back to Knowledge Base\n </Button>\n\n {/* Admin Actions — one primary CTA (Edit), the rest in the overflow menu */}\n <CTAOverflowMenu\n primary={{\n label: 'Edit',\n icon: <Edit size={16} />,\n onSelect: () => navigate('edit'),\n disabled: isProcessing,\n }}\n actions={lifecycleActions}\n />\n </div>\n\n <div className=\"flex items-center gap-3 mb-3\">\n {articleDetail.category && (\n <Badge\n variant=\"outline\"\n className={getCategoryBadgeClass(articleDetail.category.color)}\n >\n {articleDetail.category.name}\n </Badge>\n )}\n {getStatusBadge()}\n </div>\n\n <h1 className=\"mb-4 text-2xl font-bold text-text-primary sm:text-3xl lg:text-4xl\">\n {articleDetail.title}\n </h1>\n\n <div className=\"flex flex-wrap items-center gap-4 text-sm text-text-secondary\">\n {articleDetail.author && (\n <div className=\"flex items-center gap-2\">\n <User size={16} />\n <span>{articleDetail.author.name}</span>\n </div>\n )}\n {articleDetail.publishedAt && (\n <div className=\"flex items-center gap-2\">\n <Calendar size={16} />\n <span>{new Date(articleDetail.publishedAt).toLocaleDateString()}</span>\n </div>\n )}\n <div className=\"flex items-center gap-2\">\n <Eye size={16} />\n <span>{articleDetail.viewCount} views</span>\n </div>\n </div>\n\n {articleDetail.tags && articleDetail.tags.length > 0 && (\n <div className=\"flex flex-wrap items-center gap-2 mt-4\">\n <Tag size={16} className=\"text-text-secondary\" />\n {articleDetail.tags.map((tag: string) => (\n <Badge key={tag} variant=\"outline\" className=\"text-xs\">\n {tag}\n </Badge>\n ))}\n </div>\n )}\n </div>\n\n {/* Content */}\n <div className=\"flex-1 overflow-y-auto p-4 sm:p-6\">\n <div className=\"max-w-4xl mx-auto\">\n <div\n className=\"prose prose-lg max-w-none dark:prose-invert text-text-primary\"\n dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(articleDetail.content) }}\n />\n </div>\n </div>\n\n {/* Feedback */}\n <div className=\"border-t border-border-subtle bg-bg-surface p-4 sm:p-6\">\n <div className=\"max-w-4xl mx-auto\">\n <h3 className=\"text-lg font-semibold mb-4 text-text-primary\">\n Was this article helpful?\n </h3>\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4\">\n <Button\n variant=\"outline\"\n onClick={() => handleVote(true)}\n disabled={ratingArticle}\n className=\"px-6\"\n >\n <ThumbsUp size={20} />\n Yes ({articleDetail.helpfulCount})\n </Button>\n <Button\n variant=\"outline\"\n onClick={() => handleVote(false)}\n disabled={ratingArticle}\n className=\"px-6\"\n >\n <ThumbsDown size={20} />\n No ({articleDetail.notHelpfulCount})\n </Button>\n </div>\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA4CA,SAAgB,IAAyB;CACvC,IAAM,EAAE,YAAS,IAA6B,EACxC,IAAW,IAAa,EACxB,EAAE,cAAW,OAAO,GAAY,EAChC,EACJ,kBACA,mBACA,iBACA,gBACA,eACA,kBACA,kBACA,mBACA,sBACA,oBACA,oBACA,sBACA,wBACA,wBACE,EAA2B,EAAK,EAE9B,CAAC,IAAmB,KAAwB,EAAS,GAAM,EAC3D,CAAC,GAAc,KAAmB,EAG9B,KAAK,EACT,IAAmB,EAAsC,KAAK,EAC9D,IAAuB,EAAsC,KAAK;AASxE,CAPA,QAAgB;AACd,EAAI,GAAe,MACjB,EAAW,EAAc,GAAG;IAE7B,CAAC,GAAe,IAAI,EAAW,CAAC,EAGnC,cACe;AAEX,EADI,EAAiB,WAAS,aAAa,EAAiB,QAAQ,EAChE,EAAqB,WAAS,aAAa,EAAqB,QAAQ;IAE7E,EAAE,CAAC;CAEN,IAAM,UAAoC;AAExC,EADI,EAAqB,WAAS,aAAa,EAAqB,QAAQ,EAC5E,EAAqB,UAAU,iBAAiB,EAAgB,KAAK,EAAE,IAAK;IAGxE,MAAoB,MAAiB;AAEzC,EADI,EAAiB,WAAS,aAAa,EAAiB,QAAQ,EACpE,EAAiB,UAAU,iBAAiB,EAAS,EAAK,EAAE,IAAK;IAG7D,IAAa,OAAO,MAAqB;AACxC,QACL,KAAI;AACF,SAAM,EAAY,EAAc,IAAI,EAAQ;WACrC,GAAO;AACd,WAAQ,MAA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A,EACjB,kBAAC,QAAD,EAAA,UAAA,CAAO,EAAc,WAAU,SAAa,EAAA,CAAA,CACxC;;OACF;;KAEL,EAAc,QAAQ,EAAc,KAAK,SAAS,KACjD,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,IAAD;OAAK,MAAM;OAAI,WAAU;OAAwB,CAAA,EAChD,EAAc,KAAK,KAAK,MACvB,kBAAC,GAAD;OAAiB,SAAQ;OAAU,WAAU;iBAC1C;OACK,EAFI,EAEJ,CACR,CACE;;KAEJ;;GAGN,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,OAAD;MACE,WAAU;MACV,yBAAyB,EAAE,QAAQ,EAAU,SAAS,EAAc,QAAQ,EAAE;MAC9E,CAAA;KACE,CAAA;IACF,CAAA;GAGN,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,MAAD;MAAI,WAAU;gBAA+C;MAExD,CAAA,EACL,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,GAAD;OACE,SAAQ;OACR,eAAe,EAAW,GAAK;OAC/B,UAAU;OACV,WAAU;iBAJZ;QAME,kBAAC,IAAD,EAAU,MAAM,IAAM,CAAA;;QAChB,EAAc;QAAa;QAC1B;UACT,kBAAC,GAAD;OACE,SAAQ;OACR,eAAe,EAAW,GAAM;OAChC,UAAU;OACV,WAAU;iBAJZ;QAME,kBAAC,IAAD,EAAY,MAAM,IAAM,CAAA;;QACnB,EAAc;QAAgB;QAC5B;SACL;QACF;;IACF,CAAA;GACF"}
|
|
1
|
+
{"version":3,"file":"ArticleDetailAdminPage.js","names":[],"sources":["../../../src/support/pages/ArticleDetailAdminPage.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { useParams, useNavigate } from 'react-router-dom';\nimport DOMPurify from 'dompurify';\nimport {\n ArrowLeft,\n ThumbsUp,\n ThumbsDown,\n Eye,\n Calendar,\n User,\n Tag,\n Edit,\n Trash2,\n Globe,\n GlobeLock,\n Archive,\n AlertCircle,\n CheckCircle,\n Loader2,\n} from 'lucide-react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from '@burdenoff/fe-libs/ui';\nimport { Button, Badge, CTAOverflowMenu, EmphasisPanel, NextSteps } from '../components/ui';\nimport type { CTAAction } from '@burdenoff/fe-libs/ui';\nimport { useKnowledgeBaseOperations } from '../hooks/useKnowledgeBaseOperations';\nimport { PageLayout, LoadingState, EmptyState } from '../components/PageLayout';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\nimport { useSupport } from '../providers/SupportProvider';\nimport { getCategoryBadgeClass } from '../utils/categoryColors';\n\n/**\n * Admin-facing article detail page.\n *\n * Full controls: edit, publish, unpublish, archive, delete,\n * status badges, in addition to article content and voting.\n */\nexport function ArticleDetailAdminPage() {\n const { slug } = useParams<{ slug: string }>();\n const navigate = useNavigate();\n const { basePath = '' } = useSupport();\n const {\n articleDetail,\n articleLoading,\n articleError,\n voteArticle,\n recordView,\n ratingArticle,\n deleteArticle,\n publishArticle,\n unpublishArticle,\n archiveArticle,\n deletingArticle,\n publishingArticle,\n unpublishingArticle,\n archivingArticle,\n } = useKnowledgeBaseOperations(slug);\n\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\n const [notification, setNotification] = useState<{\n type: 'success' | 'error';\n message: string;\n } | null>(null);\n const navigateTimerRef = useRef<ReturnType<typeof setTimeout>>(null);\n const notificationTimerRef = useRef<ReturnType<typeof setTimeout>>(null);\n\n useEffect(() => {\n if (articleDetail?.id) {\n recordView(articleDetail.id);\n }\n }, [articleDetail?.id, recordView]);\n\n // Cleanup timers on unmount to avoid state updates on unmounted component\n useEffect(() => {\n return () => {\n if (navigateTimerRef.current) clearTimeout(navigateTimerRef.current);\n if (notificationTimerRef.current) clearTimeout(notificationTimerRef.current);\n };\n }, []);\n\n const scheduleNotificationDismiss = () => {\n if (notificationTimerRef.current) clearTimeout(notificationTimerRef.current);\n notificationTimerRef.current = setTimeout(() => setNotification(null), 3000);\n };\n\n const scheduleNavigate = (path: string) => {\n if (navigateTimerRef.current) clearTimeout(navigateTimerRef.current);\n navigateTimerRef.current = setTimeout(() => navigate(path), 1000);\n };\n\n const handleVote = async (helpful: boolean) => {\n if (!articleDetail) return;\n try {\n await voteArticle(articleDetail.id, helpful);\n } catch (error) {\n console.error('Failed to vote:', error);\n }\n };\n\n const handleDelete = async () => {\n if (!articleDetail) return;\n try {\n await deleteArticle(articleDetail.id);\n setNotification({ type: 'success', message: 'Article deleted successfully!' });\n void nativeNotify('success');\n scheduleNavigate(`${basePath}/kb`);\n } catch {\n setNotification({ type: 'error', message: 'Failed to delete article.' });\n void nativeNotify('error');\n scheduleNotificationDismiss();\n }\n setShowDeleteConfirm(false);\n };\n\n const requestDelete = async () => {\n void nativeImpact('medium');\n const result = await nativeConfirm({\n title: 'Delete Article',\n message: 'Delete this article? This cannot be undone.',\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n if (result === null) {\n setShowDeleteConfirm(true);\n return;\n }\n if (result) {\n await handleDelete();\n }\n };\n\n const handlePublish = async () => {\n if (!articleDetail) return;\n try {\n await publishArticle(articleDetail.id);\n setNotification({ type: 'success', message: 'Article published successfully!' });\n scheduleNotificationDismiss();\n } catch {\n setNotification({ type: 'error', message: 'Failed to publish article.' });\n scheduleNotificationDismiss();\n }\n };\n\n const handleUnpublish = async () => {\n if (!articleDetail) return;\n try {\n await unpublishArticle(articleDetail.id);\n setNotification({ type: 'success', message: 'Article unpublished.' });\n scheduleNotificationDismiss();\n } catch {\n setNotification({ type: 'error', message: 'Failed to unpublish article.' });\n scheduleNotificationDismiss();\n }\n };\n\n const handleArchive = async () => {\n if (!articleDetail) return;\n try {\n await archiveArticle(articleDetail.id);\n setNotification({ type: 'success', message: 'Article archived.' });\n scheduleNotificationDismiss();\n } catch {\n setNotification({ type: 'error', message: 'Failed to archive article.' });\n scheduleNotificationDismiss();\n }\n };\n\n const isProcessing =\n deletingArticle || publishingArticle || unpublishingArticle || archivingArticle;\n\n const lifecycleActions: CTAAction[] = [\n ...(articleDetail?.status === 'DRAFT'\n ? [\n {\n label: 'Publish',\n icon: publishingArticle ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : (\n <Globe size={16} />\n ),\n onSelect: () => void handlePublish(),\n disabled: isProcessing,\n },\n ]\n : []),\n ...(articleDetail?.status === 'PUBLISHED'\n ? [\n {\n label: 'Unpublish',\n icon: unpublishingArticle ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : (\n <GlobeLock size={16} />\n ),\n onSelect: () => void handleUnpublish(),\n disabled: isProcessing,\n },\n {\n label: 'Archive',\n icon: archivingArticle ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : (\n <Archive size={16} />\n ),\n onSelect: () => void handleArchive(),\n disabled: isProcessing,\n },\n ]\n : []),\n {\n label: 'Delete',\n icon: <Trash2 size={16} />,\n intent: 'destructive' as const,\n onSelect: () => void requestDelete(),\n disabled: isProcessing,\n },\n ];\n\n if (articleLoading) {\n return (\n <PageLayout showHeader={false}>\n <LoadingState message=\"Loading article…\" />\n </PageLayout>\n );\n }\n\n if (articleError || !articleDetail) {\n return (\n <PageLayout showHeader={false}>\n <EmptyState\n illustration=\"empty-search\"\n title=\"Article not found\"\n description=\"The article you're looking for doesn't exist or has been removed.\"\n action={\n <Button onClick={() => navigate(`${basePath}/kb`)}>\n <ArrowLeft size={18} />\n Back to Knowledge Base\n </Button>\n }\n />\n </PageLayout>\n );\n }\n\n const getStatusBadge = () => {\n switch (articleDetail.status) {\n case 'PUBLISHED':\n return (\n <Badge className=\"bg-success/10 text-success\">\n <Globe size={12} className=\"mr-1\" />\n Published\n </Badge>\n );\n case 'DRAFT':\n return (\n <Badge className=\"bg-warning/10 text-warning\">\n <GlobeLock size={12} className=\"mr-1\" />\n Draft\n </Badge>\n );\n case 'ARCHIVED':\n return (\n <Badge className=\"bg-bg-sunken text-tertiary\">\n <Archive size={12} className=\"mr-1\" />\n Archived\n </Badge>\n );\n default:\n return null;\n }\n };\n\n return (\n <div className=\"flex flex-col h-full\">\n {/* Notification */}\n {notification && (\n <div\n 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 ${\n notification.type === 'success'\n ? 'bg-success/10 text-success border-success/30'\n : 'bg-error/10 text-error border-error/30'\n }`}\n >\n {notification.type === 'success' ? (\n <CheckCircle size={20} className=\"text-success\" />\n ) : (\n <AlertCircle size={20} className=\"text-error\" />\n )}\n <span className=\"font-medium\">{notification.message}</span>\n </div>\n )}\n\n {/* Delete Confirmation Modal */}\n <AlertDialog\n open={showDeleteConfirm}\n onOpenChange={(open) => {\n if (!open) setShowDeleteConfirm(false);\n }}\n >\n <AlertDialogContent className=\"max-w-md\">\n <AlertDialogHeader>\n <AlertDialogTitle>Delete Article?</AlertDialogTitle>\n <AlertDialogDescription>\n Are you sure you want to delete "{articleDetail.title}"? This action cannot\n be undone.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogAction asChild>\n <Button\n variant=\"destructive\"\n onClick={(e) => {\n e.preventDefault();\n void handleDelete();\n }}\n disabled={deletingArticle}\n className=\"flex-1\"\n >\n {deletingArticle ? (\n <>\n <Loader2 size={16} className=\"animate-spin\" />\n Deleting…\n </>\n ) : (\n <>\n <Trash2 size={16} />\n Delete\n </>\n )}\n </Button>\n </AlertDialogAction>\n <AlertDialogCancel asChild>\n <Button variant=\"outline\" className=\"flex-1\">\n Cancel\n </Button>\n </AlertDialogCancel>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n\n {/* Header */}\n <div className=\"border-b border-border-subtle p-4 sm:p-6\">\n <div className=\"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <Button variant=\"ghost\" size=\"sm\" onClick={() => navigate(`${basePath}/kb`)}>\n <ArrowLeft size={20} />\n Back to Knowledge Base\n </Button>\n\n {/* Admin Actions — one primary CTA (Edit), the rest in the overflow menu */}\n <CTAOverflowMenu\n primary={{\n label: 'Edit',\n icon: <Edit size={16} />,\n onSelect: () => navigate('edit'),\n disabled: isProcessing,\n }}\n actions={lifecycleActions}\n />\n </div>\n\n <div className=\"flex items-center gap-3 mb-3\">\n {articleDetail.category && (\n <Badge\n variant=\"outline\"\n className={getCategoryBadgeClass(articleDetail.category.color)}\n >\n {articleDetail.category.name}\n </Badge>\n )}\n {getStatusBadge()}\n </div>\n\n <h1 className=\"mb-4 text-2xl font-bold text-text-primary sm:text-3xl lg:text-4xl\">\n {articleDetail.title}\n </h1>\n\n <div className=\"flex flex-wrap items-center gap-4 text-sm text-text-secondary\">\n {articleDetail.author && (\n <div className=\"flex items-center gap-2\">\n <User size={16} />\n <span>{articleDetail.author.name}</span>\n </div>\n )}\n {articleDetail.publishedAt && (\n <div className=\"flex items-center gap-2\">\n <Calendar size={16} />\n <span>{new Date(articleDetail.publishedAt).toLocaleDateString()}</span>\n </div>\n )}\n <div className=\"flex items-center gap-2\">\n <Eye size={16} />\n <span>{articleDetail.viewCount} views</span>\n </div>\n </div>\n\n {articleDetail.tags && articleDetail.tags.length > 0 && (\n <div className=\"flex flex-wrap items-center gap-2 mt-4\">\n <Tag size={16} className=\"text-text-secondary\" />\n {articleDetail.tags.map((tag: string) => (\n <Badge key={tag} variant=\"outline\" className=\"text-xs\">\n {tag}\n </Badge>\n ))}\n </div>\n )}\n </div>\n\n {/* Content */}\n <div className=\"flex-1 overflow-y-auto p-4 sm:p-6\">\n <div className=\"max-w-4xl mx-auto\">\n <NextSteps\n storageKey=\"support-article-detail-admin\"\n title=\"Manage this article\"\n className=\"mb-6\"\n steps={[\n {\n id: 'edit',\n label: 'Edit the article',\n description: 'Update the content, category or tags.',\n onClick: () => navigate('edit'),\n },\n ...(articleDetail.status === 'DRAFT'\n ? [\n {\n id: 'publish',\n label: 'Publish it',\n description: 'Make this article visible to customers.',\n onClick: () => void handlePublish(),\n },\n ]\n : [\n {\n id: 'unpublish',\n label: 'Unpublish or archive',\n description: 'Hide it from customers while you revise.',\n onClick: () => void handleUnpublish(),\n done: articleDetail.status === 'ARCHIVED',\n },\n ]),\n {\n id: 'back-kb',\n label: 'Back to the knowledge base',\n description: 'Return to the full list of articles.',\n onClick: () => navigate(`${basePath}/kb`),\n },\n ]}\n />\n <div\n className=\"prose prose-lg max-w-none dark:prose-invert text-text-primary\"\n dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(articleDetail.content) }}\n />\n </div>\n </div>\n\n {/* Feedback — the page's single emphasis zone */}\n <div className=\"border-t border-border-subtle bg-bg-surface p-4 sm:p-6\">\n <EmphasisPanel className=\"max-w-4xl mx-auto p-5\">\n <h3 className=\"text-lg font-semibold mb-1 text-text-primary\">\n Was this article helpful?\n </h3>\n <p className=\"mb-4 text-sm text-text-secondary\">\n See how readers rate this guide — low scores are a cue to revise it.\n </p>\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4\">\n <Button\n variant=\"outline\"\n onClick={() => handleVote(true)}\n disabled={ratingArticle}\n className=\"px-6\"\n >\n <ThumbsUp size={20} />\n Yes ({articleDetail.helpfulCount})\n </Button>\n <Button\n variant=\"outline\"\n onClick={() => handleVote(false)}\n disabled={ratingArticle}\n className=\"px-6\"\n >\n <ThumbsDown size={20} />\n No ({articleDetail.notHelpfulCount})\n </Button>\n </div>\n </EmphasisPanel>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA4CA,SAAgB,IAAyB;CACvC,IAAM,EAAE,YAAS,IAA6B,EACxC,IAAW,IAAa,EACxB,EAAE,cAAW,OAAO,GAAY,EAChC,EACJ,kBACA,mBACA,iBACA,gBACA,eACA,kBACA,mBACA,oBACA,sBACA,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