@burdenoff/microfe-theculturepost 2026.1113.3 → 2026.1113.5

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.
@@ -1,17 +1,18 @@
1
- import { TagInput as e } from "./TagInput.js";
1
+ import { FramingPrompts as e } from "./FramingPrompts.js";
2
2
  import { FILE_FOLDERS as t, uploadImageToFiles as n } from "../hooks/useFiles.js";
3
- import { cn as r } from "../utils/cn.js";
3
+ import { TagInput as r } from "./TagInput.js";
4
4
  import { useTcpCreateStory as i, useTcpTopics as a } from "../hooks/useTcpApi.js";
5
+ import { cn as o } from "../utils/cn.js";
5
6
  import "../hooks/index.js";
6
- import { slugify as o } from "../utils/slug.js";
7
- import { formatEnumLabel as s } from "../utils/formatters.js";
8
- import { describeError as c, notify as l } from "../lib/toast.js";
7
+ import { slugify as s } from "../utils/slug.js";
8
+ import { formatEnumLabel as c } from "../utils/formatters.js";
9
+ import { describeError as ee, notify as l } from "../lib/toast.js";
9
10
  import { useRef as u, useState as d } from "react";
10
- import { CheckCircle2 as f, FileCheck2 as p, Loader2 as ee, UploadCloud as te, X as m } from "lucide-react";
11
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
12
- import { Button as v, Input as y, Label as b, ResponsiveDialog as x, ResponsiveDialogContent as S, ResponsiveDialogDescription as C, ResponsiveDialogFooter as w, ResponsiveDialogHeader as T, ResponsiveDialogTitle as E, Select as D, SelectContent as O, SelectItem as k, SelectTrigger as ne, SelectValue as A, Textarea as j } from "@burdenoff/fe-libs/ui";
11
+ import { CheckCircle2 as f, FileCheck2 as p, Loader2 as m, UploadCloud as h, X as g } from "lucide-react";
12
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
13
+ import { Button as b, Input as x, Label as S, ResponsiveDialog as C, ResponsiveDialogContent as w, ResponsiveDialogDescription as T, ResponsiveDialogFooter as E, ResponsiveDialogHeader as D, ResponsiveDialogTitle as O, Select as k, SelectContent as te, SelectItem as ne, SelectTrigger as re, SelectValue as A, Textarea as j } from "@burdenoff/fe-libs/ui";
13
14
  // src/theculturepost/components/CreateStoryDialog.tsx
14
- var re = [
15
+ var ie = [
15
16
  "ARTICLE",
16
17
  "ESSAY",
17
18
  "EXPLAINER",
@@ -19,129 +20,129 @@ var re = [
19
20
  "PHOTO_STORY",
20
21
  "TIMELINE"
21
22
  ], M = 200, N = 25;
22
- function ie({ coverFileId: e, onUploaded: i, onCleared: a }) {
23
- let o = u(null), [s, f] = d(!1), [h, y] = d(!1), [b, x] = d(null), [S, C] = d(null), w = async (e) => {
23
+ function ae({ coverFileId: e, onUploaded: r, onCleared: i }) {
24
+ let a = u(null), [s, c] = d(!1), [f, _] = d(!1), [x, S] = d(null), [C, w] = d(null), T = async (e) => {
24
25
  if (!e.type.startsWith("image/")) l.error("Unsupported file", "Please choose an image (JPG or PNG).");
25
26
  else if (e.size > N * 1024 * 1024) l.error("File too large", `Please choose an image under ${N} MB.`);
26
27
  else {
27
- f(!0);
28
+ c(!0);
28
29
  try {
29
- let r = await n(e, t.covers);
30
- x(r.url), C(r.name), i(r.id), l.success("Cover uploaded", r.name);
30
+ let i = await n(e, t.covers);
31
+ S(i.url), w(i.name), r(i.id), l.success("Cover uploaded", i.name);
31
32
  } catch (e) {
32
- l.error("Upload failed", c(e));
33
+ l.error("Upload failed", ee(e));
33
34
  } finally {
34
- f(!1);
35
+ c(!1);
35
36
  }
36
37
  }
37
- }, T = (e) => {
38
- let t = e.target.files?.[0];
39
- e.target.value = "", t && w(t);
40
38
  }, E = (e) => {
41
- if (e.preventDefault(), y(!1), s) return;
39
+ let t = e.target.files?.[0];
40
+ e.target.value = "", t && T(t);
41
+ }, D = (e) => {
42
+ if (e.preventDefault(), _(!1), s) return;
42
43
  let t = e.dataTransfer.files?.[0];
43
- t && w(t);
44
- }, D = () => {
45
- x(null), C(null), a();
46
- }, O = /* @__PURE__ */ g("input", {
47
- ref: o,
44
+ t && T(t);
45
+ }, O = () => {
46
+ S(null), w(null), i();
47
+ }, k = /* @__PURE__ */ v("input", {
48
+ ref: a,
48
49
  type: "file",
49
50
  accept: "image/*",
50
51
  className: "sr-only",
51
- onChange: T,
52
+ onChange: E,
52
53
  disabled: s,
53
54
  "aria-label": "Upload cover image"
54
55
  });
55
- return b ? /* @__PURE__ */ _("div", {
56
+ return x ? /* @__PURE__ */ y("div", {
56
57
  className: "relative overflow-hidden rounded-2xl border border-border-seam",
57
58
  children: [
58
- O,
59
- /* @__PURE__ */ g("img", {
60
- src: b,
59
+ k,
60
+ /* @__PURE__ */ v("img", {
61
+ src: x,
61
62
  alt: "Cover preview",
62
63
  className: "max-h-52 w-full object-cover"
63
64
  }),
64
- /* @__PURE__ */ _("div", {
65
+ /* @__PURE__ */ y("div", {
65
66
  className: "absolute right-2 top-2 flex gap-1.5",
66
- children: [/* @__PURE__ */ g("button", {
67
+ children: [/* @__PURE__ */ v("button", {
67
68
  type: "button",
68
- onClick: () => o.current?.click(),
69
+ onClick: () => a.current?.click(),
69
70
  className: "rounded-full bg-bg-canvas/85 px-2.5 py-1 text-xs font-medium text-text-primary backdrop-blur-sm hover:bg-bg-canvas",
70
71
  children: "Replace"
71
- }), /* @__PURE__ */ g("button", {
72
+ }), /* @__PURE__ */ v("button", {
72
73
  type: "button",
73
- onClick: D,
74
+ onClick: O,
74
75
  "aria-label": "Remove cover",
75
76
  className: "rounded-full bg-bg-canvas/85 p-1.5 text-text-primary backdrop-blur-sm hover:bg-bg-canvas",
76
- children: /* @__PURE__ */ g(m, {
77
+ children: /* @__PURE__ */ v(g, {
77
78
  className: "h-4 w-4",
78
79
  "aria-hidden": "true"
79
80
  })
80
81
  })]
81
82
  })
82
83
  ]
83
- }) : e ? /* @__PURE__ */ _("div", {
84
+ }) : e ? /* @__PURE__ */ y("div", {
84
85
  className: "flex items-center justify-between gap-2 rounded-2xl border border-border-seam bg-bg-surface px-3 py-2.5 text-sm",
85
86
  children: [
86
- O,
87
- /* @__PURE__ */ _("span", {
87
+ k,
88
+ /* @__PURE__ */ y("span", {
88
89
  className: "inline-flex min-w-0 items-center gap-2 text-text-primary",
89
- children: [/* @__PURE__ */ g(p, {
90
+ children: [/* @__PURE__ */ v(p, {
90
91
  className: "h-4 w-4 shrink-0 text-status-success-text",
91
92
  "aria-hidden": "true"
92
- }), /* @__PURE__ */ g("span", {
93
+ }), /* @__PURE__ */ v("span", {
93
94
  className: "truncate",
94
- children: S ?? "Cover selected"
95
+ children: C ?? "Cover selected"
95
96
  })]
96
97
  }),
97
- /* @__PURE__ */ g("button", {
98
+ /* @__PURE__ */ v("button", {
98
99
  type: "button",
99
- onClick: D,
100
+ onClick: O,
100
101
  "aria-label": "Remove cover",
101
102
  className: "text-text-tertiary hover:text-text-primary",
102
- children: /* @__PURE__ */ g(m, {
103
+ children: /* @__PURE__ */ v(g, {
103
104
  className: "h-4 w-4",
104
105
  "aria-hidden": "true"
105
106
  })
106
107
  })
107
108
  ]
108
- }) : /* @__PURE__ */ _("div", {
109
+ }) : /* @__PURE__ */ y("div", {
109
110
  onDragOver: (e) => {
110
- e.preventDefault(), s || y(!0);
111
+ e.preventDefault(), s || _(!0);
111
112
  },
112
113
  onDragLeave: (e) => {
113
- e.preventDefault(), y(!1);
114
+ e.preventDefault(), _(!1);
114
115
  },
115
- onDrop: E,
116
- className: r("rounded-2xl border-2 border-dashed px-4 py-6 text-center transition-colors", h ? "border-accent bg-[var(--color-accent-soft)]" : "border-border-seam bg-bg-sunken/40"),
116
+ onDrop: D,
117
+ className: o("rounded-2xl border-2 border-dashed px-4 py-6 text-center transition-colors", f ? "border-accent bg-[var(--color-accent-soft)]" : "border-border-seam bg-bg-sunken/40"),
117
118
  children: [
118
- O,
119
- s ? /* @__PURE__ */ _("div", {
119
+ k,
120
+ s ? /* @__PURE__ */ y("div", {
120
121
  className: "flex items-center justify-center gap-2 text-sm text-text-secondary",
121
- children: [/* @__PURE__ */ g(ee, {
122
+ children: [/* @__PURE__ */ v(m, {
122
123
  className: "h-5 w-5 animate-spin",
123
124
  "aria-hidden": "true"
124
125
  }), " Uploading cover…"]
125
- }) : /* @__PURE__ */ _("div", {
126
+ }) : /* @__PURE__ */ y("div", {
126
127
  className: "flex flex-col items-center justify-center gap-3 sm:flex-row",
127
128
  children: [
128
- /* @__PURE__ */ g(te, {
129
+ /* @__PURE__ */ v(h, {
129
130
  className: "h-8 w-8 text-accent",
130
131
  "aria-hidden": "true"
131
132
  }),
132
- /* @__PURE__ */ g("p", {
133
+ /* @__PURE__ */ v("p", {
133
134
  className: "text-sm text-text-secondary",
134
135
  children: "Drag and drop an image here, or"
135
136
  }),
136
- /* @__PURE__ */ g(v, {
137
+ /* @__PURE__ */ v(b, {
137
138
  type: "button",
138
139
  size: "sm",
139
- onClick: () => o.current?.click(),
140
+ onClick: () => a.current?.click(),
140
141
  children: "Upload cover"
141
142
  })
142
143
  ]
143
144
  }),
144
- /* @__PURE__ */ _("p", {
145
+ /* @__PURE__ */ y("p", {
145
146
  className: "mt-3 text-xs text-text-tertiary",
146
147
  children: [
147
148
  "Recommended: 16:9 ratio, min 1200×675px. JPG or PNG, up to ",
@@ -152,119 +153,119 @@ function ie({ coverFileId: e, onUploaded: i, onCleared: a }) {
152
153
  ]
153
154
  });
154
155
  }
155
- function P({ open: t, onOpenChange: n, topicId: r, onCreated: u }) {
156
- let p = i(), te = a({ pagination: { limit: 100 } }), [m, N] = d(""), [P, F] = d(""), [ae, I] = d(!1), [L, R] = d(""), [z, B] = d(""), [V, oe] = d("ARTICLE"), [H, U] = d(r ?? ""), [W, G] = d([]), [K, q] = d([]), [J, Y] = d(""), [X, Z] = d(null), [se, Q] = d(null), [ce, le] = d(0), $ = ae ? P : o(m), ue = () => {
157
- N(""), F(""), I(!1), R(""), B(""), oe("ARTICLE"), U(r ?? ""), G([]), q([]), Y(""), Z(null), Q(null), le((e) => e + 1);
156
+ function P({ open: t, onOpenChange: n, topicId: o, onCreated: u }) {
157
+ let p = i(), h = a({ pagination: { limit: 100 } }), [g, N] = d(""), [P, F] = d(""), [oe, I] = d(!1), [L, R] = d(""), [z, B] = d(""), [V, H] = d("ARTICLE"), [U, W] = d(o ?? ""), [G, K] = d([]), [q, J] = d([]), [Y, se] = d(""), [ce, X] = d(null), [Z, Q] = d(null), [le, ue] = d(0), $ = oe ? P : s(g), de = () => {
158
+ N(""), F(""), I(!1), R(""), B(""), H("ARTICLE"), W(o ?? ""), K([]), J([]), se(""), X(null), Q(null), ue((e) => e + 1);
158
159
  };
159
- return /* @__PURE__ */ g(x, {
160
+ return /* @__PURE__ */ v(C, {
160
161
  open: t,
161
162
  onOpenChange: n,
162
- children: /* @__PURE__ */ _(S, {
163
+ children: /* @__PURE__ */ y(w, {
163
164
  className: "sm:max-w-3xl",
164
165
  children: [
165
- /* @__PURE__ */ _(T, { children: [/* @__PURE__ */ g(E, {
166
+ /* @__PURE__ */ y(D, { children: [/* @__PURE__ */ v(O, {
166
167
  className: "font-display",
167
168
  children: "Draft a story"
168
- }), /* @__PURE__ */ g(C, { children: "Begin a new piece — it enters the editorial lifecycle as a draft you can refine and publish later." })] }),
169
- /* @__PURE__ */ _("div", {
169
+ }), /* @__PURE__ */ v(T, { children: "Begin a new piece — it enters the editorial lifecycle as a draft you can refine and publish later." })] }),
170
+ /* @__PURE__ */ y("div", {
170
171
  className: "flex max-h-[64vh] flex-col gap-5 overflow-y-auto py-2",
171
172
  children: [
172
- /* @__PURE__ */ _("div", {
173
+ /* @__PURE__ */ y("div", {
173
174
  className: "grid gap-1.5",
174
- children: [/* @__PURE__ */ g(b, { children: "Cover image" }), /* @__PURE__ */ g(ie, {
175
- coverFileId: X,
176
- onUploaded: Z,
177
- onCleared: () => Z(null)
178
- }, ce)]
175
+ children: [/* @__PURE__ */ v(S, { children: "Cover image" }), /* @__PURE__ */ v(ae, {
176
+ coverFileId: ce,
177
+ onUploaded: X,
178
+ onCleared: () => X(null)
179
+ }, le)]
179
180
  }),
180
- /* @__PURE__ */ _("div", {
181
+ /* @__PURE__ */ y("div", {
181
182
  className: "grid gap-4 sm:grid-cols-2",
182
- children: [/* @__PURE__ */ _("div", {
183
+ children: [/* @__PURE__ */ y("div", {
183
184
  className: "grid gap-1.5",
184
- children: [/* @__PURE__ */ g(b, {
185
+ children: [/* @__PURE__ */ v(S, {
185
186
  htmlFor: "story-title",
186
187
  children: "Title"
187
- }), /* @__PURE__ */ g(y, {
188
+ }), /* @__PURE__ */ v(x, {
188
189
  id: "story-title",
189
- value: m,
190
+ value: g,
190
191
  onChange: (e) => N(e.target.value),
191
192
  placeholder: "e.g. The Weavers of the Coromandel Coast"
192
193
  })]
193
- }), /* @__PURE__ */ _("div", {
194
+ }), /* @__PURE__ */ y("div", {
194
195
  className: "grid gap-1.5",
195
196
  children: [
196
- /* @__PURE__ */ g(b, {
197
+ /* @__PURE__ */ v(S, {
197
198
  htmlFor: "story-slug",
198
199
  children: "URL slug"
199
200
  }),
200
- /* @__PURE__ */ _("div", {
201
+ /* @__PURE__ */ y("div", {
201
202
  className: "relative",
202
- children: [/* @__PURE__ */ g(y, {
203
+ children: [/* @__PURE__ */ v(x, {
203
204
  id: "story-slug",
204
205
  value: $,
205
206
  onChange: (e) => {
206
- I(!0), F(o(e.target.value));
207
+ I(!0), F(s(e.target.value));
207
208
  },
208
209
  placeholder: "the-weavers-of-the-coromandel-coast",
209
210
  className: $ ? "pr-9" : void 0
210
- }), $ && /* @__PURE__ */ g(f, {
211
+ }), $ && /* @__PURE__ */ v(f, {
211
212
  className: "pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-status-success-text",
212
213
  "aria-hidden": "true"
213
214
  })]
214
215
  }),
215
- /* @__PURE__ */ g("p", {
216
+ /* @__PURE__ */ v("p", {
216
217
  className: "text-xs text-text-tertiary",
217
218
  children: "Auto-derived from the title — used in the story’s URL, so keep it unique."
218
219
  })
219
220
  ]
220
221
  })]
221
222
  }),
222
- /* @__PURE__ */ _("div", {
223
+ /* @__PURE__ */ y("div", {
223
224
  className: "grid gap-4 sm:grid-cols-2",
224
- children: [/* @__PURE__ */ _("div", {
225
+ children: [/* @__PURE__ */ y("div", {
225
226
  className: "grid gap-1.5",
226
- children: [/* @__PURE__ */ g(b, { children: "Format" }), /* @__PURE__ */ _(D, {
227
+ children: [/* @__PURE__ */ v(S, { children: "Format" }), /* @__PURE__ */ y(k, {
227
228
  value: V,
228
- onValueChange: (e) => oe(e),
229
- children: [/* @__PURE__ */ g(ne, { children: /* @__PURE__ */ g(A, {}) }), /* @__PURE__ */ g(O, { children: re.map((e) => /* @__PURE__ */ g(k, {
229
+ onValueChange: (e) => H(e),
230
+ children: [/* @__PURE__ */ v(re, { children: /* @__PURE__ */ v(A, {}) }), /* @__PURE__ */ v(te, { children: ie.map((e) => /* @__PURE__ */ v(ne, {
230
231
  value: e,
231
- children: s(e)
232
+ children: c(e)
232
233
  }, e)) })]
233
234
  })]
234
- }), /* @__PURE__ */ _("div", {
235
+ }), /* @__PURE__ */ y("div", {
235
236
  className: "grid gap-1.5",
236
- children: [/* @__PURE__ */ g(b, {
237
+ children: [/* @__PURE__ */ v(S, {
237
238
  htmlFor: "story-reading",
238
239
  children: "Reading time (min)"
239
- }), /* @__PURE__ */ g(y, {
240
+ }), /* @__PURE__ */ v(x, {
240
241
  id: "story-reading",
241
242
  type: "number",
242
243
  min: 0,
243
- value: J,
244
- onChange: (e) => Y(e.target.value),
244
+ value: Y,
245
+ onChange: (e) => se(e.target.value),
245
246
  placeholder: "Optional"
246
247
  })]
247
248
  })]
248
249
  }),
249
- /* @__PURE__ */ _("div", {
250
+ /* @__PURE__ */ y("div", {
250
251
  className: "grid gap-1.5",
251
- children: [/* @__PURE__ */ g(b, { children: "Topic" }), /* @__PURE__ */ _(D, {
252
- value: H,
253
- onValueChange: U,
254
- children: [/* @__PURE__ */ g(ne, { children: /* @__PURE__ */ g(A, { placeholder: "Choose a topic (optional)" }) }), /* @__PURE__ */ g(O, { children: (te.data?.items ?? []).map((e) => /* @__PURE__ */ g(k, {
252
+ children: [/* @__PURE__ */ v(S, { children: "Topic" }), /* @__PURE__ */ y(k, {
253
+ value: U,
254
+ onValueChange: W,
255
+ children: [/* @__PURE__ */ v(re, { children: /* @__PURE__ */ v(A, { placeholder: "Choose a topic (optional)" }) }), /* @__PURE__ */ v(te, { children: (h.data?.items ?? []).map((e) => /* @__PURE__ */ v(ne, {
255
256
  value: e.id,
256
257
  children: e.name
257
258
  }, e.id)) })]
258
259
  })]
259
260
  }),
260
- /* @__PURE__ */ _("div", {
261
+ /* @__PURE__ */ y("div", {
261
262
  className: "grid gap-1.5",
262
- children: [/* @__PURE__ */ _("div", {
263
+ children: [/* @__PURE__ */ y("div", {
263
264
  className: "flex items-center justify-between gap-2",
264
- children: [/* @__PURE__ */ g(b, {
265
+ children: [/* @__PURE__ */ v(S, {
265
266
  htmlFor: "story-summary",
266
267
  children: "Summary"
267
- }), /* @__PURE__ */ _("span", {
268
+ }), /* @__PURE__ */ y("span", {
268
269
  className: "text-xs tabular-nums text-text-tertiary",
269
270
  children: [
270
271
  L.length,
@@ -272,7 +273,7 @@ function P({ open: t, onOpenChange: n, topicId: r, onCreated: u }) {
272
273
  M
273
274
  ]
274
275
  })]
275
- }), /* @__PURE__ */ g(j, {
276
+ }), /* @__PURE__ */ v(j, {
276
277
  id: "story-summary",
277
278
  value: L,
278
279
  onChange: (e) => R(e.target.value.slice(0, M)),
@@ -281,14 +282,15 @@ function P({ open: t, onOpenChange: n, topicId: r, onCreated: u }) {
281
282
  rows: 2
282
283
  })]
283
284
  }),
284
- /* @__PURE__ */ _("div", {
285
+ /* @__PURE__ */ v(e, {}),
286
+ /* @__PURE__ */ y("div", {
285
287
  className: "grid gap-1.5",
286
- children: [/* @__PURE__ */ _("div", {
288
+ children: [/* @__PURE__ */ y("div", {
287
289
  className: "flex items-center justify-between gap-2",
288
- children: [/* @__PURE__ */ g(b, {
290
+ children: [/* @__PURE__ */ v(S, {
289
291
  htmlFor: "story-body",
290
292
  children: "Body"
291
- }), /* @__PURE__ */ _("span", {
293
+ }), /* @__PURE__ */ y("span", {
292
294
  className: "text-xs tabular-nums text-text-tertiary",
293
295
  children: [
294
296
  z.length,
@@ -296,7 +298,7 @@ function P({ open: t, onOpenChange: n, topicId: r, onCreated: u }) {
296
298
  z.length === 1 ? "character" : "characters"
297
299
  ]
298
300
  })]
299
- }), /* @__PURE__ */ g(j, {
301
+ }), /* @__PURE__ */ v(j, {
300
302
  id: "story-body",
301
303
  value: z,
302
304
  onChange: (e) => B(e.target.value),
@@ -304,68 +306,68 @@ function P({ open: t, onOpenChange: n, topicId: r, onCreated: u }) {
304
306
  rows: 5
305
307
  })]
306
308
  }),
307
- /* @__PURE__ */ _("div", {
309
+ /* @__PURE__ */ y("div", {
308
310
  className: "grid gap-4 sm:grid-cols-2",
309
- children: [/* @__PURE__ */ _("div", {
311
+ children: [/* @__PURE__ */ y("div", {
310
312
  className: "grid gap-1.5",
311
- children: [/* @__PURE__ */ g(b, {
313
+ children: [/* @__PURE__ */ v(S, {
312
314
  htmlFor: "story-langs",
313
315
  children: "Languages"
314
- }), /* @__PURE__ */ g(e, {
316
+ }), /* @__PURE__ */ v(r, {
315
317
  id: "story-langs",
316
- value: W,
317
- onChange: G,
318
+ value: G,
319
+ onChange: K,
318
320
  placeholder: "e.g. English, Tamil…",
319
321
  preserveCase: !0
320
322
  })]
321
- }), /* @__PURE__ */ _("div", {
323
+ }), /* @__PURE__ */ y("div", {
322
324
  className: "grid gap-1.5",
323
- children: [/* @__PURE__ */ g(b, {
325
+ children: [/* @__PURE__ */ v(S, {
324
326
  htmlFor: "story-tags",
325
327
  children: "Tags"
326
- }), /* @__PURE__ */ g(e, {
328
+ }), /* @__PURE__ */ v(r, {
327
329
  id: "story-tags",
328
- value: K,
329
- onChange: q,
330
+ value: q,
331
+ onChange: J,
330
332
  placeholder: "Add tags…"
331
333
  })]
332
334
  })]
333
335
  }),
334
- se && /* @__PURE__ */ g("p", {
336
+ Z && /* @__PURE__ */ v("p", {
335
337
  className: "text-sm text-status-error-text",
336
- children: se
338
+ children: Z
337
339
  })
338
340
  ]
339
341
  }),
340
- /* @__PURE__ */ _(w, { children: [/* @__PURE__ */ g(v, {
342
+ /* @__PURE__ */ y(E, { children: [/* @__PURE__ */ v(b, {
341
343
  variant: "outline",
342
344
  onClick: () => n(!1),
343
345
  children: "Cancel"
344
- }), /* @__PURE__ */ g(v, {
346
+ }), /* @__PURE__ */ v(b, {
345
347
  onClick: async () => {
346
- if (!m.trim()) Q("A title is required.");
348
+ if (!g.trim()) Q("A title is required.");
347
349
  else if (!$) Q("A URL slug is required.");
348
350
  else try {
349
351
  let e = await p.mutateAsync({
350
- title: m.trim(),
352
+ title: g.trim(),
351
353
  slug: $,
352
354
  summary: L.trim() || null,
353
355
  body: z.trim() || null,
354
356
  format: V,
355
- topicId: H || null,
356
- languages: W.length ? W : null,
357
- tags: K.length ? K : null,
358
- readingMins: J ? Number(J) : null,
359
- coverFileId: X
357
+ topicId: U || null,
358
+ languages: G.length ? G : null,
359
+ tags: q.length ? q : null,
360
+ readingMins: Y ? Number(Y) : null,
361
+ coverFileId: ce
360
362
  });
361
- l.success("Story created", e.title), n(!1), ue(), u?.(e);
363
+ l.success("Story created", e.title), n(!1), de(), u?.(e);
362
364
  } catch (e) {
363
- let t = c(e);
365
+ let t = ee(e);
364
366
  Q(t), l.error("Could not create the story", t);
365
367
  }
366
368
  },
367
369
  disabled: p.isPending,
368
- children: p.isPending ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(ee, {
370
+ children: p.isPending ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(m, {
369
371
  className: "mr-1.5 h-4 w-4 animate-spin",
370
372
  "aria-hidden": "true"
371
373
  }), " Creating…"] }) : "Create story"