@burdenoff/microfe-support 2026.624.2 → 2026.625.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/analytics/CategoryBreakdown.js +27 -25
- package/dist/support/components/analytics/CategoryBreakdown.js.map +1 -1
- package/dist/support/components/analytics/MetricCard.js +20 -15
- package/dist/support/components/analytics/MetricCard.js.map +1 -1
- package/dist/support/components/analytics/PriorityBreakdown.js +28 -26
- package/dist/support/components/analytics/PriorityBreakdown.js.map +1 -1
- package/dist/support/components/analytics/SLAReport.js +44 -42
- package/dist/support/components/analytics/SLAReport.js.map +1 -1
- package/dist/support/components/analytics/SatisfactionDistribution.js +56 -54
- package/dist/support/components/analytics/SatisfactionDistribution.js.map +1 -1
- package/dist/support/components/analytics/TopAgents.js +31 -29
- package/dist/support/components/analytics/TopAgents.js.map +1 -1
- package/dist/support/components/analytics/TrendChart.js +24 -22
- package/dist/support/components/analytics/TrendChart.js.map +1 -1
- package/dist/support/components/kb/ArticleForm.js +1 -1
- package/dist/support/components/kb/ArticleForm.js.map +1 -1
- package/dist/support/components/settings/CannedResponsesSettings.js +1 -1
- package/dist/support/components/settings/CannedResponsesSettings.js.map +1 -1
- package/dist/support/components/settings/SLAPoliciesSettings.js +1 -1
- package/dist/support/components/settings/SLAPoliciesSettings.js.map +1 -1
- package/dist/support/components/settings/TicketCategoriesSettings.js +1 -1
- package/dist/support/components/settings/TicketCategoriesSettings.js.map +1 -1
- package/dist/support/components/ui.js +2 -2
- package/dist/support/pages/AnalyticsPage.js +129 -126
- package/dist/support/pages/AnalyticsPage.js.map +1 -1
- package/dist/support/pages/ArticleDetailAdminPage.js +76 -85
- package/dist/support/pages/ArticleDetailAdminPage.js.map +1 -1
- package/dist/support/pages/ContactInquiriesPage.js +2 -2
- package/dist/support/pages/ContactInquiriesPage.js.map +1 -1
- package/dist/support/pages/ContactInquiryDetailPage.js +6 -6
- package/dist/support/pages/ContactInquiryDetailPage.js.map +1 -1
- package/dist/support/pages/CreateTicketPage.js +1 -1
- package/dist/support/pages/CreateTicketPage.js.map +1 -1
- package/dist/support/pages/JobApplicationDetailPage.js +7 -7
- package/dist/support/pages/JobApplicationDetailPage.js.map +1 -1
- package/dist/support/pages/JobApplicationsPage.js +2 -2
- package/dist/support/pages/JobApplicationsPage.js.map +1 -1
- package/dist/support/pages/KnowledgeBaseAdminPage.js +3 -3
- package/dist/support/pages/KnowledgeBaseAdminPage.js.map +1 -1
- package/dist/support/pages/KnowledgeBaseUserPage.js +3 -3
- package/dist/support/pages/KnowledgeBaseUserPage.js.map +1 -1
- package/dist/support/pages/TicketDetailAdminPage.js +1 -1
- package/dist/support/pages/TicketDetailAdminPage.js.map +1 -1
- package/dist/support/pages/TicketDetailUserPage.js +49 -49
- package/dist/support/pages/TicketDetailUserPage.js.map +1 -1
- package/dist/support/pages/TicketListPage.js +4 -4
- package/dist/support/pages/TicketListPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { useSupport as e } from "../providers/SupportProvider.js";
|
|
2
|
-
import { Badge as t, Button as n } 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 ee } from "../components/ui.js";
|
|
3
|
+
import { EmptyState as te, LoadingState as ne, PageLayout as r } from "../components/PageLayout.js";
|
|
4
|
+
import { getCategoryBadgeClass as re } from "../utils/categoryColors.js";
|
|
5
|
+
import { useKnowledgeBaseOperations as i } from "../hooks/useKnowledgeBaseOperations.js";
|
|
6
|
+
import { purify as a } from "../../node_modules/dompurify/dist/purify.es.js";
|
|
7
|
+
import { nativeConfirm as ie, nativeImpact as ae, nativeNotify as o } from "../../utils/nativeBridge.js";
|
|
8
8
|
import { useEffect as s, useRef as c, useState as l } from "react";
|
|
9
|
-
import { AlertCircle as
|
|
10
|
-
import { useNavigate as
|
|
9
|
+
import { AlertCircle as oe, Archive as u, ArrowLeft as d, BookOpen as f, Calendar as p, CheckCircle as m, Edit as h, Eye as g, Globe as _, GlobeLock as v, Loader2 as y, Tag as se, ThumbsDown as ce, ThumbsUp as le, Trash2 as b, User as ue } from "lucide-react";
|
|
10
|
+
import { useNavigate as de, useParams as fe } 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 pe, AlertDialogAction as w, AlertDialogCancel as T, AlertDialogContent as E, AlertDialogDescription as D, AlertDialogFooter as O, AlertDialogHeader as k, AlertDialogTitle as A } from "@burdenoff/fe-libs/ui";
|
|
13
13
|
//#region src/support/pages/ArticleDetailAdminPage.tsx
|
|
14
14
|
function j() {
|
|
15
|
-
let { slug: j } =
|
|
15
|
+
let { slug: j } = fe(), M = de(), { basePath: N = "" } = e(), { articleDetail: P, articleLoading: F, articleError: I, voteArticle: L, recordView: R, ratingArticle: z, deleteArticle: B, publishArticle: me, unpublishArticle: he, archiveArticle: ge, deletingArticle: V, publishingArticle: H, unpublishingArticle: U, archivingArticle: W } = i(j), [_e, G] = l(!1), [K, q] = l(null), J = c(null), Y = c(null);
|
|
16
16
|
s(() => {
|
|
17
17
|
P?.id && R(P.id);
|
|
18
18
|
}, [P?.id, R]), s(() => () => {
|
|
@@ -20,7 +20,7 @@ function j() {
|
|
|
20
20
|
}, []);
|
|
21
21
|
let X = () => {
|
|
22
22
|
Y.current && clearTimeout(Y.current), Y.current = setTimeout(() => q(null), 3e3);
|
|
23
|
-
},
|
|
23
|
+
}, ve = (e) => {
|
|
24
24
|
J.current && clearTimeout(J.current), J.current = setTimeout(() => M(e), 1e3);
|
|
25
25
|
}, Z = async (e) => {
|
|
26
26
|
if (P) try {
|
|
@@ -31,10 +31,10 @@ function j() {
|
|
|
31
31
|
}, Q = async () => {
|
|
32
32
|
if (P) {
|
|
33
33
|
try {
|
|
34
|
-
await
|
|
34
|
+
await B(P.id), q({
|
|
35
35
|
type: "success",
|
|
36
36
|
message: "Article deleted successfully!"
|
|
37
|
-
}), o("success"),
|
|
37
|
+
}), o("success"), ve(`${N}/kb`);
|
|
38
38
|
} catch {
|
|
39
39
|
q({
|
|
40
40
|
type: "error",
|
|
@@ -43,9 +43,9 @@ function j() {
|
|
|
43
43
|
}
|
|
44
44
|
G(!1);
|
|
45
45
|
}
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
let e = await
|
|
46
|
+
}, ye = async () => {
|
|
47
|
+
ae("medium");
|
|
48
|
+
let e = await ie({
|
|
49
49
|
title: "Delete Article",
|
|
50
50
|
message: "Delete this article? This cannot be undone.",
|
|
51
51
|
okButtonTitle: "Delete",
|
|
@@ -56,9 +56,9 @@ function j() {
|
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
58
|
e && await Q();
|
|
59
|
-
},
|
|
59
|
+
}, be = async () => {
|
|
60
60
|
if (P) try {
|
|
61
|
-
await
|
|
61
|
+
await me(P.id), q({
|
|
62
62
|
type: "success",
|
|
63
63
|
message: "Article published successfully!"
|
|
64
64
|
}), X();
|
|
@@ -68,9 +68,9 @@ function j() {
|
|
|
68
68
|
message: "Failed to publish article."
|
|
69
69
|
}), X();
|
|
70
70
|
}
|
|
71
|
-
},
|
|
71
|
+
}, xe = async () => {
|
|
72
72
|
if (P) try {
|
|
73
|
-
await
|
|
73
|
+
await he(P.id), q({
|
|
74
74
|
type: "success",
|
|
75
75
|
message: "Article unpublished."
|
|
76
76
|
}), X();
|
|
@@ -80,9 +80,9 @@ function j() {
|
|
|
80
80
|
message: "Failed to unpublish article."
|
|
81
81
|
}), X();
|
|
82
82
|
}
|
|
83
|
-
},
|
|
83
|
+
}, Se = async () => {
|
|
84
84
|
if (P) try {
|
|
85
|
-
await
|
|
85
|
+
await ge(P.id), q({
|
|
86
86
|
type: "success",
|
|
87
87
|
message: "Article archived."
|
|
88
88
|
}), X();
|
|
@@ -92,13 +92,47 @@ function j() {
|
|
|
92
92
|
message: "Failed to archive article."
|
|
93
93
|
}), X();
|
|
94
94
|
}
|
|
95
|
-
}, $ = V || H || U || W
|
|
95
|
+
}, $ = V || H || U || W, Ce = [
|
|
96
|
+
...P?.status === "DRAFT" ? [{
|
|
97
|
+
label: "Publish",
|
|
98
|
+
icon: H ? /* @__PURE__ */ S(y, {
|
|
99
|
+
size: 16,
|
|
100
|
+
className: "animate-spin"
|
|
101
|
+
}) : /* @__PURE__ */ S(_, { size: 16 }),
|
|
102
|
+
onSelect: () => void be(),
|
|
103
|
+
disabled: $
|
|
104
|
+
}] : [],
|
|
105
|
+
...P?.status === "PUBLISHED" ? [{
|
|
106
|
+
label: "Unpublish",
|
|
107
|
+
icon: U ? /* @__PURE__ */ S(y, {
|
|
108
|
+
size: 16,
|
|
109
|
+
className: "animate-spin"
|
|
110
|
+
}) : /* @__PURE__ */ S(v, { size: 16 }),
|
|
111
|
+
onSelect: () => void xe(),
|
|
112
|
+
disabled: $
|
|
113
|
+
}, {
|
|
114
|
+
label: "Archive",
|
|
115
|
+
icon: W ? /* @__PURE__ */ S(y, {
|
|
116
|
+
size: 16,
|
|
117
|
+
className: "animate-spin"
|
|
118
|
+
}) : /* @__PURE__ */ S(u, { size: 16 }),
|
|
119
|
+
onSelect: () => void Se(),
|
|
120
|
+
disabled: $
|
|
121
|
+
}] : [],
|
|
122
|
+
{
|
|
123
|
+
label: "Delete",
|
|
124
|
+
icon: /* @__PURE__ */ S(b, { size: 16 }),
|
|
125
|
+
intent: "destructive",
|
|
126
|
+
onSelect: () => void ye(),
|
|
127
|
+
disabled: $
|
|
128
|
+
}
|
|
129
|
+
];
|
|
96
130
|
return F ? /* @__PURE__ */ S(r, {
|
|
97
131
|
showHeader: !1,
|
|
98
|
-
children: /* @__PURE__ */ S(
|
|
132
|
+
children: /* @__PURE__ */ S(ne, { message: "Loading article…" })
|
|
99
133
|
}) : I || !P ? /* @__PURE__ */ S(r, {
|
|
100
134
|
showHeader: !1,
|
|
101
|
-
children: /* @__PURE__ */ S(
|
|
135
|
+
children: /* @__PURE__ */ S(te, {
|
|
102
136
|
icon: /* @__PURE__ */ S(f, { size: 48 }),
|
|
103
137
|
title: "Article not found",
|
|
104
138
|
description: "The article you're looking for doesn't exist or has been removed.",
|
|
@@ -115,7 +149,7 @@ function j() {
|
|
|
115
149
|
children: [K.type === "success" ? /* @__PURE__ */ S(m, {
|
|
116
150
|
size: 20,
|
|
117
151
|
className: "text-success"
|
|
118
|
-
}) : /* @__PURE__ */ S(
|
|
152
|
+
}) : /* @__PURE__ */ S(oe, {
|
|
119
153
|
size: 20,
|
|
120
154
|
className: "text-error"
|
|
121
155
|
}), /* @__PURE__ */ S("span", {
|
|
@@ -123,8 +157,8 @@ function j() {
|
|
|
123
157
|
children: K.message
|
|
124
158
|
})]
|
|
125
159
|
}),
|
|
126
|
-
/* @__PURE__ */ S(
|
|
127
|
-
open:
|
|
160
|
+
/* @__PURE__ */ S(pe, {
|
|
161
|
+
open: _e,
|
|
128
162
|
onOpenChange: (e) => {
|
|
129
163
|
e || G(!1);
|
|
130
164
|
},
|
|
@@ -168,64 +202,21 @@ function j() {
|
|
|
168
202
|
size: "sm",
|
|
169
203
|
onClick: () => M(`${N}/kb`),
|
|
170
204
|
children: [/* @__PURE__ */ S(d, { size: 20 }), "Back to Knowledge Base"]
|
|
171
|
-
}), /* @__PURE__ */
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
children: [/* @__PURE__ */ S(h, { size: 16 }), "Edit"]
|
|
180
|
-
}),
|
|
181
|
-
P.status === "DRAFT" && /* @__PURE__ */ C(n, {
|
|
182
|
-
variant: "outline",
|
|
183
|
-
size: "sm",
|
|
184
|
-
onClick: ye,
|
|
185
|
-
disabled: $,
|
|
186
|
-
className: "text-success hover:text-success/80 transition-colors duration-200",
|
|
187
|
-
children: [H ? /* @__PURE__ */ S(y, {
|
|
188
|
-
size: 16,
|
|
189
|
-
className: "animate-spin"
|
|
190
|
-
}) : /* @__PURE__ */ S(_, { size: 16 }), "Publish"]
|
|
191
|
-
}),
|
|
192
|
-
P.status === "PUBLISHED" && /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ C(n, {
|
|
193
|
-
variant: "outline",
|
|
194
|
-
size: "sm",
|
|
195
|
-
onClick: be,
|
|
196
|
-
disabled: $,
|
|
197
|
-
className: "text-warning hover:text-warning/80 transition-colors duration-200",
|
|
198
|
-
children: [U ? /* @__PURE__ */ S(y, {
|
|
199
|
-
size: 16,
|
|
200
|
-
className: "animate-spin"
|
|
201
|
-
}) : /* @__PURE__ */ S(v, { size: 16 }), "Unpublish"]
|
|
202
|
-
}), /* @__PURE__ */ C(n, {
|
|
203
|
-
variant: "outline",
|
|
204
|
-
size: "sm",
|
|
205
|
-
onClick: xe,
|
|
206
|
-
disabled: $,
|
|
207
|
-
className: "text-tertiary hover:text-secondary transition-colors duration-200",
|
|
208
|
-
children: [W ? /* @__PURE__ */ S(y, {
|
|
209
|
-
size: 16,
|
|
210
|
-
className: "animate-spin"
|
|
211
|
-
}) : /* @__PURE__ */ S(u, { size: 16 }), "Archive"]
|
|
212
|
-
})] }),
|
|
213
|
-
/* @__PURE__ */ C(n, {
|
|
214
|
-
variant: "outline",
|
|
215
|
-
size: "sm",
|
|
216
|
-
onClick: () => void ve(),
|
|
217
|
-
disabled: $,
|
|
218
|
-
className: "text-error hover:text-error/80 transition-colors duration-200",
|
|
219
|
-
children: [/* @__PURE__ */ S(b, { size: 16 }), "Delete"]
|
|
220
|
-
})
|
|
221
|
-
]
|
|
205
|
+
}), /* @__PURE__ */ S(ee, {
|
|
206
|
+
primary: {
|
|
207
|
+
label: "Edit",
|
|
208
|
+
icon: /* @__PURE__ */ S(h, { size: 16 }),
|
|
209
|
+
onSelect: () => M("edit"),
|
|
210
|
+
disabled: $
|
|
211
|
+
},
|
|
212
|
+
actions: Ce
|
|
222
213
|
})]
|
|
223
214
|
}),
|
|
224
215
|
/* @__PURE__ */ C("div", {
|
|
225
216
|
className: "flex items-center gap-3 mb-3",
|
|
226
217
|
children: [P.category && /* @__PURE__ */ S(t, {
|
|
227
218
|
variant: "outline",
|
|
228
|
-
className:
|
|
219
|
+
className: re(P.category.color),
|
|
229
220
|
children: P.category.name
|
|
230
221
|
}), (() => {
|
|
231
222
|
switch (P.status) {
|
|
@@ -263,7 +254,7 @@ function j() {
|
|
|
263
254
|
children: [
|
|
264
255
|
P.author && /* @__PURE__ */ C("div", {
|
|
265
256
|
className: "flex items-center gap-2",
|
|
266
|
-
children: [/* @__PURE__ */ S(
|
|
257
|
+
children: [/* @__PURE__ */ S(ue, { size: 16 }), /* @__PURE__ */ S("span", { children: P.author.name })]
|
|
267
258
|
}),
|
|
268
259
|
P.publishedAt && /* @__PURE__ */ C("div", {
|
|
269
260
|
className: "flex items-center gap-2",
|
|
@@ -277,7 +268,7 @@ function j() {
|
|
|
277
268
|
}),
|
|
278
269
|
P.tags && P.tags.length > 0 && /* @__PURE__ */ C("div", {
|
|
279
270
|
className: "flex flex-wrap items-center gap-2 mt-4",
|
|
280
|
-
children: [/* @__PURE__ */ S(
|
|
271
|
+
children: [/* @__PURE__ */ S(se, {
|
|
281
272
|
size: 16,
|
|
282
273
|
className: "text-text-secondary"
|
|
283
274
|
}), P.tags.map((e) => /* @__PURE__ */ S(t, {
|
|
@@ -294,7 +285,7 @@ function j() {
|
|
|
294
285
|
className: "max-w-4xl mx-auto",
|
|
295
286
|
children: /* @__PURE__ */ S("div", {
|
|
296
287
|
className: "prose prose-lg max-w-none dark:prose-invert text-text-primary",
|
|
297
|
-
dangerouslySetInnerHTML: { __html:
|
|
288
|
+
dangerouslySetInnerHTML: { __html: a.sanitize(P.content) }
|
|
298
289
|
})
|
|
299
290
|
})
|
|
300
291
|
}),
|
|
@@ -313,7 +304,7 @@ function j() {
|
|
|
313
304
|
disabled: z,
|
|
314
305
|
className: "px-6",
|
|
315
306
|
children: [
|
|
316
|
-
/* @__PURE__ */ S(
|
|
307
|
+
/* @__PURE__ */ S(le, { size: 20 }),
|
|
317
308
|
"Yes (",
|
|
318
309
|
P.helpfulCount,
|
|
319
310
|
")"
|
|
@@ -324,7 +315,7 @@ function j() {
|
|
|
324
315
|
disabled: z,
|
|
325
316
|
className: "px-6",
|
|
326
317
|
children: [
|
|
327
|
-
/* @__PURE__ */ S(
|
|
318
|
+
/* @__PURE__ */ S(ce, { size: 20 }),
|
|
328
319
|
"No (",
|
|
329
320
|
P.notHelpfulCount,
|
|
330
321
|
")"
|
|
@@ -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 BookOpen,\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 } from '../components/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 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 icon={<BookOpen size={48} />}\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 */}\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => navigate('edit')}\n disabled={isProcessing}\n >\n <Edit size={16} />\n Edit\n </Button>\n\n {articleDetail.status === 'DRAFT' && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={handlePublish}\n disabled={isProcessing}\n className=\"text-success hover:text-success/80 transition-colors duration-200\"\n >\n {publishingArticle ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : (\n <Globe size={16} />\n )}\n Publish\n </Button>\n )}\n\n {articleDetail.status === 'PUBLISHED' && (\n <>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={handleUnpublish}\n disabled={isProcessing}\n className=\"text-warning hover:text-warning/80 transition-colors duration-200\"\n >\n {unpublishingArticle ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : (\n <GlobeLock size={16} />\n )}\n Unpublish\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={handleArchive}\n disabled={isProcessing}\n className=\"text-tertiary hover:text-secondary transition-colors duration-200\"\n >\n {archivingArticle ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : (\n <Archive size={16} />\n )}\n Archive\n </Button>\n </>\n )}\n\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => void requestDelete()}\n disabled={isProcessing}\n className=\"text-error hover:text-error/80 transition-colors duration-200\"\n >\n <Trash2 size={16} />\n Delete\n </Button>\n </div>\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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D;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,GAAU,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 BookOpen,\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 icon={<BookOpen size={48} />}\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":";;;;;;;;;;;;;AA6CA,SAAgB,IAAyB;CACvC,IAAM,EAAE,YAAS,IAA6B,EACxC,IAAW,IAAa,EACxB,EAAE,cAAW,OAAO,GAAY,EAChC,EACJ,kBACA,mBACA,iBACA,gBACA,eACA,kBACA,kBACA,oBACA,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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AD;QAAK,WAAU;kBAAf,CACE,kBAAC,GAAD,EAAK,MAAM,IAAM,CAAA,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"}
|
|
@@ -161,7 +161,7 @@ function b() {
|
|
|
161
161
|
})]
|
|
162
162
|
}),
|
|
163
163
|
O && /* @__PURE__ */ h("div", {
|
|
164
|
-
className: "mb-6 p-4 bg-surface border border-
|
|
164
|
+
className: "mb-6 p-4 bg-bg-surface border border-border-seam rounded-lg",
|
|
165
165
|
children: /* @__PURE__ */ g("div", {
|
|
166
166
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
167
167
|
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
@@ -242,7 +242,7 @@ function b() {
|
|
|
242
242
|
children: R.map((t) => /* @__PURE__ */ h("button", {
|
|
243
243
|
type: "button",
|
|
244
244
|
onClick: () => b(`/support/inquiries/${t.id}${x}`),
|
|
245
|
-
className: "w-full text-left p-4 bg-surface border border-
|
|
245
|
+
className: "w-full text-left p-4 bg-bg-surface border border-border-seam rounded-lg shadow-[var(--shadow-pop)] hover:border-border-strong hover:shadow-[var(--shadow-pop-hover)] transition-[box-shadow,border-color] duration-200 group",
|
|
246
246
|
children: /* @__PURE__ */ g("div", {
|
|
247
247
|
className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
|
|
248
248
|
children: [/* @__PURE__ */ g("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContactInquiriesPage.js","names":[],"sources":["../../../src/support/pages/ContactInquiriesPage.tsx"],"sourcesContent":["import { useState, useEffect, useRef } from 'react';\nimport { useNavigate, useLocation } from 'react-router-dom';\nimport { Mail, Search, Filter, Loader2, AlertCircle, ChevronDown } from 'lucide-react';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql/fetch';\nimport {\n useGetContactInquiriesQuery,\n type GetContactInquiriesQuery,\n} from '../../generated/global-operations';\nimport type { ContactInquiryStatus, ContactInquiryFilterInput } from '../../generated/global-types';\nimport { humanizeCategory } from '../utils';\n\ntype ContactInquiry = GetContactInquiriesQuery['contactInquiries']['items'][number];\n\nconst statusColors: Record<string, string> = {\n NEW: 'bg-status-info-bg-subtle text-status-info-text',\n REVIEWED: 'bg-status-warning-bg-subtle text-status-warning-text',\n CONVERTED: 'bg-status-success-bg-subtle text-status-success-text',\n SPAM: 'bg-status-error-bg-subtle text-status-error-text',\n ARCHIVED: 'bg-bg-sunken text-text-secondary',\n};\n\nconst statusLabels: Record<string, string> = {\n NEW: 'New',\n REVIEWED: 'Reviewed',\n CONVERTED: 'Converted',\n SPAM: 'Spam',\n ARCHIVED: 'Archived',\n};\n\nfunction formatDate(dateString: string): string {\n return new Date(dateString).toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n}\n\nexport function ContactInquiriesPage() {\n const navigate = useNavigate();\n const location = useLocation();\n const queryParams = location.search;\n const [search, setSearch] = useState('');\n const [statusFilter, setStatusFilter] = useState<ContactInquiryStatus | ''>('');\n const [productFilter, setProductFilter] = useState('');\n const [showFilters, setShowFilters] = useState(false);\n const [productNames, setProductNames] = useState<Record<string, string>>({});\n // Mirror the latest map into a ref so the resolver effect can read it\n // without re-running every time we cache a freshly-resolved name.\n const productNamesRef = useRef(productNames);\n productNamesRef.current = productNames;\n\n const filter: ContactInquiryFilterInput = {};\n if (search) filter.search = search;\n if (statusFilter) filter.status = statusFilter;\n if (productFilter) filter.productId = productFilter;\n\n const { data, loading, error, fetchMore } = useGetContactInquiriesQuery({\n variables: { filter, limit: 50, offset: 0 },\n fetchPolicy: 'cache-and-network',\n });\n\n const inquiries = data?.contactInquiries?.items ?? [];\n const total = data?.contactInquiries?.total ?? 0;\n const hasMore = data?.contactInquiries?.hasMore ?? false;\n\n // Fetch product names for the filter dropdown. We key the effect off a\n // stable string so a new array reference per render doesn't retrigger.\n const productIds = Array.from(\n new Set(inquiries.flatMap((i: ContactInquiry): string[] => (i.productId ? [i.productId] : [])))\n ).sort() as string[];\n const productIdsKey = productIds.join(',');\n useEffect(() => {\n const unknownIds = productIdsKey\n ? productIdsKey.split(',').filter((pid) => !productNamesRef.current[pid])\n : [];\n if (unknownIds.length === 0) return;\n unknownIds.forEach((pid) => {\n graphqlFetch<{ platformProduct?: { name?: string } }>({\n gateway: 'global',\n query: 'query($id: ID!) { platformProduct(id: $id) { name } }',\n variables: { id: pid },\n })\n .then((result) => {\n const name = result.data?.platformProduct?.name;\n if (name) setProductNames((prev) => ({ ...prev, [pid]: name }));\n })\n .catch(() => {});\n });\n }, [productIdsKey]);\n\n const loadMore = () => {\n if (!hasMore) return;\n fetchMore({\n variables: { offset: inquiries.length },\n updateQuery: (prev, { fetchMoreResult }) => {\n if (!fetchMoreResult) return prev;\n return {\n contactInquiries: {\n ...fetchMoreResult.contactInquiries,\n items: [\n ...(prev.contactInquiries?.items ?? []),\n ...(fetchMoreResult.contactInquiries?.items ?? []),\n ],\n },\n };\n },\n });\n };\n\n // Loading state\n if (loading && inquiries.length === 0) {\n return (\n <div className=\"p-3 sm:p-6\">\n <div className=\"flex items-center gap-3 mb-6\">\n <Mail size={24} className=\"text-text-primary\" />\n <h1 className=\"text-2xl font-bold text-text-primary\">Contact Inquiries</h1>\n </div>\n <div className=\"flex flex-col items-center justify-center py-16\">\n <Loader2 size={32} className=\"animate-spin text-text-secondary mb-4\" />\n <p className=\"text-sm text-text-secondary\">Loading inquiries…</p>\n </div>\n </div>\n );\n }\n\n // Error state\n if (error) {\n return (\n <div className=\"p-3 sm:p-6\">\n <div className=\"flex items-center gap-3 mb-6\">\n <Mail size={24} className=\"text-text-primary\" />\n <h1 className=\"text-2xl font-bold text-text-primary\">Contact Inquiries</h1>\n </div>\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n <div className=\"p-4 rounded-2xl bg-status-error-bg-subtle text-status-error-text mb-4\">\n <AlertCircle size={48} />\n </div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-2\">Failed to load inquiries</h3>\n <p className=\"text-sm text-text-secondary\">{error.message}</p>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"p-3 sm:p-6\">\n {/* Header */}\n <div className=\"flex flex-col gap-3 mb-6 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"flex items-center gap-3\">\n <Mail size={24} className=\"text-text-primary\" />\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">Contact Inquiries</h1>\n <p className=\"text-sm text-text-secondary\">Website contact form submissions</p>\n </div>\n <span className=\"ml-2 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-bg-sunken text-text-secondary\">\n {total}\n </span>\n </div>\n </div>\n\n {/* Toolbar */}\n <div className=\"flex flex-col sm:flex-row gap-3 mb-6\">\n {/* Search */}\n <div className=\"relative flex-1\">\n <Search\n size={16}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary\"\n />\n <input\n type=\"text\"\n aria-label=\"Search inquiries\"\n placeholder=\"Search by name, email, or subject...\"\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n className=\"w-full pl-9 pr-4 py-2 bg-surface border border-default rounded-lg text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-accent/50\"\n />\n </div>\n\n {/* Filter toggle */}\n <button\n type=\"button\"\n onClick={() => setShowFilters(!showFilters)}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 bg-surface border border-default rounded-lg text-sm text-text-secondary hover:text-text-primary hover:bg-bg-sunken transition-colors\"\n >\n <Filter size={16} />\n Filters\n <ChevronDown\n size={14}\n className={showFilters ? 'rotate-180 transition-transform' : 'transition-transform'}\n />\n </button>\n </div>\n\n {/* Filters panel */}\n {showFilters && (\n <div className=\"mb-6 p-4 bg-surface border border-default rounded-lg\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label\n className=\"block text-xs font-medium text-text-secondary mb-1\"\n htmlFor=\"contactinquiriespage-status-0\"\n >\n Status\n </label>\n <select\n id=\"contactinquiriespage-status-0\"\n value={statusFilter}\n onChange={(e) => setStatusFilter(e.target.value as ContactInquiryStatus | '')}\n className=\"min-h-11 w-full px-3 py-2 bg-surface border border-default rounded-lg text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-accent/50\"\n >\n <option value=\"\">All statuses</option>\n <option value=\"NEW\">New</option>\n <option value=\"REVIEWED\">Reviewed</option>\n <option value=\"CONVERTED\">Converted</option>\n <option value=\"SPAM\">Spam</option>\n <option value=\"ARCHIVED\">Archived</option>\n </select>\n </div>\n <div>\n <label\n className=\"block text-xs font-medium text-text-secondary mb-1\"\n htmlFor=\"contactinquiriespage-product-2\"\n >\n Product\n </label>\n <select\n id=\"contactinquiriespage-product-2\"\n value={productFilter}\n onChange={(e) => setProductFilter(e.target.value)}\n className=\"min-h-11 w-full px-3 py-2 bg-surface border border-default rounded-lg text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-accent/50\"\n >\n <option value=\"\">All products</option>\n {productIds.map((pid) => (\n <option key={pid} value={pid}>\n {productNames[pid] || pid}\n </option>\n ))}\n </select>\n </div>\n </div>\n </div>\n )}\n\n {/* Empty state */}\n {inquiries.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n <div className=\"p-4 rounded-2xl bg-bg-sunken mb-4\">\n <Mail size={48} className=\"text-text-secondary opacity-50\" />\n </div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-2\">No inquiries yet</h3>\n <p className=\"text-sm text-text-secondary\">\n Contact form submissions from your product websites will appear here.\n </p>\n </div>\n ) : (\n <>\n {/* Inquiry list */}\n <div className=\"space-y-3\">\n {inquiries.map((inquiry: ContactInquiry) => (\n <button\n type=\"button\"\n key={inquiry.id}\n onClick={() => navigate(`/support/inquiries/${inquiry.id}${queryParams}`)}\n className=\"w-full text-left p-4 bg-surface border border-default rounded-lg hover:bg-bg-sunken/50 hover:border-accent/30 transition-all duration-200 group\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between\">\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 mb-1\">\n <h3 className=\"text-sm font-semibold text-text-primary truncate group-hover:text-accent transition-colors\">\n {inquiry.subject}\n </h3>\n <span\n className={`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ${statusColors[inquiry.status] || statusColors.NEW}`}\n >\n {statusLabels[inquiry.status] || inquiry.status}\n </span>\n {inquiry.productId && productNames[inquiry.productId] && (\n <span\n className=\"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-accent-purple-subtle text-accent-purple\"\n title={`Product: ${productNames[inquiry.productId]}`}\n >\n {productNames[inquiry.productId]}\n </span>\n )}\n {inquiry.category && (\n <span className=\"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-accent-blue-subtle text-accent-blue\">\n {humanizeCategory(inquiry.category)}\n </span>\n )}\n </div>\n <p className=\"text-sm text-text-secondary mb-1\">\n <span className=\"font-medium\">{inquiry.name}</span>\n <span className=\"mx-1.5 text-text-secondary/50\">·</span>\n <span>{inquiry.email}</span>\n {inquiry.company && (\n <>\n <span className=\"mx-1.5 text-text-secondary/50\">·</span>\n <span>{inquiry.company}</span>\n </>\n )}\n </p>\n <p className=\"text-xs text-text-secondary truncate\">{inquiry.message}</p>\n </div>\n <div className=\"text-xs text-text-secondary sm:whitespace-nowrap\">\n {formatDate(inquiry.createdAt)}\n </div>\n </div>\n </button>\n ))}\n </div>\n\n {/* Load more */}\n {hasMore && (\n <div className=\"flex justify-center mt-6\">\n <button\n type=\"button\"\n onClick={loadMore}\n disabled={loading}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-6 py-2 bg-surface border border-default rounded-lg text-sm text-text-secondary hover:text-text-primary hover:bg-bg-sunken transition-colors disabled:opacity-50\"\n >\n {loading ? <Loader2 size={14} className=\"animate-spin\" /> : null}\n Load more\n </button>\n </div>\n )}\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAaA,IAAM,IAAuC;CAC3C,KAAK;CACL,UAAU;CACV,WAAW;CACX,MAAM;CACN,UAAU;CACX,EAEK,IAAuC;CAC3C,KAAK;CACL,UAAU;CACV,WAAW;CACX,MAAM;CACN,UAAU;CACX;AAED,SAAS,EAAW,GAA4B;AAC9C,QAAO,IAAI,KAAK,EAAW,CAAC,mBAAmB,SAAS;EACtD,OAAO;EACP,KAAK;EACL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D;WAAM,WAAU;qBAAgC;WAAe,CAAA;UAC/D,kBAAC,QAAD,EAAA,UAAO,EAAQ,OAAa,CAAA;UAC3B,EAAQ,WACP,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,QAAD;WAAM,WAAU;qBAAgC;WAAe,CAAA,EAC/D,kBAAC,QAAD,EAAA,UAAO,EAAQ,SAAe,CAAA,CAC7B,EAAA,CAAA;UAEH;;QACJ,kBAAC,KAAD;SAAG,WAAU;mBAAwC,EAAQ;SAAY,CAAA;QACrE;UACN,kBAAC,OAAD;OAAK,WAAU;iBACZ,EAAW,EAAQ,UAAU;OAC1B,CAAA,CACF;;KACC,EA9CF,EAAQ,GA8CN,CACT;IACE,CAAA,EAGL,KACC,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,UAAD;KACE,MAAK;KACL,eAlOS;AAChB,WACL,EAAU;OACR,WAAW,EAAE,QAAQ,EAAU,QAAQ;OACvC,cAAc,GAAM,EAAE,yBACf,IACE,EACL,kBAAkB;QAChB,GAAG,EAAgB;QACnB,OAAO,CACL,GAAI,EAAK,kBAAkB,SAAS,EAAE,EACtC,GAAI,EAAgB,kBAAkB,SAAS,EAAE,CAClD;QACF,EACF,GAT4B;OAWhC,CAAC;;KAmNU,UAAU;KACV,WAAU;eAJZ,CAMG,IAAU,kBAAC,GAAD;MAAS,MAAM;MAAI,WAAU;MAAiB,CAAA,GAAG,MAAK,YAE1D;;IACL,CAAA,CAEP,EAAA,CAAA;GAED"}
|
|
1
|
+
{"version":3,"file":"ContactInquiriesPage.js","names":[],"sources":["../../../src/support/pages/ContactInquiriesPage.tsx"],"sourcesContent":["import { useState, useEffect, useRef } from 'react';\nimport { useNavigate, useLocation } from 'react-router-dom';\nimport { Mail, Search, Filter, Loader2, AlertCircle, ChevronDown } from 'lucide-react';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql/fetch';\nimport {\n useGetContactInquiriesQuery,\n type GetContactInquiriesQuery,\n} from '../../generated/global-operations';\nimport type { ContactInquiryStatus, ContactInquiryFilterInput } from '../../generated/global-types';\nimport { humanizeCategory } from '../utils';\n\ntype ContactInquiry = GetContactInquiriesQuery['contactInquiries']['items'][number];\n\nconst statusColors: Record<string, string> = {\n NEW: 'bg-status-info-bg-subtle text-status-info-text',\n REVIEWED: 'bg-status-warning-bg-subtle text-status-warning-text',\n CONVERTED: 'bg-status-success-bg-subtle text-status-success-text',\n SPAM: 'bg-status-error-bg-subtle text-status-error-text',\n ARCHIVED: 'bg-bg-sunken text-text-secondary',\n};\n\nconst statusLabels: Record<string, string> = {\n NEW: 'New',\n REVIEWED: 'Reviewed',\n CONVERTED: 'Converted',\n SPAM: 'Spam',\n ARCHIVED: 'Archived',\n};\n\nfunction formatDate(dateString: string): string {\n return new Date(dateString).toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n}\n\nexport function ContactInquiriesPage() {\n const navigate = useNavigate();\n const location = useLocation();\n const queryParams = location.search;\n const [search, setSearch] = useState('');\n const [statusFilter, setStatusFilter] = useState<ContactInquiryStatus | ''>('');\n const [productFilter, setProductFilter] = useState('');\n const [showFilters, setShowFilters] = useState(false);\n const [productNames, setProductNames] = useState<Record<string, string>>({});\n // Mirror the latest map into a ref so the resolver effect can read it\n // without re-running every time we cache a freshly-resolved name.\n const productNamesRef = useRef(productNames);\n productNamesRef.current = productNames;\n\n const filter: ContactInquiryFilterInput = {};\n if (search) filter.search = search;\n if (statusFilter) filter.status = statusFilter;\n if (productFilter) filter.productId = productFilter;\n\n const { data, loading, error, fetchMore } = useGetContactInquiriesQuery({\n variables: { filter, limit: 50, offset: 0 },\n fetchPolicy: 'cache-and-network',\n });\n\n const inquiries = data?.contactInquiries?.items ?? [];\n const total = data?.contactInquiries?.total ?? 0;\n const hasMore = data?.contactInquiries?.hasMore ?? false;\n\n // Fetch product names for the filter dropdown. We key the effect off a\n // stable string so a new array reference per render doesn't retrigger.\n const productIds = Array.from(\n new Set(inquiries.flatMap((i: ContactInquiry): string[] => (i.productId ? [i.productId] : [])))\n ).sort() as string[];\n const productIdsKey = productIds.join(',');\n useEffect(() => {\n const unknownIds = productIdsKey\n ? productIdsKey.split(',').filter((pid) => !productNamesRef.current[pid])\n : [];\n if (unknownIds.length === 0) return;\n unknownIds.forEach((pid) => {\n graphqlFetch<{ platformProduct?: { name?: string } }>({\n gateway: 'global',\n query: 'query($id: ID!) { platformProduct(id: $id) { name } }',\n variables: { id: pid },\n })\n .then((result) => {\n const name = result.data?.platformProduct?.name;\n if (name) setProductNames((prev) => ({ ...prev, [pid]: name }));\n })\n .catch(() => {});\n });\n }, [productIdsKey]);\n\n const loadMore = () => {\n if (!hasMore) return;\n fetchMore({\n variables: { offset: inquiries.length },\n updateQuery: (prev, { fetchMoreResult }) => {\n if (!fetchMoreResult) return prev;\n return {\n contactInquiries: {\n ...fetchMoreResult.contactInquiries,\n items: [\n ...(prev.contactInquiries?.items ?? []),\n ...(fetchMoreResult.contactInquiries?.items ?? []),\n ],\n },\n };\n },\n });\n };\n\n // Loading state\n if (loading && inquiries.length === 0) {\n return (\n <div className=\"p-3 sm:p-6\">\n <div className=\"flex items-center gap-3 mb-6\">\n <Mail size={24} className=\"text-text-primary\" />\n <h1 className=\"text-2xl font-bold text-text-primary\">Contact Inquiries</h1>\n </div>\n <div className=\"flex flex-col items-center justify-center py-16\">\n <Loader2 size={32} className=\"animate-spin text-text-secondary mb-4\" />\n <p className=\"text-sm text-text-secondary\">Loading inquiries…</p>\n </div>\n </div>\n );\n }\n\n // Error state\n if (error) {\n return (\n <div className=\"p-3 sm:p-6\">\n <div className=\"flex items-center gap-3 mb-6\">\n <Mail size={24} className=\"text-text-primary\" />\n <h1 className=\"text-2xl font-bold text-text-primary\">Contact Inquiries</h1>\n </div>\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n <div className=\"p-4 rounded-2xl bg-status-error-bg-subtle text-status-error-text mb-4\">\n <AlertCircle size={48} />\n </div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-2\">Failed to load inquiries</h3>\n <p className=\"text-sm text-text-secondary\">{error.message}</p>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"p-3 sm:p-6\">\n {/* Header */}\n <div className=\"flex flex-col gap-3 mb-6 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"flex items-center gap-3\">\n <Mail size={24} className=\"text-text-primary\" />\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">Contact Inquiries</h1>\n <p className=\"text-sm text-text-secondary\">Website contact form submissions</p>\n </div>\n <span className=\"ml-2 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-bg-sunken text-text-secondary\">\n {total}\n </span>\n </div>\n </div>\n\n {/* Toolbar */}\n <div className=\"flex flex-col sm:flex-row gap-3 mb-6\">\n {/* Search */}\n <div className=\"relative flex-1\">\n <Search\n size={16}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary\"\n />\n <input\n type=\"text\"\n aria-label=\"Search inquiries\"\n placeholder=\"Search by name, email, or subject...\"\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n className=\"w-full pl-9 pr-4 py-2 bg-surface border border-default rounded-lg text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-accent/50\"\n />\n </div>\n\n {/* Filter toggle */}\n <button\n type=\"button\"\n onClick={() => setShowFilters(!showFilters)}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 bg-surface border border-default rounded-lg text-sm text-text-secondary hover:text-text-primary hover:bg-bg-sunken transition-colors\"\n >\n <Filter size={16} />\n Filters\n <ChevronDown\n size={14}\n className={showFilters ? 'rotate-180 transition-transform' : 'transition-transform'}\n />\n </button>\n </div>\n\n {/* Filters panel */}\n {showFilters && (\n <div className=\"mb-6 p-4 bg-bg-surface border border-border-seam rounded-lg\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label\n className=\"block text-xs font-medium text-text-secondary mb-1\"\n htmlFor=\"contactinquiriespage-status-0\"\n >\n Status\n </label>\n <select\n id=\"contactinquiriespage-status-0\"\n value={statusFilter}\n onChange={(e) => setStatusFilter(e.target.value as ContactInquiryStatus | '')}\n className=\"min-h-11 w-full px-3 py-2 bg-surface border border-default rounded-lg text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-accent/50\"\n >\n <option value=\"\">All statuses</option>\n <option value=\"NEW\">New</option>\n <option value=\"REVIEWED\">Reviewed</option>\n <option value=\"CONVERTED\">Converted</option>\n <option value=\"SPAM\">Spam</option>\n <option value=\"ARCHIVED\">Archived</option>\n </select>\n </div>\n <div>\n <label\n className=\"block text-xs font-medium text-text-secondary mb-1\"\n htmlFor=\"contactinquiriespage-product-2\"\n >\n Product\n </label>\n <select\n id=\"contactinquiriespage-product-2\"\n value={productFilter}\n onChange={(e) => setProductFilter(e.target.value)}\n className=\"min-h-11 w-full px-3 py-2 bg-surface border border-default rounded-lg text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-accent/50\"\n >\n <option value=\"\">All products</option>\n {productIds.map((pid) => (\n <option key={pid} value={pid}>\n {productNames[pid] || pid}\n </option>\n ))}\n </select>\n </div>\n </div>\n </div>\n )}\n\n {/* Empty state */}\n {inquiries.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n <div className=\"p-4 rounded-2xl bg-bg-sunken mb-4\">\n <Mail size={48} className=\"text-text-secondary opacity-50\" />\n </div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-2\">No inquiries yet</h3>\n <p className=\"text-sm text-text-secondary\">\n Contact form submissions from your product websites will appear here.\n </p>\n </div>\n ) : (\n <>\n {/* Inquiry list */}\n <div className=\"space-y-3\">\n {inquiries.map((inquiry: ContactInquiry) => (\n <button\n type=\"button\"\n key={inquiry.id}\n onClick={() => navigate(`/support/inquiries/${inquiry.id}${queryParams}`)}\n className=\"w-full text-left p-4 bg-bg-surface border border-border-seam rounded-lg shadow-[var(--shadow-pop)] hover:border-border-strong hover:shadow-[var(--shadow-pop-hover)] transition-[box-shadow,border-color] duration-200 group\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between\">\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 mb-1\">\n <h3 className=\"text-sm font-semibold text-text-primary truncate group-hover:text-accent transition-colors\">\n {inquiry.subject}\n </h3>\n <span\n className={`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ${statusColors[inquiry.status] || statusColors.NEW}`}\n >\n {statusLabels[inquiry.status] || inquiry.status}\n </span>\n {inquiry.productId && productNames[inquiry.productId] && (\n <span\n className=\"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-accent-purple-subtle text-accent-purple\"\n title={`Product: ${productNames[inquiry.productId]}`}\n >\n {productNames[inquiry.productId]}\n </span>\n )}\n {inquiry.category && (\n <span className=\"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-accent-blue-subtle text-accent-blue\">\n {humanizeCategory(inquiry.category)}\n </span>\n )}\n </div>\n <p className=\"text-sm text-text-secondary mb-1\">\n <span className=\"font-medium\">{inquiry.name}</span>\n <span className=\"mx-1.5 text-text-secondary/50\">·</span>\n <span>{inquiry.email}</span>\n {inquiry.company && (\n <>\n <span className=\"mx-1.5 text-text-secondary/50\">·</span>\n <span>{inquiry.company}</span>\n </>\n )}\n </p>\n <p className=\"text-xs text-text-secondary truncate\">{inquiry.message}</p>\n </div>\n <div className=\"text-xs text-text-secondary sm:whitespace-nowrap\">\n {formatDate(inquiry.createdAt)}\n </div>\n </div>\n </button>\n ))}\n </div>\n\n {/* Load more */}\n {hasMore && (\n <div className=\"flex justify-center mt-6\">\n <button\n type=\"button\"\n onClick={loadMore}\n disabled={loading}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-6 py-2 bg-surface border border-default rounded-lg text-sm text-text-secondary hover:text-text-primary hover:bg-bg-sunken transition-colors disabled:opacity-50\"\n >\n {loading ? <Loader2 size={14} className=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,CAEP,EAAA,CAAA;GAED"}
|
|
@@ -210,7 +210,7 @@ function j() {
|
|
|
210
210
|
className: "lg:col-span-2 space-y-5",
|
|
211
211
|
children: [
|
|
212
212
|
/* @__PURE__ */ O("div", {
|
|
213
|
-
className: "bg-[var(--color-bg-surface)] border border-
|
|
213
|
+
className: "bg-[var(--color-bg-surface)] border border-border-seam rounded-xl overflow-hidden shadow-[var(--shadow-pop)]",
|
|
214
214
|
children: [/* @__PURE__ */ D("div", {
|
|
215
215
|
className: "px-5 py-3.5 border-b border-[var(--color-border-default)] bg-[var(--color-bg-muted)]/50",
|
|
216
216
|
children: /* @__PURE__ */ O("h2", {
|
|
@@ -343,7 +343,7 @@ function j() {
|
|
|
343
343
|
})]
|
|
344
344
|
}),
|
|
345
345
|
/* @__PURE__ */ O("div", {
|
|
346
|
-
className: "bg-[var(--color-bg-surface)] border border-
|
|
346
|
+
className: "bg-[var(--color-bg-surface)] border border-border-seam rounded-xl overflow-hidden shadow-[var(--shadow-pop)]",
|
|
347
347
|
children: [/* @__PURE__ */ D("div", {
|
|
348
348
|
className: "px-5 py-3.5 border-b border-[var(--color-border-default)] bg-[var(--color-bg-muted)]/50",
|
|
349
349
|
children: /* @__PURE__ */ O("h2", {
|
|
@@ -359,7 +359,7 @@ function j() {
|
|
|
359
359
|
})]
|
|
360
360
|
}),
|
|
361
361
|
X.metadata && Object.keys(X.metadata).length > 0 && /* @__PURE__ */ O("div", {
|
|
362
|
-
className: "bg-[var(--color-bg-surface)] border border-
|
|
362
|
+
className: "bg-[var(--color-bg-surface)] border border-border-seam rounded-xl overflow-hidden shadow-[var(--shadow-pop)]",
|
|
363
363
|
children: [/* @__PURE__ */ D("div", {
|
|
364
364
|
className: "px-5 py-3.5 border-b border-[var(--color-border-default)] bg-[var(--color-bg-muted)]/50",
|
|
365
365
|
children: /* @__PURE__ */ O("h2", {
|
|
@@ -388,7 +388,7 @@ function j() {
|
|
|
388
388
|
className: "space-y-5",
|
|
389
389
|
children: [
|
|
390
390
|
/* @__PURE__ */ O("div", {
|
|
391
|
-
className: "bg-[var(--color-bg-surface)] border border-
|
|
391
|
+
className: "bg-[var(--color-bg-surface)] border border-border-seam rounded-xl overflow-hidden shadow-[var(--shadow-pop)]",
|
|
392
392
|
children: [/* @__PURE__ */ D("div", {
|
|
393
393
|
className: "px-5 py-3.5 border-b border-[var(--color-border-default)] bg-[var(--color-bg-muted)]/50",
|
|
394
394
|
children: /* @__PURE__ */ O("h2", {
|
|
@@ -432,7 +432,7 @@ function j() {
|
|
|
432
432
|
})]
|
|
433
433
|
}),
|
|
434
434
|
/* @__PURE__ */ O("div", {
|
|
435
|
-
className: "bg-[var(--color-bg-surface)] border border-
|
|
435
|
+
className: "bg-[var(--color-bg-surface)] border border-border-seam rounded-xl overflow-hidden shadow-[var(--shadow-pop)]",
|
|
436
436
|
children: [/* @__PURE__ */ D("div", {
|
|
437
437
|
className: "px-5 py-3.5 border-b border-[var(--color-border-default)] bg-[var(--color-bg-muted)]/50",
|
|
438
438
|
children: /* @__PURE__ */ O("h2", {
|
|
@@ -469,7 +469,7 @@ function j() {
|
|
|
469
469
|
})]
|
|
470
470
|
}),
|
|
471
471
|
/* @__PURE__ */ O("div", {
|
|
472
|
-
className: "bg-[var(--color-bg-surface)] border border-
|
|
472
|
+
className: "bg-[var(--color-bg-surface)] border border-border-seam rounded-xl overflow-hidden shadow-[var(--shadow-pop)]",
|
|
473
473
|
children: [/* @__PURE__ */ D("div", {
|
|
474
474
|
className: "px-5 py-3.5 border-b border-[var(--color-border-default)] bg-[var(--color-bg-muted)]/50",
|
|
475
475
|
children: /* @__PURE__ */ D("h2", {
|