@burdenoff/microfe-support 2026.527.2 → 2026.527.4
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/SupportAdminRoutes.js +49 -38
- package/dist/support/SupportAdminRoutes.js.map +1 -1
- package/dist/support/SupportUserRoutes.js +33 -22
- package/dist/support/SupportUserRoutes.js.map +1 -1
- package/dist/support/components/PageLayout.js +2 -2
- package/dist/support/components/PageLayout.js.map +1 -1
- package/dist/support/components/RouteHelpers.js +1 -1
- package/dist/support/components/RouteHelpers.js.map +1 -1
- package/dist/support/components/analytics/TrendChart.js +5 -5
- package/dist/support/components/analytics/TrendChart.js.map +1 -1
- package/dist/support/components/kb/ArticleForm.js +97 -94
- package/dist/support/components/kb/ArticleForm.js.map +1 -1
- package/dist/support/components/settings/CannedResponsesSettings.js +14 -2
- package/dist/support/components/settings/CannedResponsesSettings.js.map +1 -1
- package/dist/support/components/settings/SLAPoliciesSettings.js +19 -1
- package/dist/support/components/settings/SLAPoliciesSettings.js.map +1 -1
- package/dist/support/components/settings/TicketCategoriesSettings.js +27 -6
- package/dist/support/components/settings/TicketCategoriesSettings.js.map +1 -1
- package/dist/support/components/tickets/AttachmentList.js +1 -1
- package/dist/support/components/tickets/AttachmentList.js.map +1 -1
- package/dist/support/components/tickets/MessageComposer.js +59 -56
- package/dist/support/components/tickets/MessageComposer.js.map +1 -1
- package/dist/support/components/tickets/TicketHeader.js +1 -0
- package/dist/support/components/tickets/TicketHeader.js.map +1 -1
- package/dist/support/components/tickets/TicketSidebar.js +4 -4
- package/dist/support/components/tickets/TicketSidebar.js.map +1 -1
- package/dist/support/hooks/useAnalyticsOperations.js.map +1 -1
- package/dist/support/hooks/useSupportAttachments.js +20 -12
- package/dist/support/hooks/useSupportAttachments.js.map +1 -1
- package/dist/support/hooks/useTicketListOperations.js +1 -1
- package/dist/support/hooks/useTicketListOperations.js.map +1 -1
- package/dist/support/hooks/useTicketOperations.js +1 -1
- package/dist/support/hooks/useTicketOperations.js.map +1 -1
- package/dist/support/pages/ArticleDetailAdminPage.js +5 -5
- package/dist/support/pages/ArticleDetailAdminPage.js.map +1 -1
- package/dist/support/pages/ContactInquiriesPage.js +118 -108
- package/dist/support/pages/ContactInquiriesPage.js.map +1 -1
- package/dist/support/pages/ContactInquiryDetailPage.js +21 -12
- package/dist/support/pages/ContactInquiryDetailPage.js.map +1 -1
- package/dist/support/pages/CreateArticlePage.js +0 -1
- package/dist/support/pages/CreateArticlePage.js.map +1 -1
- package/dist/support/pages/CreateTicketPage.js +6 -3
- package/dist/support/pages/CreateTicketPage.js.map +1 -1
- package/dist/support/pages/EditArticlePage.js +0 -1
- package/dist/support/pages/EditArticlePage.js.map +1 -1
- package/dist/support/pages/JobApplicationDetailPage.js +26 -17
- package/dist/support/pages/JobApplicationDetailPage.js.map +1 -1
- package/dist/support/pages/JobApplicationsPage.js +121 -113
- package/dist/support/pages/JobApplicationsPage.js.map +1 -1
- package/dist/support/pages/KnowledgeBaseAdminPage.js +3 -0
- package/dist/support/pages/KnowledgeBaseAdminPage.js.map +1 -1
- package/dist/support/pages/KnowledgeBaseUserPage.js +3 -0
- package/dist/support/pages/KnowledgeBaseUserPage.js.map +1 -1
- package/dist/support/pages/SettingsPage.js +1 -0
- package/dist/support/pages/SettingsPage.js.map +1 -1
- package/dist/support/pages/TicketDetailAdminPage.js +4 -0
- package/dist/support/pages/TicketDetailAdminPage.js.map +1 -1
- package/dist/support/pages/TicketDetailUserPage.js +5 -0
- package/dist/support/pages/TicketDetailUserPage.js.map +1 -1
- package/dist/support/pages/TicketListPage.js +15 -2
- package/dist/support/pages/TicketListPage.js.map +1 -1
- package/dist/support/providers/SupportProvider.js +1 -1
- package/dist/support/providers/SupportProvider.js.map +1 -1
- package/dist/support/utils/supportFiles.js +14 -15
- package/dist/support/utils/supportFiles.js.map +1 -1
- package/dist/support/utils/uiTokens.js.map +1 -1
- package/package.json +1 -1
- package/dist/support/components/kb/index.js +0 -1
|
@@ -1,257 +1,260 @@
|
|
|
1
1
|
import { Button as e, Input as t } from "../ui.js";
|
|
2
2
|
import { renderSupportMarkdown as n } from "../../utils/markdown.js";
|
|
3
|
-
import { useMemo as r,
|
|
4
|
-
import { Edit as
|
|
5
|
-
import { Fragment as
|
|
3
|
+
import { useMemo as r, useRef as i, useState as a } from "react";
|
|
4
|
+
import { Edit as o, Eye as s, Loader2 as c, Save as l, X as u } from "lucide-react";
|
|
5
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
6
6
|
//#region src/support/components/kb/ArticleForm.tsx
|
|
7
|
-
function
|
|
7
|
+
function m(e) {
|
|
8
8
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").substring(0, 100);
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
let [
|
|
12
|
-
title:
|
|
13
|
-
slug:
|
|
14
|
-
content:
|
|
15
|
-
excerpt:
|
|
16
|
-
categoryId:
|
|
17
|
-
tags:
|
|
18
|
-
metaDescription:
|
|
19
|
-
status:
|
|
20
|
-
}), [
|
|
21
|
-
if (!
|
|
10
|
+
function h({ initialData: h, categories: g, onSubmit: _, onCancel: v, isSubmitting: y, submitLabel: b = "Save Article" }) {
|
|
11
|
+
let [x, S] = a({
|
|
12
|
+
title: h?.title || "",
|
|
13
|
+
slug: h?.slug || "",
|
|
14
|
+
content: h?.content || "",
|
|
15
|
+
excerpt: h?.excerpt || "",
|
|
16
|
+
categoryId: h?.categoryId || "",
|
|
17
|
+
tags: h?.tags || [],
|
|
18
|
+
metaDescription: h?.metaDescription || "",
|
|
19
|
+
status: h?.status || "DRAFT"
|
|
20
|
+
}), [C, w] = a(h?.tags?.join(", ") || ""), T = i(!1), [E, D] = a(!1), O = r(() => {
|
|
21
|
+
if (!x.content) return "";
|
|
22
22
|
try {
|
|
23
|
-
return n(
|
|
23
|
+
return n(x.content);
|
|
24
24
|
} catch {
|
|
25
|
-
return
|
|
25
|
+
return x.content;
|
|
26
26
|
}
|
|
27
|
-
}, [
|
|
28
|
-
|
|
27
|
+
}, [x.content]), k = (e) => {
|
|
28
|
+
T.current ? S((t) => ({
|
|
29
29
|
...t,
|
|
30
30
|
title: e
|
|
31
|
-
}) : (t) => ({
|
|
31
|
+
})) : S((t) => ({
|
|
32
32
|
...t,
|
|
33
33
|
title: e,
|
|
34
|
-
slug:
|
|
34
|
+
slug: m(e)
|
|
35
35
|
}));
|
|
36
36
|
}, A = (e) => {
|
|
37
|
-
|
|
37
|
+
w(e);
|
|
38
38
|
let t = e.split(",").map((e) => e.trim()).filter((e) => e.length > 0);
|
|
39
|
-
|
|
39
|
+
S((e) => ({
|
|
40
40
|
...e,
|
|
41
41
|
tags: t
|
|
42
42
|
}));
|
|
43
43
|
}, j = (e) => {
|
|
44
|
-
T
|
|
44
|
+
T.current = !0, S((t) => ({
|
|
45
45
|
...t,
|
|
46
46
|
slug: e
|
|
47
47
|
}));
|
|
48
48
|
}, M = async (e) => {
|
|
49
|
-
e.preventDefault(), await
|
|
50
|
-
}, N =
|
|
51
|
-
return /* @__PURE__ */
|
|
49
|
+
e.preventDefault(), await _(x);
|
|
50
|
+
}, N = x.title.trim() && x.slug.trim() && x.content.trim();
|
|
51
|
+
return /* @__PURE__ */ p("form", {
|
|
52
52
|
onSubmit: M,
|
|
53
53
|
className: "space-y-6",
|
|
54
|
-
children: [/* @__PURE__ */
|
|
54
|
+
children: [/* @__PURE__ */ p("div", {
|
|
55
55
|
className: "p-6 rounded-xl border bg-card space-y-6",
|
|
56
56
|
children: [
|
|
57
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("label", {
|
|
58
58
|
htmlFor: "support-article-title",
|
|
59
59
|
className: "mb-2 block text-sm font-medium text-foreground",
|
|
60
|
-
children: ["Title ", /* @__PURE__ */
|
|
60
|
+
children: ["Title ", /* @__PURE__ */ f("span", {
|
|
61
61
|
className: "text-destructive",
|
|
62
62
|
children: "*"
|
|
63
63
|
})]
|
|
64
|
-
}), /* @__PURE__ */
|
|
64
|
+
}), /* @__PURE__ */ f(t, {
|
|
65
65
|
id: "support-article-title",
|
|
66
66
|
type: "text",
|
|
67
67
|
required: !0,
|
|
68
|
-
value:
|
|
68
|
+
value: x.title,
|
|
69
69
|
onChange: (e) => k(e.target.value),
|
|
70
70
|
placeholder: "Article title"
|
|
71
71
|
})] }),
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ p("div", { children: [
|
|
73
|
+
/* @__PURE__ */ p("label", {
|
|
74
74
|
htmlFor: "support-article-slug",
|
|
75
75
|
className: "mb-2 block text-sm font-medium text-foreground",
|
|
76
|
-
children: ["URL Slug ", /* @__PURE__ */
|
|
76
|
+
children: ["URL Slug ", /* @__PURE__ */ f("span", {
|
|
77
77
|
className: "text-destructive",
|
|
78
78
|
children: "*"
|
|
79
79
|
})]
|
|
80
80
|
}),
|
|
81
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ p("div", {
|
|
82
82
|
className: "flex flex-col gap-2 sm:flex-row sm:items-center",
|
|
83
|
-
children: [/* @__PURE__ */
|
|
83
|
+
children: [/* @__PURE__ */ f("span", {
|
|
84
84
|
className: "text-sm text-muted-foreground",
|
|
85
85
|
children: "/kb/articles/"
|
|
86
|
-
}), /* @__PURE__ */
|
|
86
|
+
}), /* @__PURE__ */ f(t, {
|
|
87
87
|
id: "support-article-slug",
|
|
88
88
|
type: "text",
|
|
89
89
|
required: !0,
|
|
90
|
-
value:
|
|
90
|
+
value: x.slug,
|
|
91
91
|
onChange: (e) => j(e.target.value),
|
|
92
92
|
placeholder: "article-url-slug",
|
|
93
93
|
className: "flex-1"
|
|
94
94
|
})]
|
|
95
95
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ f("p", {
|
|
97
97
|
className: "text-xs text-muted-foreground mt-1",
|
|
98
98
|
children: "Auto-generated from title. Edit to customize."
|
|
99
99
|
})
|
|
100
100
|
] }),
|
|
101
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
102
102
|
htmlFor: "support-article-excerpt",
|
|
103
103
|
className: "mb-2 block text-sm font-medium text-foreground",
|
|
104
104
|
children: "Excerpt"
|
|
105
|
-
}), /* @__PURE__ */
|
|
105
|
+
}), /* @__PURE__ */ f("textarea", {
|
|
106
106
|
id: "support-article-excerpt",
|
|
107
|
+
"aria-label": "Excerpt",
|
|
107
108
|
rows: 3,
|
|
108
|
-
value:
|
|
109
|
-
onChange: (e) =>
|
|
110
|
-
...
|
|
109
|
+
value: x.excerpt,
|
|
110
|
+
onChange: (e) => S({
|
|
111
|
+
...x,
|
|
111
112
|
excerpt: e.target.value
|
|
112
113
|
}),
|
|
113
114
|
className: "w-full px-4 py-3 rounded-lg border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors",
|
|
114
115
|
placeholder: "Brief summary of the article (displayed in search results)"
|
|
115
116
|
})] }),
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ p("div", { children: [
|
|
118
|
+
/* @__PURE__ */ p("div", {
|
|
118
119
|
className: "flex items-center justify-between mb-2",
|
|
119
|
-
children: [/* @__PURE__ */
|
|
120
|
+
children: [/* @__PURE__ */ p("label", {
|
|
120
121
|
htmlFor: "support-article-content",
|
|
121
122
|
className: "text-sm font-medium text-foreground",
|
|
122
|
-
children: ["Content ", /* @__PURE__ */
|
|
123
|
+
children: ["Content ", /* @__PURE__ */ f("span", {
|
|
123
124
|
className: "text-destructive",
|
|
124
125
|
children: "*"
|
|
125
126
|
})]
|
|
126
|
-
}), /* @__PURE__ */
|
|
127
|
+
}), /* @__PURE__ */ f(e, {
|
|
127
128
|
type: "button",
|
|
128
129
|
variant: "ghost",
|
|
129
130
|
size: "sm",
|
|
130
131
|
onClick: () => D(!E),
|
|
131
132
|
className: "text-xs",
|
|
132
|
-
children: E ? /* @__PURE__ */
|
|
133
|
+
children: E ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(o, { size: 14 }), "Edit"] }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(s, { size: 14 }), "Preview"] })
|
|
133
134
|
})]
|
|
134
135
|
}),
|
|
135
|
-
E ? /* @__PURE__ */
|
|
136
|
+
E ? /* @__PURE__ */ f("div", {
|
|
136
137
|
className: "w-full min-h-[400px] px-4 py-3 rounded-lg border bg-background overflow-auto",
|
|
137
|
-
children: /* @__PURE__ */
|
|
138
|
+
children: /* @__PURE__ */ f("div", {
|
|
138
139
|
className: "prose prose-sm max-w-none dark:prose-invert",
|
|
139
140
|
dangerouslySetInnerHTML: { __html: O || "<p class=\"text-muted-foreground\">Nothing to preview</p>" }
|
|
140
141
|
})
|
|
141
|
-
}) : /* @__PURE__ */
|
|
142
|
+
}) : /* @__PURE__ */ f("textarea", {
|
|
142
143
|
id: "support-article-content",
|
|
144
|
+
"aria-label": "Article content",
|
|
143
145
|
required: !0,
|
|
144
146
|
rows: 20,
|
|
145
|
-
value:
|
|
146
|
-
onChange: (e) =>
|
|
147
|
-
...
|
|
147
|
+
value: x.content,
|
|
148
|
+
onChange: (e) => S({
|
|
149
|
+
...x,
|
|
148
150
|
content: e.target.value
|
|
149
151
|
}),
|
|
150
152
|
className: "w-full px-4 py-3 rounded-lg border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors font-mono text-sm",
|
|
151
153
|
placeholder: "Article content (supports Markdown)"
|
|
152
154
|
}),
|
|
153
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ f("p", {
|
|
154
156
|
className: "text-xs text-muted-foreground mt-1",
|
|
155
157
|
children: "Supports Markdown: **bold**, *italic*, # headings, - lists, [links](url), ```code```"
|
|
156
158
|
})
|
|
157
159
|
] }),
|
|
158
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
159
161
|
htmlFor: "support-article-category",
|
|
160
162
|
className: "mb-2 block text-sm font-medium text-foreground",
|
|
161
163
|
children: "Category"
|
|
162
|
-
}), /* @__PURE__ */
|
|
164
|
+
}), /* @__PURE__ */ p("select", {
|
|
163
165
|
id: "support-article-category",
|
|
164
|
-
value:
|
|
165
|
-
onChange: (e) =>
|
|
166
|
-
...
|
|
166
|
+
value: x.categoryId,
|
|
167
|
+
onChange: (e) => S({
|
|
168
|
+
...x,
|
|
167
169
|
categoryId: e.target.value
|
|
168
170
|
}),
|
|
169
171
|
className: "w-full px-4 py-3 rounded-lg border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors",
|
|
170
|
-
children: [/* @__PURE__ */
|
|
172
|
+
children: [/* @__PURE__ */ f("option", {
|
|
171
173
|
value: "",
|
|
172
174
|
children: "Select a category"
|
|
173
|
-
}),
|
|
175
|
+
}), g.map((e) => /* @__PURE__ */ f("option", {
|
|
174
176
|
value: e.id,
|
|
175
177
|
children: e.name
|
|
176
178
|
}, e.id))]
|
|
177
179
|
})] }),
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ p("div", { children: [
|
|
181
|
+
/* @__PURE__ */ f("label", {
|
|
180
182
|
htmlFor: "support-article-tags",
|
|
181
183
|
className: "mb-2 block text-sm font-medium text-foreground",
|
|
182
184
|
children: "Tags"
|
|
183
185
|
}),
|
|
184
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ f(t, {
|
|
185
187
|
id: "support-article-tags",
|
|
186
188
|
type: "text",
|
|
187
|
-
value:
|
|
189
|
+
value: C,
|
|
188
190
|
onChange: (e) => A(e.target.value),
|
|
189
191
|
placeholder: "Enter tags separated by commas (e.g., billing, account, setup)"
|
|
190
192
|
}),
|
|
191
|
-
|
|
193
|
+
x.tags.length > 0 && /* @__PURE__ */ f("div", {
|
|
192
194
|
className: "flex flex-wrap gap-2 mt-2",
|
|
193
|
-
children:
|
|
195
|
+
children: x.tags.map((e) => /* @__PURE__ */ f("span", {
|
|
194
196
|
className: "px-2 py-1 text-xs rounded-full bg-primary/10 text-primary",
|
|
195
197
|
children: e
|
|
196
|
-
},
|
|
198
|
+
}, e))
|
|
197
199
|
})
|
|
198
200
|
] }),
|
|
199
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
200
202
|
htmlFor: "support-article-meta-description",
|
|
201
203
|
className: "mb-2 block text-sm font-medium text-foreground",
|
|
202
204
|
children: "Meta Description"
|
|
203
|
-
}), /* @__PURE__ */
|
|
205
|
+
}), /* @__PURE__ */ f("textarea", {
|
|
204
206
|
id: "support-article-meta-description",
|
|
207
|
+
"aria-label": "Meta Description",
|
|
205
208
|
rows: 2,
|
|
206
|
-
value:
|
|
207
|
-
onChange: (e) =>
|
|
208
|
-
...
|
|
209
|
+
value: x.metaDescription,
|
|
210
|
+
onChange: (e) => S({
|
|
211
|
+
...x,
|
|
209
212
|
metaDescription: e.target.value
|
|
210
213
|
}),
|
|
211
214
|
className: "w-full px-4 py-3 rounded-lg border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors",
|
|
212
215
|
placeholder: "SEO meta description (optional)"
|
|
213
216
|
})] }),
|
|
214
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
215
218
|
htmlFor: "support-article-status",
|
|
216
219
|
className: "mb-2 block text-sm font-medium text-foreground",
|
|
217
220
|
children: "Status"
|
|
218
|
-
}), /* @__PURE__ */
|
|
221
|
+
}), /* @__PURE__ */ p("select", {
|
|
219
222
|
id: "support-article-status",
|
|
220
|
-
value:
|
|
221
|
-
onChange: (e) =>
|
|
222
|
-
...
|
|
223
|
+
value: x.status,
|
|
224
|
+
onChange: (e) => S({
|
|
225
|
+
...x,
|
|
223
226
|
status: e.target.value
|
|
224
227
|
}),
|
|
225
228
|
className: "w-full px-4 py-3 rounded-lg border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors",
|
|
226
|
-
children: [/* @__PURE__ */
|
|
229
|
+
children: [/* @__PURE__ */ f("option", {
|
|
227
230
|
value: "DRAFT",
|
|
228
231
|
children: "Draft - Not visible to users"
|
|
229
|
-
}), /* @__PURE__ */
|
|
232
|
+
}), /* @__PURE__ */ f("option", {
|
|
230
233
|
value: "PUBLISHED",
|
|
231
234
|
children: "Published - Visible to all users"
|
|
232
235
|
})]
|
|
233
236
|
})] })
|
|
234
237
|
]
|
|
235
|
-
}), /* @__PURE__ */
|
|
238
|
+
}), /* @__PURE__ */ p("div", {
|
|
236
239
|
className: "flex gap-3",
|
|
237
|
-
children: [/* @__PURE__ */
|
|
240
|
+
children: [/* @__PURE__ */ f(e, {
|
|
238
241
|
type: "submit",
|
|
239
|
-
disabled:
|
|
242
|
+
disabled: y || !N,
|
|
240
243
|
className: "flex-1",
|
|
241
|
-
children:
|
|
244
|
+
children: y ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(c, {
|
|
242
245
|
size: 18,
|
|
243
246
|
className: "animate-spin"
|
|
244
|
-
}), "Saving
|
|
245
|
-
}), /* @__PURE__ */
|
|
247
|
+
}), "Saving…"] }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(l, { size: 18 }), b] })
|
|
248
|
+
}), /* @__PURE__ */ p(e, {
|
|
246
249
|
type: "button",
|
|
247
250
|
variant: "outline",
|
|
248
|
-
onClick:
|
|
249
|
-
children: [/* @__PURE__ */
|
|
251
|
+
onClick: v,
|
|
252
|
+
children: [/* @__PURE__ */ f(u, { size: 18 }), "Cancel"]
|
|
250
253
|
})]
|
|
251
254
|
})]
|
|
252
255
|
});
|
|
253
256
|
}
|
|
254
257
|
//#endregion
|
|
255
|
-
export {
|
|
258
|
+
export { h as ArticleForm };
|
|
256
259
|
|
|
257
260
|
//# sourceMappingURL=ArticleForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleForm.js","names":[],"sources":["../../../../src/support/components/kb/ArticleForm.tsx"],"sourcesContent":["import { useState, useMemo } from 'react';\nimport { Loader2, Save, X, Eye, Edit } from 'lucide-react';\nimport { Button, Input } from '../ui';\nimport { renderSupportMarkdown } from '../../utils/markdown';\n\nexport interface ArticleFormData {\n title: string;\n slug: string;\n content: string;\n excerpt: string;\n categoryId: string;\n tags: string[];\n metaDescription: string;\n status: 'DRAFT' | 'PUBLISHED';\n}\n\ninterface Category {\n id: string;\n name: string;\n color?: string;\n}\n\ninterface ArticleFormProps {\n initialData?: Partial<ArticleFormData>;\n categories: Category[];\n onSubmit: (data: ArticleFormData) => Promise<void>;\n onCancel: () => void;\n isSubmitting: boolean;\n submitLabel?: string;\n}\n\n// Generate URL-friendly slug from title\nfunction generateSlug(title: string): string {\n return title\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .substring(0, 100);\n}\n\nexport function ArticleForm({\n initialData,\n categories,\n onSubmit,\n onCancel,\n isSubmitting,\n submitLabel = 'Save Article',\n}: ArticleFormProps) {\n const [formData, setFormData] = useState<ArticleFormData>({\n title: initialData?.title || '',\n slug: initialData?.slug || '',\n content: initialData?.content || '',\n excerpt: initialData?.excerpt || '',\n categoryId: initialData?.categoryId || '',\n tags: initialData?.tags || [],\n metaDescription: initialData?.metaDescription || '',\n status: initialData?.status || 'DRAFT',\n });\n\n const [tagsInput, setTagsInput] = useState(initialData?.tags?.join(', ') || '');\n const [slugManuallyEdited, setSlugManuallyEdited] = useState(false);\n const [showPreview, setShowPreview] = useState(false);\n\n // Parse markdown content for preview\n const parsedContent = useMemo(() => {\n if (!formData.content) return '';\n try {\n return renderSupportMarkdown(formData.content);\n } catch {\n return formData.content;\n }\n }, [formData.content]);\n\n // Handle title change with auto-slug generation\n const handleTitleChange = (title: string) => {\n if (!slugManuallyEdited) {\n setFormData((prev) => ({\n ...prev,\n title,\n slug: generateSlug(title),\n }));\n } else {\n setFormData((prev) => ({ ...prev, title }));\n }\n };\n\n // Parse tags from comma-separated input\n const handleTagsChange = (value: string) => {\n setTagsInput(value);\n const tags = value\n .split(',')\n .map((tag) => tag.trim())\n .filter((tag) => tag.length > 0);\n setFormData((prev) => ({ ...prev, tags }));\n };\n\n const handleSlugChange = (value: string) => {\n setSlugManuallyEdited(true);\n setFormData((prev) => ({ ...prev, slug: value }));\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n await onSubmit(formData);\n };\n\n const isValid = formData.title.trim() && formData.slug.trim() && formData.content.trim();\n\n return (\n <form onSubmit={handleSubmit} className=\"space-y-6\">\n <div className=\"p-6 rounded-xl border bg-card space-y-6\">\n {/* Title */}\n <div>\n <label\n htmlFor=\"support-article-title\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Title <span className=\"text-destructive\">*</span>\n </label>\n <Input\n id=\"support-article-title\"\n type=\"text\"\n required\n value={formData.title}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleTitleChange(e.target.value)}\n placeholder=\"Article title\"\n />\n </div>\n\n {/* Slug */}\n <div>\n <label\n htmlFor=\"support-article-slug\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n URL Slug <span className=\"text-destructive\">*</span>\n </label>\n <div className=\"flex flex-col gap-2 sm:flex-row sm:items-center\">\n <span className=\"text-sm text-muted-foreground\">/kb/articles/</span>\n <Input\n id=\"support-article-slug\"\n type=\"text\"\n required\n value={formData.slug}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\n handleSlugChange(e.target.value)\n }\n placeholder=\"article-url-slug\"\n className=\"flex-1\"\n />\n </div>\n <p className=\"text-xs text-muted-foreground mt-1\">\n Auto-generated from title. Edit to customize.\n </p>\n </div>\n\n {/* Excerpt */}\n <div>\n <label\n htmlFor=\"support-article-excerpt\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Excerpt\n </label>\n <textarea\n id=\"support-article-excerpt\"\n rows={3}\n value={formData.excerpt}\n onChange={(e) => setFormData({ ...formData, excerpt: e.target.value })}\n className=\"w-full px-4 py-3 rounded-lg border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n placeholder=\"Brief summary of the article (displayed in search results)\"\n />\n </div>\n\n {/* Content */}\n <div>\n <div className=\"flex items-center justify-between mb-2\">\n <label\n htmlFor=\"support-article-content\"\n className=\"text-sm font-medium text-foreground\"\n >\n Content <span className=\"text-destructive\">*</span>\n </label>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => setShowPreview(!showPreview)}\n className=\"text-xs\"\n >\n {showPreview ? (\n <>\n <Edit size={14} />\n Edit\n </>\n ) : (\n <>\n <Eye size={14} />\n Preview\n </>\n )}\n </Button>\n </div>\n\n {showPreview ? (\n <div className=\"w-full min-h-[400px] px-4 py-3 rounded-lg border bg-background overflow-auto\">\n <div\n className=\"prose prose-sm max-w-none dark:prose-invert\"\n dangerouslySetInnerHTML={{\n __html:\n parsedContent || '<p class=\"text-muted-foreground\">Nothing to preview</p>',\n }}\n />\n </div>\n ) : (\n <textarea\n id=\"support-article-content\"\n required\n rows={20}\n value={formData.content}\n onChange={(e) => setFormData({ ...formData, content: e.target.value })}\n className=\"w-full px-4 py-3 rounded-lg border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors font-mono text-sm\"\n placeholder=\"Article content (supports Markdown)\"\n />\n )}\n <p className=\"text-xs text-muted-foreground mt-1\">\n Supports Markdown: **bold**, *italic*, # headings, - lists, [links](url), ```code```\n </p>\n </div>\n\n {/* Category */}\n <div>\n <label\n htmlFor=\"support-article-category\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Category\n </label>\n <select\n id=\"support-article-category\"\n value={formData.categoryId}\n onChange={(e) => setFormData({ ...formData, categoryId: e.target.value })}\n className=\"w-full px-4 py-3 rounded-lg border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n >\n <option value=\"\">Select a category</option>\n {categories.map((cat) => (\n <option key={cat.id} value={cat.id}>\n {cat.name}\n </option>\n ))}\n </select>\n </div>\n\n {/* Tags */}\n <div>\n <label\n htmlFor=\"support-article-tags\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Tags\n </label>\n <Input\n id=\"support-article-tags\"\n type=\"text\"\n value={tagsInput}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleTagsChange(e.target.value)}\n placeholder=\"Enter tags separated by commas (e.g., billing, account, setup)\"\n />\n {formData.tags.length > 0 && (\n <div className=\"flex flex-wrap gap-2 mt-2\">\n {formData.tags.map((tag, index) => (\n <span\n key={index}\n className=\"px-2 py-1 text-xs rounded-full bg-primary/10 text-primary\"\n >\n {tag}\n </span>\n ))}\n </div>\n )}\n </div>\n\n {/* Meta Description */}\n <div>\n <label\n htmlFor=\"support-article-meta-description\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Meta Description\n </label>\n <textarea\n id=\"support-article-meta-description\"\n rows={2}\n value={formData.metaDescription}\n onChange={(e) => setFormData({ ...formData, metaDescription: e.target.value })}\n className=\"w-full px-4 py-3 rounded-lg border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n placeholder=\"SEO meta description (optional)\"\n />\n </div>\n\n {/* Status */}\n <div>\n <label\n htmlFor=\"support-article-status\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Status\n </label>\n <select\n id=\"support-article-status\"\n value={formData.status}\n onChange={(e) =>\n setFormData({ ...formData, status: e.target.value as 'DRAFT' | 'PUBLISHED' })\n }\n className=\"w-full px-4 py-3 rounded-lg border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n >\n <option value=\"DRAFT\">Draft - Not visible to users</option>\n <option value=\"PUBLISHED\">Published - Visible to all users</option>\n </select>\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"flex gap-3\">\n <Button type=\"submit\" disabled={isSubmitting || !isValid} className=\"flex-1\">\n {isSubmitting ? (\n <>\n <Loader2 size={18} className=\"animate-spin\" />\n Saving...\n </>\n ) : (\n <>\n <Save size={18} />\n {submitLabel}\n </>\n )}\n </Button>\n <Button type=\"button\" variant=\"outline\" onClick={onCancel}>\n <X size={18} />\n Cancel\n </Button>\n </div>\n </form>\n );\n}\n"],"mappings":";;;;;;AAgCA,SAAS,EAAa,GAAuB;AAC3C,QAAO,EACJ,aAAa,CACb,QAAQ,eAAe,IAAI,CAC3B,QAAQ,YAAY,GAAG,CACvB,UAAU,GAAG,IAAI;;AAGtB,SAAgB,EAAY,EAC1B,gBACA,eACA,aACA,aACA,iBACA,iBAAc,kBACK;CACnB,IAAM,CAAC,GAAU,KAAe,EAA0B;EACxD,OAAO,GAAa,SAAS;EAC7B,MAAM,GAAa,QAAQ;EAC3B,SAAS,GAAa,WAAW;EACjC,SAAS,GAAa,WAAW;EACjC,YAAY,GAAa,cAAc;EACvC,MAAM,GAAa,QAAQ,EAAE;EAC7B,iBAAiB,GAAa,mBAAmB;EACjD,QAAQ,GAAa,UAAU;EAChC,CAAC,EAEI,CAAC,GAAW,KAAgB,EAAS,GAAa,MAAM,KAAK,KAAK,IAAI,GAAG,EACzE,CAAC,GAAoB,KAAyB,EAAS,GAAM,EAC7D,CAAC,GAAa,KAAkB,EAAS,GAAM,EAG/C,IAAgB,QAAc;AAClC,MAAI,CAAC,EAAS,QAAS,QAAO;AAC9B,MAAI;AACF,UAAO,EAAsB,EAAS,QAAQ;UACxC;AACN,UAAO,EAAS;;IAEjB,CAAC,EAAS,QAAQ,CAAC,EA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;KACR,WAAU;eACX;KAEO,CAAA,EACR,kBAAC,UAAD;KACE,IAAG;KACH,OAAO,EAAS;KAChB,WAAW,MACT,EAAY;MAAE,GAAG;MAAU,QAAQ,EAAE,OAAO;MAAgC,CAAC;KAE/E,WAAU;eANZ,CAQE,kBAAC,UAAD;MAAQ,OAAM;gBAAQ;MAAqC,CAAA,EAC3D,kBAAC,UAAD;MAAQ,OAAM;gBAAY;MAAyC,CAAA,CAC5D;OACL,EAAA,CAAA;IACF;MAGN,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,GAAD;IAAQ,MAAK;IAAS,UAAU,KAAgB,CAAC;IAAS,WAAU;cACjE,IACC,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;KAAS,MAAM;KAAI,WAAU;KAAiB,CAAA,EAAA,YAE7C,EAAA,CAAA,GAEH,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA,EACjB,EACA,EAAA,CAAA;IAEE,CAAA,EACT,kBAAC,GAAD;IAAQ,MAAK;IAAS,SAAQ;IAAU,SAAS;cAAjD,CACE,kBAAC,GAAD,EAAG,MAAM,IAAM,CAAA,EAAA,SAER;MACL;KACD"}
|
|
1
|
+
{"version":3,"file":"ArticleForm.js","names":[],"sources":["../../../../src/support/components/kb/ArticleForm.tsx"],"sourcesContent":["import { useState, useMemo, useRef } from 'react';\nimport { Loader2, Save, X, Eye, Edit } from 'lucide-react';\nimport { Button, Input } from '../ui';\nimport { renderSupportMarkdown } from '../../utils/markdown';\n\nexport interface ArticleFormData {\n title: string;\n slug: string;\n content: string;\n excerpt: string;\n categoryId: string;\n tags: string[];\n metaDescription: string;\n status: 'DRAFT' | 'PUBLISHED';\n}\n\ninterface Category {\n id: string;\n name: string;\n color?: string;\n}\n\ninterface ArticleFormProps {\n initialData?: Partial<ArticleFormData>;\n categories: Category[];\n onSubmit: (data: ArticleFormData) => Promise<void>;\n onCancel: () => void;\n isSubmitting: boolean;\n submitLabel?: string;\n}\n\n// Generate URL-friendly slug from title\nfunction generateSlug(title: string): string {\n return title\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .substring(0, 100);\n}\n\nexport function ArticleForm({\n initialData,\n categories,\n onSubmit,\n onCancel,\n isSubmitting,\n submitLabel = 'Save Article',\n}: ArticleFormProps) {\n const [formData, setFormData] = useState<ArticleFormData>({\n title: initialData?.title || '',\n slug: initialData?.slug || '',\n content: initialData?.content || '',\n excerpt: initialData?.excerpt || '',\n categoryId: initialData?.categoryId || '',\n tags: initialData?.tags || [],\n metaDescription: initialData?.metaDescription || '',\n status: initialData?.status || 'DRAFT',\n });\n\n const [tagsInput, setTagsInput] = useState(initialData?.tags?.join(', ') || '');\n const slugManuallyEditedRef = useRef(false);\n const [showPreview, setShowPreview] = useState(false);\n\n // Parse markdown content for preview\n const parsedContent = useMemo(() => {\n if (!formData.content) return '';\n try {\n return renderSupportMarkdown(formData.content);\n } catch {\n return formData.content;\n }\n }, [formData.content]);\n\n // Handle title change with auto-slug generation\n const handleTitleChange = (title: string) => {\n if (!slugManuallyEditedRef.current) {\n setFormData((prev) => ({\n ...prev,\n title,\n slug: generateSlug(title),\n }));\n } else {\n setFormData((prev) => ({ ...prev, title }));\n }\n };\n\n // Parse tags from comma-separated input\n const handleTagsChange = (value: string) => {\n setTagsInput(value);\n const tags = value\n .split(',')\n .map((tag) => tag.trim())\n .filter((tag) => tag.length > 0);\n setFormData((prev) => ({ ...prev, tags }));\n };\n\n const handleSlugChange = (value: string) => {\n slugManuallyEditedRef.current = true;\n setFormData((prev) => ({ ...prev, slug: value }));\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n await onSubmit(formData);\n };\n\n const isValid = formData.title.trim() && formData.slug.trim() && formData.content.trim();\n\n return (\n <form onSubmit={handleSubmit} className=\"space-y-6\">\n <div className=\"p-6 rounded-xl border bg-card space-y-6\">\n {/* Title */}\n <div>\n <label\n htmlFor=\"support-article-title\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Title <span className=\"text-destructive\">*</span>\n </label>\n <Input\n id=\"support-article-title\"\n type=\"text\"\n required\n value={formData.title}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleTitleChange(e.target.value)}\n placeholder=\"Article title\"\n />\n </div>\n\n {/* Slug */}\n <div>\n <label\n htmlFor=\"support-article-slug\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n URL Slug <span className=\"text-destructive\">*</span>\n </label>\n <div className=\"flex flex-col gap-2 sm:flex-row sm:items-center\">\n <span className=\"text-sm text-muted-foreground\">/kb/articles/</span>\n <Input\n id=\"support-article-slug\"\n type=\"text\"\n required\n value={formData.slug}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\n handleSlugChange(e.target.value)\n }\n placeholder=\"article-url-slug\"\n className=\"flex-1\"\n />\n </div>\n <p className=\"text-xs text-muted-foreground mt-1\">\n Auto-generated from title. Edit to customize.\n </p>\n </div>\n\n {/* Excerpt */}\n <div>\n <label\n htmlFor=\"support-article-excerpt\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Excerpt\n </label>\n <textarea\n id=\"support-article-excerpt\"\n aria-label=\"Excerpt\"\n rows={3}\n value={formData.excerpt}\n onChange={(e) => setFormData({ ...formData, excerpt: e.target.value })}\n className=\"w-full px-4 py-3 rounded-lg border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n placeholder=\"Brief summary of the article (displayed in search results)\"\n />\n </div>\n\n {/* Content */}\n <div>\n <div className=\"flex items-center justify-between mb-2\">\n <label\n htmlFor=\"support-article-content\"\n className=\"text-sm font-medium text-foreground\"\n >\n Content <span className=\"text-destructive\">*</span>\n </label>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => setShowPreview(!showPreview)}\n className=\"text-xs\"\n >\n {showPreview ? (\n <>\n <Edit size={14} />\n Edit\n </>\n ) : (\n <>\n <Eye size={14} />\n Preview\n </>\n )}\n </Button>\n </div>\n\n {showPreview ? (\n <div className=\"w-full min-h-[400px] px-4 py-3 rounded-lg border bg-background overflow-auto\">\n <div\n className=\"prose prose-sm max-w-none dark:prose-invert\"\n dangerouslySetInnerHTML={{\n __html:\n parsedContent || '<p class=\"text-muted-foreground\">Nothing to preview</p>',\n }}\n />\n </div>\n ) : (\n <textarea\n id=\"support-article-content\"\n aria-label=\"Article content\"\n required\n rows={20}\n value={formData.content}\n onChange={(e) => setFormData({ ...formData, content: e.target.value })}\n className=\"w-full px-4 py-3 rounded-lg border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors font-mono text-sm\"\n placeholder=\"Article content (supports Markdown)\"\n />\n )}\n <p className=\"text-xs text-muted-foreground mt-1\">\n Supports Markdown: **bold**, *italic*, # headings, - lists, [links](url), ```code```\n </p>\n </div>\n\n {/* Category */}\n <div>\n <label\n htmlFor=\"support-article-category\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Category\n </label>\n <select\n id=\"support-article-category\"\n value={formData.categoryId}\n onChange={(e) => setFormData({ ...formData, categoryId: e.target.value })}\n className=\"w-full px-4 py-3 rounded-lg border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n >\n <option value=\"\">Select a category</option>\n {categories.map((cat) => (\n <option key={cat.id} value={cat.id}>\n {cat.name}\n </option>\n ))}\n </select>\n </div>\n\n {/* Tags */}\n <div>\n <label\n htmlFor=\"support-article-tags\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Tags\n </label>\n <Input\n id=\"support-article-tags\"\n type=\"text\"\n value={tagsInput}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleTagsChange(e.target.value)}\n placeholder=\"Enter tags separated by commas (e.g., billing, account, setup)\"\n />\n {formData.tags.length > 0 && (\n <div className=\"flex flex-wrap gap-2 mt-2\">\n {formData.tags.map((tag) => (\n <span\n key={tag}\n className=\"px-2 py-1 text-xs rounded-full bg-primary/10 text-primary\"\n >\n {tag}\n </span>\n ))}\n </div>\n )}\n </div>\n\n {/* Meta Description */}\n <div>\n <label\n htmlFor=\"support-article-meta-description\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Meta Description\n </label>\n <textarea\n id=\"support-article-meta-description\"\n aria-label=\"Meta Description\"\n rows={2}\n value={formData.metaDescription}\n onChange={(e) => setFormData({ ...formData, metaDescription: e.target.value })}\n className=\"w-full px-4 py-3 rounded-lg border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n placeholder=\"SEO meta description (optional)\"\n />\n </div>\n\n {/* Status */}\n <div>\n <label\n htmlFor=\"support-article-status\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Status\n </label>\n <select\n id=\"support-article-status\"\n value={formData.status}\n onChange={(e) =>\n setFormData({ ...formData, status: e.target.value as 'DRAFT' | 'PUBLISHED' })\n }\n className=\"w-full px-4 py-3 rounded-lg border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n >\n <option value=\"DRAFT\">Draft - Not visible to users</option>\n <option value=\"PUBLISHED\">Published - Visible to all users</option>\n </select>\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"flex gap-3\">\n <Button type=\"submit\" disabled={isSubmitting || !isValid} className=\"flex-1\">\n {isSubmitting ? (\n <>\n <Loader2 size={18} className=\"animate-spin\" />\n Saving…\n </>\n ) : (\n <>\n <Save size={18} />\n {submitLabel}\n </>\n )}\n </Button>\n <Button type=\"button\" variant=\"outline\" onClick={onCancel}>\n <X size={18} />\n Cancel\n </Button>\n </div>\n </form>\n );\n}\n"],"mappings":";;;;;;AAgCA,SAAS,EAAa,GAAuB;AAC3C,QAAO,EACJ,aAAa,CACb,QAAQ,eAAe,IAAI,CAC3B,QAAQ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H,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA,EACjB,EACA,EAAA,CAAA;IAEE,CAAA,EACT,kBAAC,GAAD;IAAQ,MAAK;IAAS,SAAQ;IAAU,SAAS;cAAjD,CACE,kBAAC,GAAD,EAAG,MAAM,IAAM,CAAA,EAAA,SAER;MACL;KACD"}
|
|
@@ -8,7 +8,10 @@ var u = {
|
|
|
8
8
|
tags: ""
|
|
9
9
|
};
|
|
10
10
|
function d(e) {
|
|
11
|
-
return e.split(",").
|
|
11
|
+
return e.split(",").flatMap((e) => {
|
|
12
|
+
let t = e.trim();
|
|
13
|
+
return t ? [t] : [];
|
|
14
|
+
});
|
|
12
15
|
}
|
|
13
16
|
function f({ responses: f, onCreate: p, onUpdate: m, onDelete: h }) {
|
|
14
17
|
let [g, _] = e(!1), [v, y] = e(null), [b, x] = e(u), [S, C] = e(!1), [w, T] = e(null), E = () => {
|
|
@@ -86,9 +89,12 @@ function f({ responses: f, onCreate: p, onUpdate: m, onDelete: h }) {
|
|
|
86
89
|
children: [
|
|
87
90
|
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
88
91
|
className: "block text-sm font-medium mb-1 text-secondary",
|
|
92
|
+
htmlFor: "cannedresponsessettings-title-0",
|
|
89
93
|
children: "Title *"
|
|
90
94
|
}), /* @__PURE__ */ c("input", {
|
|
95
|
+
id: "cannedresponsessettings-title-0",
|
|
91
96
|
type: "text",
|
|
97
|
+
"aria-label": "Title",
|
|
92
98
|
value: b.title,
|
|
93
99
|
onChange: (e) => x({
|
|
94
100
|
...b,
|
|
@@ -99,8 +105,11 @@ function f({ responses: f, onCreate: p, onUpdate: m, onDelete: h }) {
|
|
|
99
105
|
})] }),
|
|
100
106
|
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
101
107
|
className: "block text-sm font-medium mb-1 text-secondary",
|
|
108
|
+
htmlFor: "cannedresponsessettings-response-2",
|
|
102
109
|
children: "Response *"
|
|
103
110
|
}), /* @__PURE__ */ c("textarea", {
|
|
111
|
+
id: "cannedresponsessettings-response-2",
|
|
112
|
+
"aria-label": "Response",
|
|
104
113
|
value: b.content,
|
|
105
114
|
onChange: (e) => x({
|
|
106
115
|
...b,
|
|
@@ -112,9 +121,12 @@ function f({ responses: f, onCreate: p, onUpdate: m, onDelete: h }) {
|
|
|
112
121
|
})] }),
|
|
113
122
|
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
114
123
|
className: "block text-sm font-medium mb-1 text-secondary",
|
|
124
|
+
htmlFor: "cannedresponsessettings-tags-4",
|
|
115
125
|
children: "Tags"
|
|
116
126
|
}), /* @__PURE__ */ c("input", {
|
|
127
|
+
id: "cannedresponsessettings-tags-4",
|
|
117
128
|
type: "text",
|
|
129
|
+
"aria-label": "Tags",
|
|
118
130
|
value: b.tags,
|
|
119
131
|
onChange: (e) => x({
|
|
120
132
|
...b,
|
|
@@ -155,7 +167,7 @@ function f({ responses: f, onCreate: p, onUpdate: m, onDelete: h }) {
|
|
|
155
167
|
children: [/* @__PURE__ */ l("div", {
|
|
156
168
|
className: "flex items-start gap-3",
|
|
157
169
|
children: [/* @__PURE__ */ c("div", {
|
|
158
|
-
className: "
|
|
170
|
+
className: "size-8 rounded-full flex items-center justify-center flex-shrink-0 bg-primary/10",
|
|
159
171
|
children: /* @__PURE__ */ c(r, {
|
|
160
172
|
size: 16,
|
|
161
173
|
className: "text-primary"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CannedResponsesSettings.js","names":[],"sources":["../../../../src/support/components/settings/CannedResponsesSettings.tsx"],"sourcesContent":["import { useState, type FormEvent } from 'react';\nimport { MessageCircle, Plus, Edit2, Trash2, Tag, X, Check } from 'lucide-react';\n\ninterface CannedResponse {\n id: string;\n title: string;\n content: string;\n tags?: string[];\n isActive?: boolean;\n}\n\ninterface CannedResponseInput {\n title: string;\n content: string;\n tags?: string[];\n isActive?: boolean;\n}\n\ninterface CannedResponsesSettingsProps {\n responses: CannedResponse[];\n onCreate: (input: CannedResponseInput) => Promise<CannedResponse>;\n onUpdate: (id: string, input: Partial<CannedResponseInput>) => Promise<CannedResponse>;\n onDelete: (id: string) => Promise<void>;\n}\n\nconst emptyForm = {\n title: '',\n content: '',\n tags: '',\n};\n\nfunction parseTags(value: string): string[] {\n return value\n .split(',')\n .map((tag) => tag.trim())\n .filter(Boolean);\n}\n\nexport function CannedResponsesSettings({\n responses,\n onCreate,\n onUpdate,\n onDelete,\n}: CannedResponsesSettingsProps) {\n const [showForm, setShowForm] = useState(false);\n const [editingId, setEditingId] = useState<string | null>(null);\n const [form, setForm] = useState(emptyForm);\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const handleNew = () => {\n setEditingId(null);\n setForm(emptyForm);\n setError(null);\n setShowForm(true);\n };\n\n const handleEdit = (response: CannedResponse) => {\n setEditingId(response.id);\n setForm({\n title: response.title,\n content: response.content,\n tags: response.tags?.join(', ') ?? '',\n });\n setError(null);\n setShowForm(true);\n };\n\n const handleCancel = () => {\n setShowForm(false);\n setEditingId(null);\n setForm(emptyForm);\n setError(null);\n };\n\n const handleSubmit = async (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (!form.title.trim() || !form.content.trim()) return;\n\n setSaving(true);\n setError(null);\n try {\n const input = {\n title: form.title.trim(),\n content: form.content.trim(),\n tags: parseTags(form.tags),\n };\n\n if (editingId) {\n const existingResponse = responses.find((response) => response.id === editingId);\n await onUpdate(editingId, {\n ...input,\n isActive: existingResponse?.isActive ?? true,\n });\n } else {\n await onCreate({ ...input, isActive: true });\n }\n\n handleCancel();\n } catch (submitError) {\n setError(submitError instanceof Error ? submitError.message : 'Failed to save response.');\n } finally {\n setSaving(false);\n }\n };\n\n const handleDelete = async (id: string) => {\n setError(null);\n try {\n await onDelete(id);\n } catch (deleteError) {\n setError(deleteError instanceof Error ? deleteError.message : 'Failed to delete response.');\n }\n };\n\n return (\n <div className=\"space-y-6 animate-in fade-in-0 slide-in-from-bottom-2 duration-300\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h2 className=\"text-xl font-semibold mb-2 text-primary\">Canned Responses</h2>\n <p className=\"text-sm text-secondary\">\n Pre-written responses for common customer inquiries\n </p>\n </div>\n <button\n type=\"button\"\n onClick={handleNew}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg transition-all duration-200 bg-primary text-primary-foreground hover:bg-primary/90\"\n >\n <Plus size={20} />\n New Response\n </button>\n </div>\n\n {showForm && (\n <form\n onSubmit={handleSubmit}\n className=\"p-5 rounded-lg border-2 border-primary/30 bg-surface animate-in fade-in-0 slide-in-from-top-2 duration-200\"\n >\n <h3 className=\"font-semibold mb-4 text-primary\">\n {editingId ? 'Edit Response' : 'Create New Response'}\n </h3>\n\n <div className=\"space-y-4\">\n <div>\n <label className=\"block text-sm font-medium mb-1 text-secondary\">Title *</label>\n <input\n type=\"text\"\n value={form.title}\n onChange={(event) => setForm({ ...form, title: event.target.value })}\n className=\"w-full px-3 py-2 rounded-lg border border-border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"e.g., Troubleshooting next steps\"\n />\n </div>\n\n <div>\n <label className=\"block text-sm font-medium mb-1 text-secondary\">Response *</label>\n <textarea\n value={form.content}\n onChange={(event) => setForm({ ...form, content: event.target.value })}\n rows={5}\n className=\"w-full px-3 py-2 rounded-lg border border-border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"Write the saved reply agents can reuse.\"\n />\n </div>\n\n <div>\n <label className=\"block text-sm font-medium mb-1 text-secondary\">Tags</label>\n <input\n type=\"text\"\n value={form.tags}\n onChange={(event) => setForm({ ...form, tags: event.target.value })}\n className=\"w-full px-3 py-2 rounded-lg border border-border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"billing, onboarding, bug\"\n />\n </div>\n\n {error && <p className=\"text-sm text-error\">{error}</p>}\n </div>\n\n <div className=\"flex flex-col gap-2 mt-5 pt-4 border-t border-border sm:flex-row sm:items-center sm:justify-end\">\n <button\n type=\"button\"\n onClick={handleCancel}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg border border-border bg-background text-foreground transition-colors hover:bg-muted\"\n >\n <X size={16} />\n Cancel\n </button>\n <button\n type=\"submit\"\n disabled={saving || !form.title.trim() || !form.content.trim()}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50\"\n >\n <Check size={16} />\n {saving ? 'Saving...' : editingId ? 'Update Response' : 'Create Response'}\n </button>\n </div>\n </form>\n )}\n\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {responses.map((response) => (\n <div\n key={response.id}\n className=\"p-4 rounded-lg border border-default bg-surface transition-all duration-200 hover:shadow-sm hover:border-primary/30\"\n >\n <div className=\"flex items-start justify-between mb-3\">\n <div className=\"flex items-start gap-3\">\n <div className=\"w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 bg-primary/10\">\n <MessageCircle size={16} className=\"text-primary\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <h3 className=\"font-semibold truncate text-primary\">{response.title}</h3>\n </div>\n </div>\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => handleEdit(response)}\n className=\"min-h-11 min-w-11 p-1.5 rounded transition-colors duration-200 text-secondary hover:bg-muted\"\n aria-label=\"Edit canned response\"\n >\n <Edit2 size={16} />\n </button>\n <button\n type=\"button\"\n className=\"min-h-11 min-w-11 p-1.5 rounded transition-colors duration-200 text-error hover:bg-error/10\"\n onClick={() => void handleDelete(response.id)}\n aria-label=\"Delete canned response\"\n >\n <Trash2 size={16} />\n </button>\n </div>\n </div>\n\n <p className=\"text-sm line-clamp-2 mb-3 text-secondary\">{response.content}</p>\n\n {response.tags && response.tags.length > 0 && (\n <div className=\"flex items-center gap-2 flex-wrap\">\n <Tag size={12} className=\"text-tertiary\" />\n {response.tags.map((tag: string) => (\n <span key={tag} className=\"text-xs px-2 py-0.5 rounded bg-muted text-secondary\">\n {tag}\n </span>\n ))}\n </div>\n )}\n </div>\n ))}\n\n {responses.length === 0 && !showForm && (\n <div className=\"col-span-2 text-center py-12 animate-in fade-in-0 duration-300\">\n <MessageCircle size={48} className=\"text-tertiary mx-auto\" />\n <p className=\"mt-4 text-secondary\">No canned responses configured</p>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;AAyBA,IAAM,IAAY;CAChB,OAAO;CACP,SAAS;CACT,MAAM;CACP;AAED,SAAS,EAAU,GAAyB;AAC1C,QAAO,EACJ,MAAM,IAAI,CACV,KAAK,MAAQ,EAAI,MAAM,CAAC,CACxB,OAAO,QAAQ;;AAGpB,SAAgB,EAAwB,EACtC,cACA,aACA,aACA,eAC+B;CAC/B,IAAM,CAAC,GAAU,KAAe,EAAS,GAAM,EACzC,CAAC,GAAW,KAAgB,EAAwB,KAAK,EACzD,CAAC,GAAM,KAAW,EAAS,EAAU,EACrC,CAAC,GAAQ,KAAa,EAAS,GAAM,EACrC,CAAC,GAAO,KAAY,EAAwB,KAAK,EAEjD,UAAkB;AAItB,EAHA,EAAa,KAAK,EAClB,EAAQ,EAAU,EAClB,EAAS,KAAK,EACd,EAAY,GAAK;IAGb,KAAc,MAA6B;AAQ/C,EAPA,EAAa,EAAS,GAAG,EACzB,EAAQ;GACN,OAAO,EAAS;GAChB,SAAS,EAAS;GAClB,MAAM,EAAS,MAAM,KAAK,KAAK,IAAI;GACpC,CAAC,EACF,EAAS,KAAK,EACd,EAAY,GAAK;IAGb,UAAqB;AAIzB,EAHA,EAAY,GAAM,EAClB,EAAa,KAAK,EAClB,EAAQ,EAAU,EAClB,EAAS,KAAK;IAGV,IAAe,OAAO,MAAsC;AAChE,QAAM,gBAAgB,EAClB,GAAC,EA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AAU;iBAAf,CACE,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,OAAD;SAAK,WAAU;mBACb,kBAAC,GAAD;UAAe,MAAM;UAAI,WAAU;UAAiB,CAAA;SAChD,CAAA,EACN,kBAAC,OAAD;SAAK,WAAU;mBACb,kBAAC,MAAD;UAAI,WAAU;oBAAuC,EAAS;UAAW,CAAA;SACrE,CAAA,CACF;WACN,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,UAAD;SACE,MAAK;SACL,eAAe,EAAW,EAAS;SACnC,WAAU;SACV,cAAW;mBAEX,kBAAC,GAAD,EAAO,MAAM,IAAM,CAAA;SACZ,CAAA,EACT,kBAAC,UAAD;SACE,MAAK;SACL,WAAU;SACV,eAAe,KAAK,EAAa,EAAS,GAAG;SAC7C,cAAW;mBAEX,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;SACb,CAAA,CACL;UACF;;MAEN,kBAAC,KAAD;OAAG,WAAU;iBAA4C,EAAS;OAAY,CAAA;MAE7E,EAAS,QAAQ,EAAS,KAAK,SAAS,KACvC,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,GAAD;QAAK,MAAM;QAAI,WAAU;QAAkB,CAAA,EAC1C,EAAS,KAAK,KAAK,MAClB,kBAAC,QAAD;QAAgB,WAAU;kBACvB;QACI,EAFI,EAEJ,CACP,CACE;;MAEJ;OA5CC,EAAS,GA4CV,CACN,EAED,EAAU,WAAW,KAAK,CAAC,KAC1B,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,GAAD;MAAe,MAAM;MAAI,WAAU;MAA0B,CAAA,EAC7D,kBAAC,KAAD;MAAG,WAAU;gBAAsB;MAAkC,CAAA,CACjE;OAEJ;;GACF"}
|
|
1
|
+
{"version":3,"file":"CannedResponsesSettings.js","names":[],"sources":["../../../../src/support/components/settings/CannedResponsesSettings.tsx"],"sourcesContent":["import { useState, type FormEvent } from 'react';\nimport { MessageCircle, Plus, Edit2, Trash2, Tag, X, Check } from 'lucide-react';\n\ninterface CannedResponse {\n id: string;\n title: string;\n content: string;\n tags?: string[];\n isActive?: boolean;\n}\n\ninterface CannedResponseInput {\n title: string;\n content: string;\n tags?: string[];\n isActive?: boolean;\n}\n\ninterface CannedResponsesSettingsProps {\n responses: CannedResponse[];\n onCreate: (input: CannedResponseInput) => Promise<CannedResponse>;\n onUpdate: (id: string, input: Partial<CannedResponseInput>) => Promise<CannedResponse>;\n onDelete: (id: string) => Promise<void>;\n}\n\nconst emptyForm = {\n title: '',\n content: '',\n tags: '',\n};\n\nfunction parseTags(value: string): string[] {\n return value.split(',').flatMap((tag) => {\n const trimmed = tag.trim();\n return trimmed ? [trimmed] : [];\n });\n}\n\nexport function CannedResponsesSettings({\n responses,\n onCreate,\n onUpdate,\n onDelete,\n}: CannedResponsesSettingsProps) {\n const [showForm, setShowForm] = useState(false);\n const [editingId, setEditingId] = useState<string | null>(null);\n const [form, setForm] = useState(emptyForm);\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const handleNew = () => {\n setEditingId(null);\n setForm(emptyForm);\n setError(null);\n setShowForm(true);\n };\n\n const handleEdit = (response: CannedResponse) => {\n setEditingId(response.id);\n setForm({\n title: response.title,\n content: response.content,\n tags: response.tags?.join(', ') ?? '',\n });\n setError(null);\n setShowForm(true);\n };\n\n const handleCancel = () => {\n setShowForm(false);\n setEditingId(null);\n setForm(emptyForm);\n setError(null);\n };\n\n const handleSubmit = async (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (!form.title.trim() || !form.content.trim()) return;\n\n setSaving(true);\n setError(null);\n try {\n const input = {\n title: form.title.trim(),\n content: form.content.trim(),\n tags: parseTags(form.tags),\n };\n\n if (editingId) {\n const existingResponse = responses.find((response) => response.id === editingId);\n await onUpdate(editingId, {\n ...input,\n isActive: existingResponse?.isActive ?? true,\n });\n } else {\n await onCreate({ ...input, isActive: true });\n }\n\n handleCancel();\n } catch (submitError) {\n setError(submitError instanceof Error ? submitError.message : 'Failed to save response.');\n } finally {\n setSaving(false);\n }\n };\n\n const handleDelete = async (id: string) => {\n setError(null);\n try {\n await onDelete(id);\n } catch (deleteError) {\n setError(deleteError instanceof Error ? deleteError.message : 'Failed to delete response.');\n }\n };\n\n return (\n <div className=\"space-y-6 animate-in fade-in-0 slide-in-from-bottom-2 duration-300\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h2 className=\"text-xl font-semibold mb-2 text-primary\">Canned Responses</h2>\n <p className=\"text-sm text-secondary\">\n Pre-written responses for common customer inquiries\n </p>\n </div>\n <button\n type=\"button\"\n onClick={handleNew}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg transition-all duration-200 bg-primary text-primary-foreground hover:bg-primary/90\"\n >\n <Plus size={20} />\n New Response\n </button>\n </div>\n\n {showForm && (\n <form\n onSubmit={handleSubmit}\n className=\"p-5 rounded-lg border-2 border-primary/30 bg-surface animate-in fade-in-0 slide-in-from-top-2 duration-200\"\n >\n <h3 className=\"font-semibold mb-4 text-primary\">\n {editingId ? 'Edit Response' : 'Create New Response'}\n </h3>\n\n <div className=\"space-y-4\">\n <div>\n <label\n className=\"block text-sm font-medium mb-1 text-secondary\"\n htmlFor=\"cannedresponsessettings-title-0\"\n >\n Title *\n </label>\n <input\n id=\"cannedresponsessettings-title-0\"\n type=\"text\"\n aria-label=\"Title\"\n value={form.title}\n onChange={(event) => setForm({ ...form, title: event.target.value })}\n className=\"w-full px-3 py-2 rounded-lg border border-border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"e.g., Troubleshooting next steps\"\n />\n </div>\n\n <div>\n <label\n className=\"block text-sm font-medium mb-1 text-secondary\"\n htmlFor=\"cannedresponsessettings-response-2\"\n >\n Response *\n </label>\n <textarea\n id=\"cannedresponsessettings-response-2\"\n aria-label=\"Response\"\n value={form.content}\n onChange={(event) => setForm({ ...form, content: event.target.value })}\n rows={5}\n className=\"w-full px-3 py-2 rounded-lg border border-border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"Write the saved reply agents can reuse.\"\n />\n </div>\n\n <div>\n <label\n className=\"block text-sm font-medium mb-1 text-secondary\"\n htmlFor=\"cannedresponsessettings-tags-4\"\n >\n Tags\n </label>\n <input\n id=\"cannedresponsessettings-tags-4\"\n type=\"text\"\n aria-label=\"Tags\"\n value={form.tags}\n onChange={(event) => setForm({ ...form, tags: event.target.value })}\n className=\"w-full px-3 py-2 rounded-lg border border-border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"billing, onboarding, bug\"\n />\n </div>\n\n {error && <p className=\"text-sm text-error\">{error}</p>}\n </div>\n\n <div className=\"flex flex-col gap-2 mt-5 pt-4 border-t border-border sm:flex-row sm:items-center sm:justify-end\">\n <button\n type=\"button\"\n onClick={handleCancel}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg border border-border bg-background text-foreground transition-colors hover:bg-muted\"\n >\n <X size={16} />\n Cancel\n </button>\n <button\n type=\"submit\"\n disabled={saving || !form.title.trim() || !form.content.trim()}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50\"\n >\n <Check size={16} />\n {saving ? 'Saving...' : editingId ? 'Update Response' : 'Create Response'}\n </button>\n </div>\n </form>\n )}\n\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {responses.map((response) => (\n <div\n key={response.id}\n className=\"p-4 rounded-lg border border-default bg-surface transition-all duration-200 hover:shadow-sm hover:border-primary/30\"\n >\n <div className=\"flex items-start justify-between mb-3\">\n <div className=\"flex items-start gap-3\">\n <div className=\"size-8 rounded-full flex items-center justify-center flex-shrink-0 bg-primary/10\">\n <MessageCircle size={16} className=\"text-primary\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <h3 className=\"font-semibold truncate text-primary\">{response.title}</h3>\n </div>\n </div>\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => handleEdit(response)}\n className=\"min-h-11 min-w-11 p-1.5 rounded transition-colors duration-200 text-secondary hover:bg-muted\"\n aria-label=\"Edit canned response\"\n >\n <Edit2 size={16} />\n </button>\n <button\n type=\"button\"\n className=\"min-h-11 min-w-11 p-1.5 rounded transition-colors duration-200 text-error hover:bg-error/10\"\n onClick={() => void handleDelete(response.id)}\n aria-label=\"Delete canned response\"\n >\n <Trash2 size={16} />\n </button>\n </div>\n </div>\n\n <p className=\"text-sm line-clamp-2 mb-3 text-secondary\">{response.content}</p>\n\n {response.tags && response.tags.length > 0 && (\n <div className=\"flex items-center gap-2 flex-wrap\">\n <Tag size={12} className=\"text-tertiary\" />\n {response.tags.map((tag: string) => (\n <span key={tag} className=\"text-xs px-2 py-0.5 rounded bg-muted text-secondary\">\n {tag}\n </span>\n ))}\n </div>\n )}\n </div>\n ))}\n\n {responses.length === 0 && !showForm && (\n <div className=\"col-span-2 text-center py-12 animate-in fade-in-0 duration-300\">\n <MessageCircle size={48} className=\"text-tertiary mx-auto\" />\n <p className=\"mt-4 text-secondary\">No canned responses configured</p>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;AAyBA,IAAM,IAAY;CAChB,OAAO;CACP,SAAS;CACT,MAAM;CACP;AAED,SAAS,EAAU,GAAyB;AAC1C,QAAO,EAAM,MAAM,IAAI,CAAC,SAAS,MAAQ;EACvC,IAAM,IAAU,EAAI,MAAM;AAC1B,SAAO,IAAU,CAAC,EAAQ,GAAG,EAAE;GAC/B;;AAGJ,SAAgB,EAAwB,EACtC,cACA,aACA,aACA,eAC+B;CAC/B,IAAM,CAAC,GAAU,KAAe,EAAS,GAAM,EACzC,CAAC,GAAW,KAAgB,EAAwB,KAAK,EACzD,CAAC,GAAM,KAAW,EAAS,EAAU,EACrC,CAAC,GAAQ,KAAa,EAAS,GAAM,EACrC,C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