@burdenoff/microfe-govcitizenhub 2026.705.1 → 2026.705.2

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.
Files changed (69) hide show
  1. package/dist/govcitizenhub/components/Avatar.js +55 -0
  2. package/dist/govcitizenhub/components/Avatar.js.map +1 -0
  3. package/dist/govcitizenhub/components/DocumentUploadField.js +95 -45
  4. package/dist/govcitizenhub/components/DocumentUploadField.js.map +1 -1
  5. package/dist/govcitizenhub/components/FilterTabs.js +5 -4
  6. package/dist/govcitizenhub/components/FilterTabs.js.map +1 -1
  7. package/dist/govcitizenhub/components/KeyValueList.js +23 -0
  8. package/dist/govcitizenhub/components/KeyValueList.js.map +1 -0
  9. package/dist/govcitizenhub/components/MetricsCard.js +51 -26
  10. package/dist/govcitizenhub/components/MetricsCard.js.map +1 -1
  11. package/dist/govcitizenhub/components/PageLayout.js +81 -51
  12. package/dist/govcitizenhub/components/PageLayout.js.map +1 -1
  13. package/dist/govcitizenhub/components/Pagination.js +41 -19
  14. package/dist/govcitizenhub/components/Pagination.js.map +1 -1
  15. package/dist/govcitizenhub/components/SectionCard.js +31 -0
  16. package/dist/govcitizenhub/components/SectionCard.js.map +1 -0
  17. package/dist/govcitizenhub/components/SlaBadge.js +71 -0
  18. package/dist/govcitizenhub/components/SlaBadge.js.map +1 -0
  19. package/dist/govcitizenhub/components/StateViews.js +1 -16
  20. package/dist/govcitizenhub/components/StateViews.js.map +1 -1
  21. package/dist/govcitizenhub/components/StatusBadge.js +23 -10
  22. package/dist/govcitizenhub/components/StatusBadge.js.map +1 -1
  23. package/dist/govcitizenhub/components/StatusStepper.js +55 -0
  24. package/dist/govcitizenhub/components/StatusStepper.js.map +1 -0
  25. package/dist/govcitizenhub/components/SummaryStrip.js +54 -0
  26. package/dist/govcitizenhub/components/SummaryStrip.js.map +1 -0
  27. package/dist/govcitizenhub/components/TagInput.js +2 -2
  28. package/dist/govcitizenhub/components/TagInput.js.map +1 -1
  29. package/dist/govcitizenhub/components/Timeline.js +61 -0
  30. package/dist/govcitizenhub/components/Timeline.js.map +1 -0
  31. package/dist/govcitizenhub/hooks/useFiles.js +50 -22
  32. package/dist/govcitizenhub/hooks/useFiles.js.map +1 -1
  33. package/dist/govcitizenhub/hooks/useGovApi.js +40 -31
  34. package/dist/govcitizenhub/hooks/useGovApi.js.map +1 -1
  35. package/dist/govcitizenhub/pages/DashboardPage.js +118 -50
  36. package/dist/govcitizenhub/pages/DashboardPage.js.map +1 -1
  37. package/dist/govcitizenhub/pages/agencies/AgenciesPage.js +258 -137
  38. package/dist/govcitizenhub/pages/agencies/AgenciesPage.js.map +1 -1
  39. package/dist/govcitizenhub/pages/agencies/AgencyFormDialog.js +103 -90
  40. package/dist/govcitizenhub/pages/agencies/AgencyFormDialog.js.map +1 -1
  41. package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js +493 -397
  42. package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js.map +1 -1
  43. package/dist/govcitizenhub/pages/applications/ApplicationsPage.js +266 -80
  44. package/dist/govcitizenhub/pages/applications/ApplicationsPage.js.map +1 -1
  45. package/dist/govcitizenhub/pages/applications/NewApplicationPage.js +412 -174
  46. package/dist/govcitizenhub/pages/applications/NewApplicationPage.js.map +1 -1
  47. package/dist/govcitizenhub/pages/documents/DocumentsPage.js +313 -115
  48. package/dist/govcitizenhub/pages/documents/DocumentsPage.js.map +1 -1
  49. package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js +379 -176
  50. package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js.map +1 -1
  51. package/dist/govcitizenhub/pages/grievances/GrievancesPage.js +275 -184
  52. package/dist/govcitizenhub/pages/grievances/GrievancesPage.js.map +1 -1
  53. package/dist/govcitizenhub/pages/payments/PaymentsPage.js +251 -133
  54. package/dist/govcitizenhub/pages/payments/PaymentsPage.js.map +1 -1
  55. package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js +175 -105
  56. package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js.map +1 -1
  57. package/dist/govcitizenhub/pages/permits/PermitsPage.js +204 -110
  58. package/dist/govcitizenhub/pages/permits/PermitsPage.js.map +1 -1
  59. package/dist/govcitizenhub/pages/permits/VerifyPermitPage.js +290 -113
  60. package/dist/govcitizenhub/pages/permits/VerifyPermitPage.js.map +1 -1
  61. package/dist/govcitizenhub/pages/services/FormFieldBuilder.js +301 -0
  62. package/dist/govcitizenhub/pages/services/FormFieldBuilder.js.map +1 -0
  63. package/dist/govcitizenhub/pages/services/ServiceDetailPage.js +248 -163
  64. package/dist/govcitizenhub/pages/services/ServiceDetailPage.js.map +1 -1
  65. package/dist/govcitizenhub/pages/services/ServiceFormDialog.js +183 -149
  66. package/dist/govcitizenhub/pages/services/ServiceFormDialog.js.map +1 -1
  67. package/dist/govcitizenhub/pages/services/ServicesPage.js +228 -137
  68. package/dist/govcitizenhub/pages/services/ServicesPage.js.map +1 -1
  69. package/package.json +1 -1
@@ -3,46 +3,74 @@ import { PageLayout as t } from "../../components/PageLayout.js";
3
3
  import { formatDateTime as n, formatEnumLabel as r } from "../../utils/formatters.js";
4
4
  import { StatusBadge as i } from "../../components/StatusBadge.js";
5
5
  import "../../context/index.js";
6
- import { useGovGrievance as a, useGovTransitionGrievance as o, useGovUpdateGrievance as s } from "../../hooks/useGovApi.js";
6
+ import { useGovAgency as ee, useGovGrievance as te, useGovTransitionGrievance as a, useGovUpdateGrievance as o } from "../../hooks/useGovApi.js";
7
+ import { useFileUrl as s } from "../../hooks/useFiles.js";
7
8
  import "../../hooks/index.js";
8
- import { ErrorView as c, LoadingView as l, Section as u } from "../../components/StateViews.js";
9
- import { ConfirmDialog as d } from "../../components/ConfirmDialog.js";
10
- import { describeError as f, notify as p } from "../../lib/toast.js";
11
- import { useMemo as m, useState as h } from "react";
12
- import { Archive as g, CheckCircle2 as _, Eye as v, ImageIcon as y, MapPin as b, PlayCircle as x, UserPlus as S, XCircle as C } from "lucide-react";
13
- import { useParams as w } from "react-router-dom";
14
- import { jsx as T, jsxs as E } from "react/jsx-runtime";
15
- import { Button as D, GlassCard as O, Select as k, SelectContent as A, SelectItem as j, SelectTrigger as M, SelectValue as N } from "@burdenoff/fe-libs/ui";
9
+ import { ErrorView as ne, LoadingView as c } from "../../components/StateViews.js";
10
+ import { ConfirmDialog as l } from "../../components/ConfirmDialog.js";
11
+ import { describeError as u, notify as d } from "../../lib/toast.js";
12
+ import { StatusStepper as re } from "../../components/StatusStepper.js";
13
+ import { Timeline as ie, TimelineItem as ae } from "../../components/Timeline.js";
14
+ import { SectionCard as f } from "../../components/SectionCard.js";
15
+ import { KeyValueList as oe } from "../../components/KeyValueList.js";
16
+ import { AssigneeChip as se } from "../../components/Avatar.js";
17
+ import { CATEGORY_ICON as p } from "./GrievancesPage.js";
18
+ import { useMemo as ce, useState as m } from "react";
19
+ import { Archive as h, Ban as le, Building2 as ue, Camera as g, CheckCircle2 as _, ChevronDown as de, CircleHelp as fe, ClipboardList as v, Eye as y, FileText as pe, Flag as me, ImageIcon as he, MapPin as ge, PlayCircle as b, User as _e, UserPlus as x, XCircle as S } from "lucide-react";
20
+ import { useParams as C } from "react-router-dom";
21
+ import { jsx as w, jsxs as T } from "react/jsx-runtime";
22
+ import { Button as E, DropdownMenu as D, DropdownMenuContent as O, DropdownMenuItem as k, DropdownMenuTrigger as A, GlassCard as j, Select as M, SelectContent as N, SelectItem as P, SelectTrigger as F, SelectValue as I, Skeleton as L, Textarea as ve } from "@burdenoff/fe-libs/ui";
16
23
  //#region src/govcitizenhub/pages/grievances/GrievanceDetailPage.tsx
17
- var P = [
24
+ var ye = [
18
25
  "LOW",
19
26
  "NORMAL",
20
27
  "HIGH",
21
28
  "URGENT"
29
+ ], R = 1e3, z = [
30
+ {
31
+ status: "OPEN",
32
+ label: "Open"
33
+ },
34
+ {
35
+ status: "ACKNOWLEDGED",
36
+ label: "Acknowledged"
37
+ },
38
+ {
39
+ status: "IN_PROGRESS",
40
+ label: "In progress"
41
+ },
42
+ {
43
+ status: "RESOLVED",
44
+ label: "Resolved"
45
+ },
46
+ {
47
+ status: "CLOSED",
48
+ label: "Closed"
49
+ }
22
50
  ];
23
- function F(e) {
51
+ function be(e) {
24
52
  switch (e) {
25
53
  case "OPEN": return [{
26
54
  status: "ACKNOWLEDGED",
27
55
  label: "Acknowledge",
28
- icon: v,
56
+ icon: y,
29
57
  resolution: "none"
30
58
  }, {
31
59
  status: "REJECTED",
32
60
  label: "Reject",
33
- icon: C,
61
+ icon: S,
34
62
  resolution: "required",
35
63
  variant: "destructive"
36
64
  }];
37
65
  case "ACKNOWLEDGED": return [{
38
66
  status: "IN_PROGRESS",
39
67
  label: "Start work",
40
- icon: x,
68
+ icon: b,
41
69
  resolution: "none"
42
70
  }, {
43
71
  status: "REJECTED",
44
72
  label: "Reject",
45
- icon: C,
73
+ icon: S,
46
74
  resolution: "required",
47
75
  variant: "destructive"
48
76
  }];
@@ -54,7 +82,7 @@ function F(e) {
54
82
  }, {
55
83
  status: "REJECTED",
56
84
  label: "Reject",
57
- icon: C,
85
+ icon: S,
58
86
  resolution: "required",
59
87
  variant: "destructive"
60
88
  }];
@@ -62,214 +90,389 @@ function F(e) {
62
90
  case "REJECTED": return [{
63
91
  status: "CLOSED",
64
92
  label: "Close",
65
- icon: g,
93
+ icon: h,
66
94
  resolution: "optional",
67
95
  variant: "outline"
68
96
  }];
69
97
  default: return [];
70
98
  }
71
99
  }
72
- function I() {
73
- let { id: g } = w(), { navigateTo: _, currentUser: v } = e(), { data: x, isLoading: C, isError: I, refetch: L } = a(g), R = o(), z = s(), [B, V] = h(null), H = m(() => x ? F(x.status) : [], [x]);
74
- if (C) return /* @__PURE__ */ T(t, {
100
+ function xe({ fileId: e }) {
101
+ let { data: t, isLoading: n } = s(e);
102
+ return n ? /* @__PURE__ */ w(L, { className: "aspect-video w-full rounded-lg" }) : t ? /* @__PURE__ */ w("a", {
103
+ href: t,
104
+ target: "_blank",
105
+ rel: "noreferrer",
106
+ className: "group relative block aspect-video w-full overflow-hidden rounded-lg border border-border-seam focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
107
+ "aria-label": "Open photo evidence in a new tab",
108
+ children: /* @__PURE__ */ w("img", {
109
+ src: t,
110
+ alt: "Grievance photo evidence",
111
+ className: "size-full object-cover transition-transform group-hover:scale-105",
112
+ loading: "lazy"
113
+ })
114
+ }) : /* @__PURE__ */ w("div", {
115
+ className: "flex aspect-video w-full items-center justify-center rounded-lg border border-border-seam bg-bg-sunken",
116
+ children: /* @__PURE__ */ w(g, { className: "size-6 text-text-muted" })
117
+ });
118
+ }
119
+ function B() {
120
+ let { id: s } = C(), { navigateTo: h, currentUser: g } = e(), { data: y, isLoading: b, isError: L, refetch: B } = te(s), V = a(), H = o(), { data: U } = ee(y?.agencyId ?? void 0), [W, G] = m(null), [K, q] = m(""), J = ce(() => y ? be(y.status) : [], [y]);
121
+ if (b) return /* @__PURE__ */ w(t, {
75
122
  title: "Grievance",
76
123
  back: {
77
124
  label: "Grievances",
78
- onClick: () => _("grievances")
125
+ onClick: () => h("grievances")
79
126
  },
80
- children: /* @__PURE__ */ T(l, { label: "Loading grievance…" })
127
+ children: /* @__PURE__ */ w(c, { label: "Loading grievance…" })
81
128
  });
82
- if (I || !x) return /* @__PURE__ */ T(t, {
129
+ if (L || !y) return /* @__PURE__ */ w(t, {
83
130
  title: "Grievance",
84
131
  back: {
85
132
  label: "Grievances",
86
- onClick: () => _("grievances")
133
+ onClick: () => h("grievances")
87
134
  },
88
- children: /* @__PURE__ */ T(c, {
135
+ children: /* @__PURE__ */ w(ne, {
89
136
  message: "We couldn't load this grievance.",
90
- onRetry: () => L()
137
+ onRetry: () => B()
91
138
  })
92
139
  });
93
- let U = async (e, t) => {
140
+ let Y = y.status === "REJECTED", Se = Y ? -1 : z.findIndex((e) => e.status === y.status), Ce = z.map((e) => ({
141
+ key: e.status,
142
+ label: e.label
143
+ })), we = J.some((e) => e.status === "RESOLVED"), X = async (e, t) => {
94
144
  try {
95
- await R.mutateAsync({
96
- id: x.id,
145
+ await V.mutateAsync({
146
+ id: y.id,
97
147
  status: e.status,
98
148
  resolution: t.trim() || null
99
- }), p.success("Grievance updated", `Status is now ${r(e.status)}.`);
149
+ }), d.success("Grievance updated", `Status is now ${r(e.status)}.`);
100
150
  } catch (e) {
101
- p.error("Could not update the grievance", f(e));
151
+ d.error("Could not update the grievance", u(e));
102
152
  }
103
- }, W = async () => {
104
- if (v?.id) try {
105
- await z.mutateAsync({
106
- id: x.id,
107
- input: { assignedToId: v.id }
108
- }), p.success("Assigned to you");
153
+ }, Te = async () => {
154
+ if (!K.trim()) return;
155
+ let e = J.find((e) => e.status === "RESOLVED");
156
+ e && (await X(e, K), q(""));
157
+ }, Ee = async () => {
158
+ if (g?.id) try {
159
+ await H.mutateAsync({
160
+ id: y.id,
161
+ input: { assignedToId: g.id }
162
+ }), d.success("Assigned to you");
109
163
  } catch (e) {
110
- p.error("Could not assign", f(e));
164
+ d.error("Could not assign", u(e));
111
165
  }
112
- }, G = async (e) => {
166
+ }, De = async (e) => {
113
167
  try {
114
- await z.mutateAsync({
115
- id: x.id,
168
+ await H.mutateAsync({
169
+ id: y.id,
116
170
  input: { priority: e }
117
- }), p.success("Priority updated");
171
+ }), d.success("Priority updated");
118
172
  } catch (e) {
119
- p.error("Could not update priority", f(e));
173
+ d.error("Could not update priority", u(e));
174
+ }
175
+ }, Z = !!(y.assignedToId && y.assignedToId === g?.id), Oe = p[y.category] ?? fe, Q = [{
176
+ key: "reported",
177
+ title: "Reported",
178
+ tone: "default",
179
+ at: y.createdAt
180
+ }];
181
+ y.resolvedAt ? Q.push({
182
+ key: "resolved",
183
+ title: Y ? "Rejected" : "Resolved",
184
+ tone: Y ? "error" : "success",
185
+ at: y.resolvedAt,
186
+ body: y.resolution ?? void 0
187
+ }) : y.status !== "OPEN" && Q.push({
188
+ key: "current",
189
+ title: r(y.status),
190
+ tone: y.status === "IN_PROGRESS" ? "warning" : "info",
191
+ at: y.updatedAt
192
+ }), Q.sort((e, t) => new Date(t.at).getTime() - new Date(e.at).getTime());
193
+ let $ = [
194
+ {
195
+ label: "Routed to",
196
+ value: U ? /* @__PURE__ */ T("span", {
197
+ className: "inline-flex items-center gap-1.5",
198
+ children: [
199
+ /* @__PURE__ */ w(ue, { className: "size-3.5 text-text-muted" }),
200
+ " ",
201
+ U.name
202
+ ]
203
+ }) : y.agencyId ? "Assigned agency" : "Auto-route"
204
+ },
205
+ {
206
+ label: "Assigned to",
207
+ value: y.assignedToId ? Z ? /* @__PURE__ */ w(se, {
208
+ name: [g?.firstName, g?.lastName].filter(Boolean).join(" ") || g?.name || "You",
209
+ subtitle: "You"
210
+ }) : "An officer" : "Unassigned"
211
+ },
212
+ {
213
+ label: "Category",
214
+ value: r(y.category)
215
+ },
216
+ {
217
+ label: "Priority",
218
+ value: /* @__PURE__ */ w(i, { status: y.priority })
219
+ },
220
+ {
221
+ label: "Reporter",
222
+ value: /* @__PURE__ */ T("span", {
223
+ className: "font-mono text-xs",
224
+ children: [y.reporterId.slice(0, 12), "…"]
225
+ })
226
+ },
227
+ {
228
+ label: "Created on",
229
+ value: n(y.createdAt)
230
+ },
231
+ {
232
+ label: "Last updated",
233
+ value: n(y.updatedAt)
120
234
  }
121
- }, K = x.assignedToId && x.assignedToId === v?.id;
122
- return /* @__PURE__ */ E(t, {
123
- title: x.title,
235
+ ];
236
+ return y.resolvedAt && $.push({
237
+ label: "Resolved on",
238
+ value: n(y.resolvedAt)
239
+ }), y.latitude != null && y.longitude != null && $.push({
240
+ label: "Coordinates",
241
+ value: /* @__PURE__ */ T("span", {
242
+ className: "font-mono text-xs",
243
+ children: [
244
+ y.latitude.toFixed(4),
245
+ ", ",
246
+ y.longitude.toFixed(4)
247
+ ]
248
+ })
249
+ }), $.push({
250
+ label: "Grievance ID",
251
+ value: /* @__PURE__ */ T("span", {
252
+ className: "font-mono text-xs",
253
+ children: [y.id.slice(0, 12), "…"]
254
+ })
255
+ }), /* @__PURE__ */ T(t, {
256
+ title: y.title,
124
257
  back: {
125
258
  label: "Grievances",
126
- onClick: () => _("grievances")
259
+ onClick: () => h("grievances")
127
260
  },
128
- actions: /* @__PURE__ */ E("div", {
261
+ actions: /* @__PURE__ */ T("div", {
129
262
  className: "flex flex-wrap items-center gap-2",
130
- children: [!K && v?.id && /* @__PURE__ */ E(D, {
263
+ children: [!Z && g?.id && /* @__PURE__ */ T(E, {
131
264
  variant: "outline",
132
- onClick: W,
133
- disabled: z.isPending,
134
- children: [/* @__PURE__ */ T(S, { className: "mr-1.5 h-4 w-4" }), " Assign to me"]
135
- }), H.map((e) => {
136
- let t = e.icon;
137
- return /* @__PURE__ */ E(D, {
138
- variant: e.variant ?? "default",
139
- disabled: R.isPending,
140
- onClick: () => e.resolution === "none" ? U(e, "") : V(e),
141
- children: [
142
- /* @__PURE__ */ T(t, { className: "mr-1.5 h-4 w-4" }),
143
- " ",
144
- e.label
145
- ]
146
- }, e.status);
147
- })]
265
+ onClick: Ee,
266
+ disabled: H.isPending,
267
+ children: [/* @__PURE__ */ w(x, { className: "mr-1.5 h-4 w-4" }), " Assign to me"]
268
+ }), J.length > 0 && /* @__PURE__ */ T(D, { children: [/* @__PURE__ */ w(A, {
269
+ asChild: !0,
270
+ children: /* @__PURE__ */ T(E, {
271
+ disabled: V.isPending,
272
+ children: ["Change status ", /* @__PURE__ */ w(de, { className: "ml-1.5 h-4 w-4" })]
273
+ })
274
+ }), /* @__PURE__ */ w(O, {
275
+ align: "end",
276
+ className: "min-w-48",
277
+ children: J.map((e) => {
278
+ let t = e.icon;
279
+ return /* @__PURE__ */ T(k, {
280
+ className: e.variant === "destructive" ? "gap-2 text-status-error-text focus:text-status-error-text" : "gap-2",
281
+ onSelect: () => e.resolution === "none" ? X(e, "") : G(e),
282
+ children: [
283
+ /* @__PURE__ */ w(t, { className: "size-4" }),
284
+ " ",
285
+ e.label
286
+ ]
287
+ }, e.status);
288
+ })
289
+ })] })]
148
290
  }),
149
- children: [/* @__PURE__ */ E("div", {
150
- className: "grid gap-4 lg:grid-cols-3",
151
- children: [/* @__PURE__ */ E(O, {
152
- treatment: "plain",
153
- className: "border-border-seam p-5 lg:col-span-2",
291
+ children: [
292
+ /* @__PURE__ */ T("div", {
293
+ className: "mb-5 flex flex-wrap items-center gap-2",
154
294
  children: [
155
- /* @__PURE__ */ E("div", {
156
- className: "flex flex-wrap items-center gap-2",
295
+ /* @__PURE__ */ w(i, {
296
+ status: y.status,
297
+ size: "md"
298
+ }),
299
+ /* @__PURE__ */ w(i, { status: y.priority }),
300
+ /* @__PURE__ */ T("span", {
301
+ className: "inline-flex items-center gap-1.5 rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
157
302
  children: [
158
- /* @__PURE__ */ T(i, { status: x.status }),
159
- /* @__PURE__ */ T(i, { status: x.priority }),
160
- /* @__PURE__ */ T(i, { status: x.category })
303
+ /* @__PURE__ */ w(Oe, { className: "size-3.5" }),
304
+ " ",
305
+ r(y.category)
161
306
  ]
162
- }),
163
- /* @__PURE__ */ T("p", {
164
- className: "mt-4 whitespace-pre-wrap text-sm text-text-secondary",
165
- children: x.description
166
- }),
167
- x.resolution && /* @__PURE__ */ T(u, {
168
- title: "Resolution",
169
- className: "mt-6",
170
- children: /* @__PURE__ */ T("p", {
171
- className: "rounded-lg bg-bg-sunken px-3 py-2 text-sm text-text-secondary",
172
- children: x.resolution
173
- })
174
- }),
175
- x.tags.length > 0 && /* @__PURE__ */ T("div", {
176
- className: "mt-5 flex flex-wrap gap-1.5",
177
- children: x.tags.map((e) => /* @__PURE__ */ T("span", {
178
- className: "rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
179
- children: e
180
- }, e))
181
307
  })
182
308
  ]
183
- }), /* @__PURE__ */ E(O, {
309
+ }),
310
+ /* @__PURE__ */ T(j, {
184
311
  treatment: "plain",
185
- className: "h-fit border-border-seam p-5",
186
- children: [/* @__PURE__ */ E("dl", {
187
- className: "space-y-3 text-sm",
312
+ className: "mb-4 border-border-seam p-5",
313
+ children: [Y && /* @__PURE__ */ T("div", {
314
+ className: "mb-4 flex items-center gap-2 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
315
+ children: [/* @__PURE__ */ w(le, { className: "size-4 shrink-0" }), " This grievance was rejected and did not proceed through resolution."]
316
+ }), /* @__PURE__ */ w(re, {
317
+ steps: Ce,
318
+ current: Se
319
+ })]
320
+ }),
321
+ /* @__PURE__ */ T("div", {
322
+ className: "grid gap-4 lg:grid-cols-3",
323
+ children: [/* @__PURE__ */ T("div", {
324
+ className: "space-y-4 lg:col-span-2",
188
325
  children: [
189
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
190
- className: "text-text-muted",
191
- children: "Reported"
192
- }), /* @__PURE__ */ T("dd", {
193
- className: "font-medium text-text-primary",
194
- children: n(x.createdAt)
195
- })] }),
196
- x.location && /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
197
- className: "text-text-muted",
198
- children: "Location"
199
- }), /* @__PURE__ */ E("dd", {
200
- className: "flex items-center gap-1.5 font-medium text-text-primary",
201
- children: [
202
- /* @__PURE__ */ T(b, { className: "h-3.5 w-3.5 text-text-muted" }),
203
- " ",
204
- x.location
205
- ]
206
- })] }),
207
- x.photoFileIds.length > 0 && /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
208
- className: "text-text-muted",
209
- children: "Photos"
210
- }), /* @__PURE__ */ E("dd", {
211
- className: "flex items-center gap-1.5 font-medium text-text-primary",
326
+ /* @__PURE__ */ T(f, {
327
+ title: "Description",
328
+ icon: /* @__PURE__ */ w(pe, {}),
329
+ children: [/* @__PURE__ */ w("p", {
330
+ className: "whitespace-pre-wrap text-sm text-text-secondary",
331
+ children: y.description
332
+ }), /* @__PURE__ */ T("div", {
333
+ className: "mt-4 flex flex-wrap items-center gap-x-6 gap-y-2 border-t border-border-seam pt-4 text-sm",
334
+ children: [/* @__PURE__ */ T("div", {
335
+ className: "flex items-center gap-2",
336
+ children: [
337
+ /* @__PURE__ */ w(_e, { className: "size-4 text-text-muted" }),
338
+ /* @__PURE__ */ w("span", {
339
+ className: "text-text-muted",
340
+ children: "Reported by"
341
+ }),
342
+ /* @__PURE__ */ T("span", {
343
+ className: "font-mono text-xs text-text-primary",
344
+ children: [y.reporterId.slice(0, 12), "…"]
345
+ })
346
+ ]
347
+ }), /* @__PURE__ */ T("div", {
348
+ className: "flex items-center gap-2",
349
+ children: [/* @__PURE__ */ w("span", {
350
+ className: "text-text-muted",
351
+ children: "Reported on"
352
+ }), /* @__PURE__ */ w("span", {
353
+ className: "font-medium text-text-primary",
354
+ children: n(y.createdAt)
355
+ })]
356
+ })]
357
+ })]
358
+ }),
359
+ y.photoFileIds.length > 0 && /* @__PURE__ */ w(f, {
360
+ title: `Photo evidence (${y.photoFileIds.length})`,
361
+ icon: /* @__PURE__ */ w(he, {}),
362
+ children: /* @__PURE__ */ w("div", {
363
+ className: "grid grid-cols-2 gap-3 sm:grid-cols-3",
364
+ children: y.photoFileIds.map((e) => /* @__PURE__ */ w(xe, { fileId: e }, e))
365
+ })
366
+ }),
367
+ /* @__PURE__ */ w(f, {
368
+ title: "Resolution timeline",
369
+ icon: /* @__PURE__ */ w(v, {}),
370
+ children: /* @__PURE__ */ w(ie, { children: Q.map((e, t) => /* @__PURE__ */ w(ae, {
371
+ tone: e.tone,
372
+ title: e.title,
373
+ timestamp: n(e.at),
374
+ last: t === Q.length - 1,
375
+ children: e.body
376
+ }, e.key)) })
377
+ }),
378
+ we ? /* @__PURE__ */ T(f, {
379
+ title: "Resolution",
380
+ icon: /* @__PURE__ */ w(_, {}),
381
+ children: [/* @__PURE__ */ w(ve, {
382
+ value: K,
383
+ onChange: (e) => q(e.target.value.slice(0, R)),
384
+ placeholder: "Enter resolution details, actions taken, and remarks…",
385
+ rows: 4,
386
+ "aria-label": "Resolution details"
387
+ }), /* @__PURE__ */ T("div", {
388
+ className: "mt-2 flex items-center justify-between gap-2",
389
+ children: [/* @__PURE__ */ T("span", {
390
+ className: "text-xs text-text-muted tabular-nums",
391
+ children: [
392
+ K.length,
393
+ " / ",
394
+ R
395
+ ]
396
+ }), /* @__PURE__ */ T(E, {
397
+ onClick: Te,
398
+ disabled: !K.trim() || V.isPending,
399
+ children: [/* @__PURE__ */ w(_, { className: "mr-1.5 h-4 w-4" }), " Resolve"]
400
+ })]
401
+ })]
402
+ }) : y.resolution && /* @__PURE__ */ w(f, {
403
+ title: Y ? "Rejection reason" : "Resolution",
404
+ icon: w(Y ? S : _, {}),
405
+ children: /* @__PURE__ */ w("p", {
406
+ className: "whitespace-pre-wrap rounded-lg bg-bg-sunken px-3 py-2 text-sm text-text-secondary",
407
+ children: y.resolution
408
+ })
409
+ })
410
+ ]
411
+ }), /* @__PURE__ */ T("div", {
412
+ className: "space-y-4",
413
+ children: [y.location && /* @__PURE__ */ T(f, {
414
+ title: "Location",
415
+ icon: /* @__PURE__ */ w(ge, {}),
416
+ children: [/* @__PURE__ */ w("p", {
417
+ className: "text-sm font-medium text-text-primary",
418
+ children: y.location
419
+ }), y.latitude != null && y.longitude != null && /* @__PURE__ */ T("p", {
420
+ className: "mt-1 font-mono text-xs text-text-muted",
212
421
  children: [
213
- /* @__PURE__ */ T(y, { className: "h-3.5 w-3.5 text-text-muted" }),
214
- " ",
215
- x.photoFileIds.length,
216
- " attached"
422
+ y.latitude.toFixed(4),
423
+ "° N, ",
424
+ y.longitude.toFixed(4),
425
+ "° E"
217
426
  ]
218
- })] }),
219
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
220
- className: "text-text-muted",
221
- children: "Assigned"
222
- }), /* @__PURE__ */ T("dd", {
223
- className: "font-medium text-text-primary",
224
- children: x.assignedToId ? K ? "You" : "An officer" : "Unassigned"
225
- })] }),
226
- x.resolvedAt && /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
227
- className: "text-text-muted",
228
- children: "Resolved"
229
- }), /* @__PURE__ */ T("dd", {
230
- className: "font-medium text-text-primary",
231
- children: n(x.resolvedAt)
232
- })] })
233
- ]
234
- }), /* @__PURE__ */ E("div", {
235
- className: "mt-5 border-t border-border-seam pt-4",
236
- children: [/* @__PURE__ */ T("label", {
237
- className: "text-xs text-text-muted",
238
- children: "Priority"
239
- }), /* @__PURE__ */ E(k, {
240
- value: x.priority,
241
- onValueChange: (e) => G(e),
242
- children: [/* @__PURE__ */ T(M, {
243
- className: "mt-1.5",
244
- "aria-label": "Priority",
245
- disabled: z.isPending,
246
- children: /* @__PURE__ */ T(N, {})
247
- }), /* @__PURE__ */ T(A, { children: P.map((e) => /* @__PURE__ */ T(j, {
248
- value: e,
249
- children: r(e)
250
- }, e)) })]
427
+ })]
428
+ }), /* @__PURE__ */ T(f, {
429
+ title: "Details",
430
+ icon: /* @__PURE__ */ w(v, {}),
431
+ children: [/* @__PURE__ */ w(oe, {
432
+ items: $,
433
+ variant: "stacked"
434
+ }), /* @__PURE__ */ T("div", {
435
+ className: "mt-4 border-t border-border-seam pt-4",
436
+ children: [/* @__PURE__ */ T("label", {
437
+ className: "flex items-center gap-1.5 text-xs text-text-muted",
438
+ children: [/* @__PURE__ */ w(me, { className: "size-3.5" }), " Priority"]
439
+ }), /* @__PURE__ */ T(M, {
440
+ value: y.priority,
441
+ onValueChange: (e) => De(e),
442
+ children: [/* @__PURE__ */ w(F, {
443
+ className: "mt-1.5",
444
+ "aria-label": "Priority",
445
+ disabled: H.isPending,
446
+ children: /* @__PURE__ */ w(I, {})
447
+ }), /* @__PURE__ */ w(N, { children: ye.map((e) => /* @__PURE__ */ w(P, {
448
+ value: e,
449
+ children: r(e)
450
+ }, e)) })]
451
+ })]
452
+ })]
251
453
  })]
252
454
  })]
253
- })]
254
- }), B && /* @__PURE__ */ T(d, {
255
- open: !!B,
256
- onOpenChange: (e) => e ? void 0 : V(null),
257
- title: `${B.label} grievance?`,
258
- description: `This will move the grievance to ${r(B.status)}.`,
259
- confirmLabel: B.label,
260
- destructive: B.status === "REJECTED",
261
- reason: {
262
- label: B.status === "REJECTED" ? "Reason for rejection" : "Resolution note",
263
- placeholder: "Explain the outcome…",
264
- required: B.resolution === "required"
265
- },
266
- onConfirm: async (e) => {
267
- await U(B, e), V(null);
268
- }
269
- })]
455
+ }),
456
+ W && /* @__PURE__ */ w(l, {
457
+ open: !!W,
458
+ onOpenChange: (e) => e ? void 0 : G(null),
459
+ title: `${W.label} grievance?`,
460
+ description: `This will move the grievance to ${r(W.status)}.`,
461
+ confirmLabel: W.label,
462
+ destructive: W.status === "REJECTED",
463
+ reason: {
464
+ label: W.status === "REJECTED" ? "Reason for rejection" : "Resolution note",
465
+ placeholder: "Explain the outcome…",
466
+ required: W.resolution === "required"
467
+ },
468
+ onConfirm: async (e) => {
469
+ await X(W, e), G(null);
470
+ }
471
+ })
472
+ ]
270
473
  });
271
474
  }
272
475
  //#endregion
273
- export { I as GrievanceDetailPage };
476
+ export { B as GrievanceDetailPage };
274
477
 
275
478
  //# sourceMappingURL=GrievanceDetailPage.js.map