@parallelworks/tandem-web 0.166.1 → 0.168.0

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/pages/triage.js CHANGED
@@ -1,75 +1,87 @@
1
1
  import { api as e, unwrap as t } from "../api/client.js";
2
2
  import { usePageTitle as n } from "../lib/pageTitle.js";
3
3
  import { Link as r, useNavigate as i } from "../lib/router.js";
4
- import { issueQuery as a, teamsQuery as o } from "../api/queries.js";
5
- import { triageQuery as s } from "../lib/triage.js";
6
- import { PriorityIcon as c, StatusIcon as l, TriageIcon as u, usePriorityNames as d } from "../components/icons.js";
7
- import { usePeople as f } from "../lib/people.js";
8
- import { useTime as p } from "../lib/time.js";
9
- import { EntityIcon as m } from "../components/EntityIcon.js";
10
- import { useCanTriage as h } from "../lib/roles.js";
11
- import { actorAvatar as g } from "../lib/avatar.js";
12
- import { Editor as _ } from "../components/Editor.js";
13
- import { useShortcuts as v } from "../lib/shortcuts.js";
14
- import { Avatar as y, Button as b, EmptyState as x, buttonClasses as S, toast as C } from "@parallelworks/ui";
15
- import { useParams as w, useSearch as T } from "@tanstack/react-router";
16
- import { useCallback as E, useEffect as D, useRef as O, useState as k } from "react";
17
- import { useErrorMessage as A } from "@parallelworks/problem/react";
18
- import { useTranslations as j } from "use-intl";
19
- import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
20
- import { useMutation as F, useQuery as I, useQueryClient as L, useSuspenseQuery as R } from "@tanstack/react-query";
4
+ import { issueQuery as a, teamsQuery as o, triageVisitsQuery as s } from "../api/queries.js";
5
+ import { triageQuery as c, useVisitTriage as l } from "../lib/triage.js";
6
+ import { AddIcon as u, PriorityIcon as d, StatusIcon as f, TriageIcon as p, usePriorityNames as m } from "../components/icons.js";
7
+ import { usePeople as h } from "../lib/people.js";
8
+ import { useTime as g } from "../lib/time.js";
9
+ import { EntityIcon as _ } from "../components/EntityIcon.js";
10
+ import { useCanTriage as v } from "../lib/roles.js";
11
+ import { actorAvatar as y } from "../lib/avatar.js";
12
+ import { Editor as b } from "../components/Editor.js";
13
+ import { useShortcuts as x } from "../lib/shortcuts.js";
14
+ import { ActorAvatar as S } from "../components/ActorAvatar.js";
15
+ import { Avatar as C, Button as w, EmptyState as T, RelativeTime as E, buttonClasses as D, toast as O } from "@parallelworks/ui";
16
+ import { useParams as k, useSearch as A } from "@tanstack/react-router";
17
+ import { useCallback as j, useEffect as M, useRef as N, useState as P } from "react";
18
+ import { useErrorMessage as F } from "@parallelworks/problem/react";
19
+ import { useTranslations as I } from "use-intl";
20
+ import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
21
+ import { useMutation as B, useQuery as V, useQueryClient as H, useSuspenseQuery as U } from "@tanstack/react-query";
21
22
  // src/pages/triage.tsx
22
- function z() {
23
- let r = j("triage"), { workspace: a, key: o } = w({ strict: !1 }), { issue: c } = T({ strict: !1 }), { data: l } = R(s(a, o));
23
+ function W() {
24
+ let r = I("triage"), { workspace: a, key: o } = k({ strict: !1 }), { issue: u } = A({ strict: !1 }), { data: d } = U(c(a, o));
24
25
  n(r("title"));
25
- let d = l.issues, f = A(), p = L(), [m, h] = k(/* @__PURE__ */ new Set()), [g, _] = k(/* @__PURE__ */ new Set()), y = E((e, t) => {
26
- h((n) => n.has(e) === t ? n : t ? new Set(n).add(e) : V(n, e));
27
- }, []), S = d.filter((e) => m.has(e.id)), M = S.filter((e) => g.has(e.id)), I = i(), z = d.findIndex((e) => e.identifier === c?.toUpperCase()), W = O(null), G = d[z], K = (e) => I({
26
+ let f = d.issues, m = F(), h = H(), [g, _] = P(/* @__PURE__ */ new Set()), [v, y] = P(/* @__PURE__ */ new Set()), b = j((e, t) => {
27
+ _((n) => n.has(e) === t ? n : t ? new Set(n).add(e) : K(n, e));
28
+ }, []), S = f.filter((e) => g.has(e.id)), C = S.filter((e) => v.has(e.id)), E = i(), D = f.findIndex((e) => e.identifier === u?.toUpperCase()), L = N(null), V = f[D], { data: W } = U(s(a)), { mutate: q } = l(a), J = N(/* @__PURE__ */ new Set());
29
+ M(() => {
30
+ !V || W.includes(V.id) || J.current.has(V.id) || (J.current.add(V.id), q({
31
+ id: V.id,
32
+ identifier: V.identifier
33
+ }));
34
+ }, [
35
+ V,
36
+ W,
37
+ q
38
+ ]);
39
+ let Y = (e) => E({
28
40
  to: ".",
29
41
  search: e ? { issue: e.identifier.toLowerCase() } : {},
30
42
  replace: !0
31
- }), q = (e) => {
32
- m.has(e.id) && _((t) => t.has(e.id) ? V(t, e.id) : new Set(t).add(e.id));
33
- }, J = (e, t) => {
43
+ }), X = (e) => {
44
+ g.has(e.id) && y((t) => t.has(e.id) ? K(t, e.id) : new Set(t).add(e.id));
45
+ }, Z = (e, t) => {
34
46
  let [n, r] = e < t ? [e, t] : [t, e];
35
- _(new Set(d.slice(n, r + 1).filter((e) => m.has(e.id)).map((e) => e.id)));
36
- }, Y = (e, t) => {
37
- let n = d[t];
38
- n && (e.metaKey || e.ctrlKey ? (e.preventDefault(), q(n), W.current = t) : e.shiftKey && (e.preventDefault(), J(W.current ?? (z >= 0 ? z : t), t)));
39
- }, X = (e, t) => {
40
- if (d.length === 0) return;
41
- let n = z < 0 ? 0 : Math.min(Math.max(z + e, 0), d.length - 1);
42
- t && ((W.current === null || g.size === 0) && (W.current = Math.max(z, 0)), J(W.current, n)), K(d[n]);
43
- }, Z = (e) => {
44
- let t = d.findIndex((t) => t.id === e.id);
45
- e.id === G?.id && K(d[t + 1] ?? d[t - 1]);
47
+ y(new Set(f.slice(n, r + 1).filter((e) => g.has(e.id)).map((e) => e.id)));
48
+ }, ne = (e, t) => {
49
+ let n = f[t];
50
+ n && (e.metaKey || e.ctrlKey ? (e.preventDefault(), X(n), L.current = t) : e.shiftKey && (e.preventDefault(), Z(L.current ?? (D >= 0 ? D : t), t)));
51
+ }, Q = (e, t) => {
52
+ if (f.length === 0) return;
53
+ let n = D < 0 ? 0 : Math.min(Math.max(D + e, 0), f.length - 1);
54
+ t && ((L.current === null || v.size === 0) && (L.current = Math.max(D, 0)), Z(L.current, n)), Y(f[n]);
55
+ }, re = (e) => {
56
+ let t = f.findIndex((t) => t.id === e.id);
57
+ e.id === V?.id && Y(f[t + 1] ?? f[t - 1]);
46
58
  };
47
- v({
48
- j: () => X(1, !1),
49
- k: () => X(-1, !1),
50
- J: () => X(1, !0),
51
- K: () => X(-1, !0),
52
- ArrowDown: (e) => X(1, e.shiftKey),
53
- ArrowUp: (e) => X(-1, e.shiftKey),
59
+ x({
60
+ j: () => Q(1, !1),
61
+ k: () => Q(-1, !1),
62
+ J: () => Q(1, !0),
63
+ K: () => Q(-1, !0),
64
+ ArrowDown: (e) => Q(1, e.shiftKey),
65
+ ArrowUp: (e) => Q(-1, e.shiftKey),
54
66
  x: () => {
55
- G && (q(G), W.current = z);
67
+ V && (X(V), L.current = D);
56
68
  },
57
- Enter: () => G && I({
69
+ Enter: () => V && E({
58
70
  to: "/$workspace/issues/$identifier",
59
71
  params: {
60
72
  workspace: a,
61
- identifier: G.identifier
73
+ identifier: V.identifier
62
74
  }
63
75
  }),
64
- "Mod+a": () => _(new Set(d.map((e) => e.id))),
65
- "Shift+Mod+a": () => _(/* @__PURE__ */ new Set()),
66
- Escape: () => g.size > 0 ? _(/* @__PURE__ */ new Set()) : K(void 0)
67
- }), D(() => {
68
- let e = G && document.getElementById(`triage-${G.id}`);
76
+ "Mod+a": () => y(new Set(f.map((e) => e.id))),
77
+ "Shift+Mod+a": () => y(/* @__PURE__ */ new Set()),
78
+ Escape: () => v.size > 0 ? y(/* @__PURE__ */ new Set()) : Y(void 0)
79
+ }), M(() => {
80
+ let e = V && document.getElementById(`triage-${V.id}`);
69
81
  e && (e.scrollIntoView({ block: "nearest" }), e.parentElement?.contains(document.activeElement) && e.querySelector("a")?.focus({ preventScroll: !0 }));
70
- }, [G]);
71
- let Q = F({
72
- mutationFn: async (n) => (await Promise.allSettled(M.map(async (r) => t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/triage", {
82
+ }, [V]);
83
+ let $ = B({
84
+ mutationFn: async (n) => (await Promise.allSettled(C.map(async (r) => t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/triage", {
73
85
  params: { path: {
74
86
  workspace: a,
75
87
  identifier: r.identifier
@@ -77,106 +89,107 @@ function z() {
77
89
  body: { decision: n }
78
90
  }))))).filter((e) => e.status === "rejected"),
79
91
  onSuccess: (e) => {
80
- if (G && g.has(G.id)) {
81
- let e = (e) => !g.has(e.id);
82
- K(d.slice(z + 1).find(e) ?? d.slice(0, z).findLast(e));
92
+ if (V && v.has(V.id)) {
93
+ let e = (e) => !v.has(e.id);
94
+ Y(f.slice(D + 1).find(e) ?? f.slice(0, D).findLast(e));
83
95
  }
84
- _(/* @__PURE__ */ new Set());
96
+ y(/* @__PURE__ */ new Set());
85
97
  let t = e[0];
86
- t && C.error(r("bulkFailed", {
98
+ t && O.error(r("bulkFailed", {
87
99
  count: e.length,
88
- reason: f(t.reason)
100
+ reason: m(t.reason)
89
101
  }));
90
102
  },
91
- onSettled: () => p.invalidateQueries({ queryKey: [
103
+ onSettled: () => h.invalidateQueries({ queryKey: [
92
104
  "workspace",
93
105
  a,
94
106
  "issues"
95
107
  ] })
96
108
  });
97
- return /* @__PURE__ */ P("div", {
109
+ return /* @__PURE__ */ z("div", {
98
110
  className: "flex h-full flex-col",
99
- children: [/* @__PURE__ */ P("header", {
111
+ children: [/* @__PURE__ */ z("header", {
100
112
  className: "flex h-12 shrink-0 items-center gap-3 border-b border-border px-4 md:px-5",
101
113
  children: [
102
- /* @__PURE__ */ N("h1", {
114
+ /* @__PURE__ */ R("h1", {
103
115
  className: "text-sm font-semibold",
104
116
  children: r("title")
105
117
  }),
106
- /* @__PURE__ */ N("span", {
118
+ /* @__PURE__ */ R("span", {
107
119
  className: "text-xs text-muted-foreground tabular-nums",
108
- children: d.length
120
+ children: f.length
109
121
  }),
110
- M.length > 0 && /* @__PURE__ */ P("div", {
122
+ C.length > 0 && /* @__PURE__ */ z("div", {
111
123
  className: "ml-auto flex items-center gap-2",
112
124
  children: [
113
- /* @__PURE__ */ N("span", {
125
+ /* @__PURE__ */ R("span", {
114
126
  className: "text-xs font-medium text-human",
115
- children: r("selected", { count: M.length })
127
+ children: r("selected", { count: C.length })
116
128
  }),
117
- M.length < S.length && /* @__PURE__ */ N("button", {
129
+ C.length < S.length && /* @__PURE__ */ R("button", {
118
130
  type: "button",
119
- onClick: () => _(new Set(S.map((e) => e.id))),
131
+ onClick: () => y(new Set(S.map((e) => e.id))),
120
132
  className: "text-xs hover:underline",
121
133
  children: r("selectAll")
122
134
  }),
123
- /* @__PURE__ */ N("button", {
135
+ /* @__PURE__ */ R("button", {
124
136
  type: "button",
125
- onClick: () => _(/* @__PURE__ */ new Set()),
137
+ onClick: () => y(/* @__PURE__ */ new Set()),
126
138
  className: "text-xs hover:underline",
127
139
  children: r("clear")
128
140
  }),
129
- /* @__PURE__ */ N(b, {
141
+ /* @__PURE__ */ R(w, {
130
142
  variant: "outline",
131
143
  size: "sm",
132
144
  title: r("declineHelp"),
133
- loading: Q.isPending && Q.variables === "decline",
134
- disabled: Q.isPending,
135
- onClick: () => Q.mutate("decline"),
136
- children: r("declineCount", { count: M.length })
145
+ loading: $.isPending && $.variables === "decline",
146
+ disabled: $.isPending,
147
+ onClick: () => $.mutate("decline"),
148
+ children: r("declineCount", { count: C.length })
137
149
  }),
138
- /* @__PURE__ */ N(b, {
150
+ /* @__PURE__ */ R(w, {
139
151
  variant: "primary",
140
152
  size: "sm",
141
153
  title: r("acceptHelp"),
142
- loading: Q.isPending && Q.variables === "accept",
143
- disabled: Q.isPending,
144
- onClick: () => Q.mutate("accept"),
145
- children: r("acceptCount", { count: M.length })
154
+ loading: $.isPending && $.variables === "accept",
155
+ disabled: $.isPending,
156
+ onClick: () => $.mutate("accept"),
157
+ children: r("acceptCount", { count: C.length })
146
158
  })
147
159
  ]
148
160
  })
149
161
  ]
150
- }), d.length === 0 ? /* @__PURE__ */ N("div", {
162
+ }), f.length === 0 ? /* @__PURE__ */ R("div", {
151
163
  className: "min-h-0 flex-1 overflow-y-auto p-6",
152
- children: /* @__PURE__ */ N(x, {
153
- icon: /* @__PURE__ */ N(u, {}),
164
+ children: /* @__PURE__ */ R(T, {
165
+ icon: /* @__PURE__ */ R(p, {}),
154
166
  title: r("empty"),
155
167
  description: r("emptyDescription")
156
168
  })
157
- }) : /* @__PURE__ */ P("div", {
169
+ }) : /* @__PURE__ */ z("div", {
158
170
  className: "flex min-h-0 flex-1",
159
- children: [/* @__PURE__ */ N("ul", {
171
+ children: [/* @__PURE__ */ R("ul", {
160
172
  "aria-label": r("title"),
161
- className: B("min-h-0 min-w-0 flex-1 flex-col overflow-y-auto px-2 py-2 md:flex md:max-w-md md:border-r md:border-border", G ? "hidden" : "flex"),
162
- children: d.map((e, t) => /* @__PURE__ */ N(H, {
173
+ className: G("min-h-0 min-w-0 flex-1 flex-col overflow-y-auto px-2 py-2 md:flex md:max-w-md md:border-r md:border-border", V ? "hidden" : "flex"),
174
+ children: f.map((e, t) => /* @__PURE__ */ R(ee, {
163
175
  workspace: a,
164
176
  issue: e,
165
- onEligible: y,
166
- picked: g.has(e.id) && m.has(e.id),
167
- current: t === z,
168
- onClick: (e) => Y(e, t)
177
+ onEligible: b,
178
+ picked: v.has(e.id) && g.has(e.id),
179
+ current: t === D,
180
+ unread: !W.includes(e.id),
181
+ onClick: (e) => ne(e, t)
169
182
  }, e.id))
170
- }), /* @__PURE__ */ N("div", {
171
- className: B("min-w-0 flex-1 overflow-y-auto md:block", G ? "block" : "hidden"),
172
- children: G ? /* @__PURE__ */ N(U, {
183
+ }), /* @__PURE__ */ R("div", {
184
+ className: G("min-w-0 flex-1 overflow-y-auto md:block", V ? "block" : "hidden"),
185
+ children: V ? /* @__PURE__ */ R(te, {
173
186
  workspace: a,
174
- issue: G,
175
- onBack: () => K(void 0),
176
- onDecided: Z
177
- }, G.id) : /* @__PURE__ */ N("div", {
187
+ issue: V,
188
+ onBack: () => Y(void 0),
189
+ onDecided: re
190
+ }, V.id) : /* @__PURE__ */ R("div", {
178
191
  className: "px-6 py-24",
179
- children: /* @__PURE__ */ N(x, {
192
+ children: /* @__PURE__ */ R(T, {
180
193
  title: r("noneSelected"),
181
194
  description: r("shortcuts")
182
195
  })
@@ -185,67 +198,87 @@ function z() {
185
198
  })]
186
199
  });
187
200
  }
188
- var B = (...e) => e.filter(Boolean).join(" ");
189
- function V(e, t) {
201
+ var G = (...e) => e.filter(Boolean).join(" ");
202
+ function K(e, t) {
190
203
  let n = new Set(e);
191
204
  return n.delete(t), n;
192
205
  }
193
- function H({ workspace: e, issue: t, onEligible: n, picked: i, current: a, onClick: o }) {
194
- let s = j("triage"), c = p(), { actorName: l, avatarOf: u } = f(e), d = h(e, t.teamId);
195
- D(() => n(t.id, d), [
206
+ function ee({ workspace: e, issue: t, onEligible: n, picked: i, current: a, unread: o, onClick: s }) {
207
+ let c = I("triage"), { actorName: l, avatarOf: d } = h(e), p = v(e, t.teamId);
208
+ M(() => n(t.id, p), [
196
209
  n,
197
210
  t.id,
198
- d
211
+ p
199
212
  ]);
200
213
  let m = t.creator;
201
- return /* @__PURE__ */ N("li", {
214
+ return /* @__PURE__ */ R("li", {
202
215
  id: `triage-${t.id}`,
203
216
  "data-picked": i || void 0,
204
- children: /* @__PURE__ */ P(r, {
217
+ children: /* @__PURE__ */ z(r, {
205
218
  to: ".",
206
219
  search: { issue: t.identifier.toLowerCase() },
207
220
  replace: !0,
208
- onClick: o,
221
+ onClick: s,
209
222
  "aria-current": a || void 0,
210
- className: B("flex flex-col gap-1 px-3 py-2.5 select-none", i ? "bg-human-soft" : B("rounded-md", a ? "bg-muted" : "hover:bg-muted")),
211
- children: [/* @__PURE__ */ P("span", {
212
- className: "flex items-baseline gap-3",
213
- children: [/* @__PURE__ */ N("span", {
214
- className: "min-w-0 flex-1 truncate text-sm font-medium",
215
- children: t.title
216
- }), /* @__PURE__ */ N("span", {
217
- className: "shrink-0 text-xs text-muted-foreground tabular-nums",
218
- children: t.identifier
219
- })]
220
- }), /* @__PURE__ */ P("span", {
221
- className: "flex items-center gap-1.5 text-xs text-muted-foreground",
222
- children: [
223
- /* @__PURE__ */ N("span", {
224
- className: B("flex shrink-0 rounded-full", i && "ring-1 ring-human/40"),
225
- children: /* @__PURE__ */ N(y, {
226
- ...g(m.kind),
227
- name: l(m),
228
- src: u(m.kind, m.handle),
229
- size: "xs"
230
- })
231
- }),
232
- /* @__PURE__ */ N("span", {
233
- className: "min-w-0 flex-1 truncate",
234
- children: s("from", { name: l(m) })
235
- }),
236
- /* @__PURE__ */ N("time", {
237
- dateTime: t.createdAt,
238
- title: c.full(t.createdAt),
239
- className: "shrink-0 tabular-nums",
240
- children: c.relative(t.createdAt)
223
+ className: G("flex gap-3 px-2 py-2.5 select-none", i ? "bg-human-soft" : G("rounded-md", a ? "bg-muted" : "hover:bg-muted")),
224
+ children: [
225
+ /* @__PURE__ */ R("span", {
226
+ className: "flex w-2 shrink-0 justify-center pt-2.5",
227
+ children: o && /* @__PURE__ */ R("span", {
228
+ role: "img",
229
+ "aria-label": c("unseen"),
230
+ className: "size-2 rounded-full bg-primary"
241
231
  })
242
- ]
243
- })]
232
+ }),
233
+ /* @__PURE__ */ R("span", {
234
+ className: G("h-fit shrink-0 rounded-full", i && "ring-1 ring-human/40"),
235
+ children: /* @__PURE__ */ R(S, {
236
+ actor: m,
237
+ name: l(m),
238
+ src: d(m.kind, m.handle),
239
+ badge: /* @__PURE__ */ R(u, {})
240
+ })
241
+ }),
242
+ /* @__PURE__ */ z("span", {
243
+ className: "min-w-0 flex-1",
244
+ children: [/* @__PURE__ */ z("span", {
245
+ className: "flex items-baseline gap-2 text-sm",
246
+ children: [/* @__PURE__ */ R("span", {
247
+ className: G("shrink-0 text-xs tabular-nums", o ? "font-medium text-foreground" : "text-muted-foreground"),
248
+ children: t.identifier
249
+ }), /* @__PURE__ */ R("span", {
250
+ className: G("min-w-0 flex-1 truncate", o ? "font-medium text-foreground" : "text-muted-foreground"),
251
+ children: t.title
252
+ })]
253
+ }), /* @__PURE__ */ R("span", {
254
+ className: "mt-0.5 block truncate text-xs text-muted-foreground",
255
+ children: c("from", { name: l(m) })
256
+ })]
257
+ }),
258
+ /* @__PURE__ */ z("span", {
259
+ className: "flex shrink-0 flex-col items-end gap-1 pt-0.5",
260
+ children: [/* @__PURE__ */ z("span", {
261
+ className: "flex h-4 items-center",
262
+ children: [/* @__PURE__ */ R(f, {
263
+ category: t.status.category,
264
+ step: t.status.step
265
+ }), /* @__PURE__ */ R("span", {
266
+ className: "sr-only",
267
+ children: t.status.name
268
+ })]
269
+ }), /* @__PURE__ */ R(E, {
270
+ value: t.createdAt,
271
+ format: "compact",
272
+ exact: "medium",
273
+ className: "text-xs text-muted-foreground"
274
+ })]
275
+ })
276
+ ]
244
277
  })
245
278
  });
246
279
  }
247
- function U({ workspace: n, issue: i, onBack: s, onDecided: u }) {
248
- let v = j("triage"), x = p(), C = A(), w = L(), T = d(), { data: E } = R(o(n)), { data: D } = I(a(n, i.identifier)), O = D ?? i, { actorName: k, avatarOf: z } = f(n), B = E.find((e) => e.id === O.teamId), V = h(n, O.teamId), H = F({
280
+ function te({ workspace: n, issue: i, onBack: s, onDecided: c }) {
281
+ let l = I("triage"), u = g(), p = F(), x = H(), S = m(), { data: T } = U(o(n)), { data: E } = V(a(n, i.identifier)), O = E ?? i, { actorName: k, avatarOf: A } = h(n), j = T.find((e) => e.id === O.teamId), M = v(n, O.teamId), N = B({
249
282
  mutationFn: async (r) => t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/triage", {
250
283
  params: { path: {
251
284
  workspace: n,
@@ -254,62 +287,62 @@ function U({ workspace: n, issue: i, onBack: s, onDecided: u }) {
254
287
  body: { decision: r }
255
288
  })),
256
289
  onSuccess: () => {
257
- u(i), w.invalidateQueries({ queryKey: [
290
+ c(i), x.invalidateQueries({ queryKey: [
258
291
  "workspace",
259
292
  n,
260
293
  "issues"
261
294
  ] });
262
295
  }
263
- }), U = O.creator;
264
- return /* @__PURE__ */ P("article", {
296
+ }), P = O.creator;
297
+ return /* @__PURE__ */ z("article", {
265
298
  className: "mx-auto w-full max-w-3xl px-4 py-5 md:px-8",
266
299
  children: [
267
- /* @__PURE__ */ N("button", {
300
+ /* @__PURE__ */ R("button", {
268
301
  type: "button",
269
302
  onClick: s,
270
303
  className: "mb-3 text-xs text-muted-foreground hover:text-foreground md:hidden",
271
- children: v("back")
304
+ children: l("back")
272
305
  }),
273
- /* @__PURE__ */ P("p", {
306
+ /* @__PURE__ */ z("p", {
274
307
  className: "flex items-center gap-1.5 text-xs text-muted-foreground",
275
308
  children: [
276
- B && /* @__PURE__ */ N(m, {
277
- icon: B.icon,
278
- name: B.name,
309
+ j && /* @__PURE__ */ R(_, {
310
+ icon: j.icon,
311
+ name: j.name,
279
312
  className: "size-3.5"
280
313
  }),
281
- /* @__PURE__ */ N("span", {
314
+ /* @__PURE__ */ R("span", {
282
315
  className: "tabular-nums",
283
316
  children: O.identifier
284
317
  }),
285
- /* @__PURE__ */ N("span", {
318
+ /* @__PURE__ */ R("span", {
286
319
  "aria-hidden": "true",
287
320
  children: "·"
288
321
  }),
289
- /* @__PURE__ */ N(y, {
290
- ...g(U.kind),
291
- name: k(U),
292
- src: z(U.kind, U.handle),
322
+ /* @__PURE__ */ R(C, {
323
+ ...y(P.kind),
324
+ name: k(P),
325
+ src: A(P.kind, P.handle),
293
326
  size: "xs"
294
327
  }),
295
- /* @__PURE__ */ N("span", {
328
+ /* @__PURE__ */ R("span", {
296
329
  className: "truncate",
297
- children: v("from", { name: k(U) })
330
+ children: l("from", { name: k(P) })
298
331
  }),
299
- /* @__PURE__ */ N("span", {
332
+ /* @__PURE__ */ R("span", {
300
333
  "aria-hidden": "true",
301
334
  children: "·"
302
335
  }),
303
- /* @__PURE__ */ N("time", {
336
+ /* @__PURE__ */ R("time", {
304
337
  dateTime: O.createdAt,
305
- title: x.full(O.createdAt),
306
- children: x.relative(O.createdAt)
338
+ title: u.full(O.createdAt),
339
+ children: u.relative(O.createdAt)
307
340
  })
308
341
  ]
309
342
  }),
310
- /* @__PURE__ */ N("h2", {
343
+ /* @__PURE__ */ R("h2", {
311
344
  className: "mt-1 text-xl font-semibold text-balance",
312
- children: /* @__PURE__ */ N(r, {
345
+ children: /* @__PURE__ */ R(r, {
313
346
  to: "/$workspace/issues/$identifier",
314
347
  params: {
315
348
  workspace: n,
@@ -319,79 +352,79 @@ function U({ workspace: n, issue: i, onBack: s, onDecided: u }) {
319
352
  children: O.title
320
353
  })
321
354
  }),
322
- /* @__PURE__ */ P("div", {
355
+ /* @__PURE__ */ z("div", {
323
356
  className: "mt-4 flex flex-wrap items-center gap-2",
324
- children: [V && /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(b, {
357
+ children: [M && /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R(w, {
325
358
  variant: "primary",
326
359
  size: "sm",
327
- title: v("acceptHelp"),
328
- loading: H.isPending && H.variables === "accept",
329
- disabled: H.isPending,
330
- onClick: () => H.mutate("accept"),
331
- children: v("accept")
332
- }), /* @__PURE__ */ N(b, {
360
+ title: l("acceptHelp"),
361
+ loading: N.isPending && N.variables === "accept",
362
+ disabled: N.isPending,
363
+ onClick: () => N.mutate("accept"),
364
+ children: l("accept")
365
+ }), /* @__PURE__ */ R(w, {
333
366
  variant: "outline",
334
367
  size: "sm",
335
- title: v("declineHelp"),
336
- loading: H.isPending && H.variables === "decline",
337
- disabled: H.isPending,
338
- onClick: () => H.mutate("decline"),
339
- children: v("decline")
340
- })] }), /* @__PURE__ */ N(r, {
368
+ title: l("declineHelp"),
369
+ loading: N.isPending && N.variables === "decline",
370
+ disabled: N.isPending,
371
+ onClick: () => N.mutate("decline"),
372
+ children: l("decline")
373
+ })] }), /* @__PURE__ */ R(r, {
341
374
  to: "/$workspace/issues/$identifier",
342
375
  params: {
343
376
  workspace: n,
344
377
  identifier: O.identifier
345
378
  },
346
- className: S({
379
+ className: D({
347
380
  size: "sm",
348
381
  variant: "ghost"
349
382
  }),
350
- children: v("openIssue")
383
+ children: l("openIssue")
351
384
  })]
352
385
  }),
353
- H.error && /* @__PURE__ */ N("p", {
386
+ N.error && /* @__PURE__ */ R("p", {
354
387
  className: "mt-2 text-xs text-danger",
355
- children: C(H.error)
388
+ children: p(N.error)
356
389
  }),
357
- /* @__PURE__ */ N("p", {
390
+ /* @__PURE__ */ R("p", {
358
391
  className: "mt-3 text-xs text-muted-foreground",
359
- children: v("duplicateHint")
392
+ children: l("duplicateHint")
360
393
  }),
361
- /* @__PURE__ */ P("div", {
394
+ /* @__PURE__ */ z("div", {
362
395
  className: "mt-5 flex flex-wrap items-center gap-x-4 gap-y-1 border-y border-border py-2.5 text-xs text-muted-foreground",
363
396
  children: [
364
- /* @__PURE__ */ P("span", {
397
+ /* @__PURE__ */ z("span", {
365
398
  className: "inline-flex items-center gap-1.5",
366
- children: [/* @__PURE__ */ N(l, {
399
+ children: [/* @__PURE__ */ R(f, {
367
400
  category: O.status.category,
368
401
  step: O.status.step
369
402
  }), O.status.name]
370
403
  }),
371
- /* @__PURE__ */ P("span", {
404
+ /* @__PURE__ */ z("span", {
372
405
  className: "inline-flex items-center gap-1.5",
373
- children: [/* @__PURE__ */ N(c, { priority: O.priority }), T[O.priority]]
406
+ children: [/* @__PURE__ */ R(d, { priority: O.priority }), S[O.priority]]
374
407
  }),
375
- O.labels.map((e) => /* @__PURE__ */ P("span", {
408
+ O.labels.map((e) => /* @__PURE__ */ z("span", {
376
409
  className: "inline-flex items-center gap-1.5",
377
- children: [/* @__PURE__ */ N("span", {
410
+ children: [/* @__PURE__ */ R("span", {
378
411
  className: "size-2 rounded-full",
379
412
  style: { background: e.color }
380
413
  }), e.name]
381
414
  }, e.id))
382
415
  ]
383
416
  }),
384
- O.body.trim() ? /* @__PURE__ */ N("div", {
417
+ O.body.trim() ? /* @__PURE__ */ R("div", {
385
418
  className: "mt-5 text-sm",
386
- children: /* @__PURE__ */ N(_, {
419
+ children: /* @__PURE__ */ R(b, {
387
420
  value: O.body,
388
421
  editable: !1
389
422
  })
390
- }) : /* @__PURE__ */ N("p", {
423
+ }) : /* @__PURE__ */ R("p", {
391
424
  className: "mt-5 text-sm text-muted-foreground",
392
- children: v("noDescription")
425
+ children: l("noDescription")
393
426
  })
394
427
  ]
395
428
  });
396
429
  }
397
- export { z as TriagePage };
430
+ export { W as TriagePage };
package/routes/__root.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ErrorPage as e } from "@parallelworks/ui";
1
+ import { NotFound as e } from "../components/status.js";
2
2
  import { createRootRouteWithContext as t, lazyRouteComponent as n } from "@tanstack/react-router";
3
3
  import { jsx as r } from "react/jsx-runtime";
4
4
  // src/routes/__root.tsx
@@ -7,9 +7,9 @@ var i = t()({
7
7
  notFoundComponent: a
8
8
  });
9
9
  function a() {
10
- return /* @__PURE__ */ r("div", {
10
+ return /* @__PURE__ */ r("main", {
11
11
  className: "flex h-dvh",
12
- children: /* @__PURE__ */ r(e, { status: 404 })
12
+ children: /* @__PURE__ */ r(e, {})
13
13
  });
14
14
  }
15
15
  export { i as Route };