@burdenoff/microfe-govcitizenhub 2026.705.1 → 2026.705.3
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/govcitizenhub/components/Avatar.js +55 -0
- package/dist/govcitizenhub/components/Avatar.js.map +1 -0
- package/dist/govcitizenhub/components/DocumentUploadField.js +95 -45
- package/dist/govcitizenhub/components/DocumentUploadField.js.map +1 -1
- package/dist/govcitizenhub/components/FilterTabs.js +5 -4
- package/dist/govcitizenhub/components/FilterTabs.js.map +1 -1
- package/dist/govcitizenhub/components/KeyValueList.js +23 -0
- package/dist/govcitizenhub/components/KeyValueList.js.map +1 -0
- package/dist/govcitizenhub/components/MetricsCard.js +51 -26
- package/dist/govcitizenhub/components/MetricsCard.js.map +1 -1
- package/dist/govcitizenhub/components/PageLayout.js +81 -51
- package/dist/govcitizenhub/components/PageLayout.js.map +1 -1
- package/dist/govcitizenhub/components/Pagination.js +41 -19
- package/dist/govcitizenhub/components/Pagination.js.map +1 -1
- package/dist/govcitizenhub/components/SectionCard.js +31 -0
- package/dist/govcitizenhub/components/SectionCard.js.map +1 -0
- package/dist/govcitizenhub/components/SlaBadge.js +71 -0
- package/dist/govcitizenhub/components/SlaBadge.js.map +1 -0
- package/dist/govcitizenhub/components/StateViews.js +1 -16
- package/dist/govcitizenhub/components/StateViews.js.map +1 -1
- package/dist/govcitizenhub/components/StatusBadge.js +23 -10
- package/dist/govcitizenhub/components/StatusBadge.js.map +1 -1
- package/dist/govcitizenhub/components/StatusStepper.js +55 -0
- package/dist/govcitizenhub/components/StatusStepper.js.map +1 -0
- package/dist/govcitizenhub/components/SummaryStrip.js +54 -0
- package/dist/govcitizenhub/components/SummaryStrip.js.map +1 -0
- package/dist/govcitizenhub/components/TagInput.js +2 -2
- package/dist/govcitizenhub/components/TagInput.js.map +1 -1
- package/dist/govcitizenhub/components/Timeline.js +61 -0
- package/dist/govcitizenhub/components/Timeline.js.map +1 -0
- package/dist/govcitizenhub/hooks/useFiles.js +50 -22
- package/dist/govcitizenhub/hooks/useFiles.js.map +1 -1
- package/dist/govcitizenhub/hooks/useGovApi.js +44 -34
- package/dist/govcitizenhub/hooks/useGovApi.js.map +1 -1
- package/dist/govcitizenhub/pages/DashboardPage.js +118 -50
- package/dist/govcitizenhub/pages/DashboardPage.js.map +1 -1
- package/dist/govcitizenhub/pages/agencies/AgenciesPage.js +258 -137
- package/dist/govcitizenhub/pages/agencies/AgenciesPage.js.map +1 -1
- package/dist/govcitizenhub/pages/agencies/AgencyFormDialog.js +103 -90
- package/dist/govcitizenhub/pages/agencies/AgencyFormDialog.js.map +1 -1
- package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js +493 -397
- package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js.map +1 -1
- package/dist/govcitizenhub/pages/applications/ApplicationsPage.js +268 -80
- package/dist/govcitizenhub/pages/applications/ApplicationsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/applications/NewApplicationPage.js +412 -174
- package/dist/govcitizenhub/pages/applications/NewApplicationPage.js.map +1 -1
- package/dist/govcitizenhub/pages/documents/DocumentsPage.js +313 -115
- package/dist/govcitizenhub/pages/documents/DocumentsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js +379 -176
- package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js.map +1 -1
- package/dist/govcitizenhub/pages/grievances/GrievancesPage.js +275 -184
- package/dist/govcitizenhub/pages/grievances/GrievancesPage.js.map +1 -1
- package/dist/govcitizenhub/pages/payments/PaymentsPage.js +251 -133
- package/dist/govcitizenhub/pages/payments/PaymentsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js +175 -105
- package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js.map +1 -1
- package/dist/govcitizenhub/pages/permits/PermitsPage.js +204 -110
- package/dist/govcitizenhub/pages/permits/PermitsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/permits/VerifyPermitPage.js +290 -113
- package/dist/govcitizenhub/pages/permits/VerifyPermitPage.js.map +1 -1
- package/dist/govcitizenhub/pages/services/FormFieldBuilder.js +301 -0
- package/dist/govcitizenhub/pages/services/FormFieldBuilder.js.map +1 -0
- package/dist/govcitizenhub/pages/services/ServiceDetailPage.js +248 -163
- package/dist/govcitizenhub/pages/services/ServiceDetailPage.js.map +1 -1
- package/dist/govcitizenhub/pages/services/ServiceFormDialog.js +182 -148
- package/dist/govcitizenhub/pages/services/ServiceFormDialog.js.map +1 -1
- package/dist/govcitizenhub/pages/services/ServicesPage.js +228 -137
- package/dist/govcitizenhub/pages/services/ServicesPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { useGovCitizenHub as e } from "../../context/GovCitizenHubContext.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { cn as t } from "../../utils/cn.js";
|
|
3
|
+
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
|
+
import { formatEnumLabel as r, formatRelativeTime as i } from "../../utils/formatters.js";
|
|
5
|
+
import { StatusBadge as a } from "../../components/StatusBadge.js";
|
|
6
|
+
import { EmptyState as o } from "../../components/EmptyState.js";
|
|
6
7
|
import "../../context/index.js";
|
|
7
|
-
import { useGovAgencies as
|
|
8
|
-
import { useCursorPager as
|
|
9
|
-
import { FILE_FOLDERS as
|
|
8
|
+
import { useGovAgencies as s, useGovGrievances as c, useGovReportGrievance as l } from "../../hooks/useGovApi.js";
|
|
9
|
+
import { useCursorPager as u } from "../../hooks/useCursorPager.js";
|
|
10
|
+
import { FILE_FOLDERS as d, uploadFileToFiles as f } from "../../hooks/useFiles.js";
|
|
10
11
|
import "../../hooks/index.js";
|
|
11
|
-
import { FilterTabs as
|
|
12
|
-
import { ErrorView as
|
|
13
|
-
import { describeError as
|
|
14
|
-
import { Pagination as
|
|
15
|
-
import { useEffect as
|
|
16
|
-
import { ChevronRight as
|
|
17
|
-
import { Fragment as
|
|
18
|
-
import { Button as
|
|
12
|
+
import { FilterTabs as p } from "../../components/FilterTabs.js";
|
|
13
|
+
import { ErrorView as m } from "../../components/StateViews.js";
|
|
14
|
+
import { describeError as h, notify as g } from "../../lib/toast.js";
|
|
15
|
+
import { Pagination as _ } from "../../components/Pagination.js";
|
|
16
|
+
import { useEffect as v, useState as y } from "react";
|
|
17
|
+
import { BadgeCheck as b, Camera as x, ChevronRight as S, CircleHelp as C, GraduationCap as w, HandHeart as T, HeartPulse as E, Loader2 as ee, MapPin as D, Megaphone as O, Plus as k, Receipt as A, ScrollText as j, Wrench as M, X as te } from "lucide-react";
|
|
18
|
+
import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
19
|
+
import { Button as I, GlassCard as L, Input as R, Label as z, ResponsiveDialog as ne, ResponsiveDialogContent as re, ResponsiveDialogDescription as B, ResponsiveDialogFooter as V, ResponsiveDialogHeader as ie, ResponsiveDialogTitle as ae, Select as H, SelectContent as U, SelectItem as W, SelectTrigger as G, SelectValue as K, Skeleton as q, Textarea as oe } from "@burdenoff/fe-libs/ui";
|
|
19
20
|
//#region src/govcitizenhub/pages/grievances/GrievancesPage.tsx
|
|
20
|
-
var
|
|
21
|
+
var J = 15, Y = 5, X = 1e3, Z = [
|
|
21
22
|
{
|
|
22
23
|
value: "ALL",
|
|
23
24
|
label: "All"
|
|
@@ -42,7 +43,7 @@ var U = 15, W = [
|
|
|
42
43
|
value: "CLOSED",
|
|
43
44
|
label: "Closed"
|
|
44
45
|
}
|
|
45
|
-
],
|
|
46
|
+
], se = [
|
|
46
47
|
"GRIEVANCES",
|
|
47
48
|
"HEALTH",
|
|
48
49
|
"UTILITIES",
|
|
@@ -52,275 +53,365 @@ var U = 15, W = [
|
|
|
52
53
|
"LICENCES_AND_PERMITS",
|
|
53
54
|
"TAXES_AND_PAYMENTS",
|
|
54
55
|
"OTHER"
|
|
55
|
-
],
|
|
56
|
+
], ce = [
|
|
56
57
|
"LOW",
|
|
57
58
|
"NORMAL",
|
|
58
59
|
"HIGH",
|
|
59
60
|
"URGENT"
|
|
60
|
-
]
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
], Q = {
|
|
62
|
+
CERTIFICATES: j,
|
|
63
|
+
EDUCATION: w,
|
|
64
|
+
GRIEVANCES: O,
|
|
65
|
+
HEALTH: E,
|
|
66
|
+
LICENCES_AND_PERMITS: b,
|
|
67
|
+
OTHER: C,
|
|
68
|
+
SOCIAL_WELFARE: T,
|
|
69
|
+
TAXES_AND_PAYMENTS: A,
|
|
70
|
+
UTILITIES: M
|
|
71
|
+
};
|
|
72
|
+
function $() {
|
|
73
|
+
let { navigateTo: t } = e(), s = u(), [l, d] = y("ALL"), [f, h] = y(!1), { data: g, isLoading: v, isError: b, refetch: w } = c({
|
|
74
|
+
status: l === "ALL" ? void 0 : l,
|
|
64
75
|
pagination: {
|
|
65
|
-
limit:
|
|
66
|
-
cursor:
|
|
76
|
+
limit: J,
|
|
77
|
+
cursor: s.cursor
|
|
67
78
|
}
|
|
68
|
-
}),
|
|
69
|
-
return /* @__PURE__ */
|
|
79
|
+
}), T = g?.items ?? [];
|
|
80
|
+
return /* @__PURE__ */ F(n, {
|
|
70
81
|
title: "Grievances",
|
|
71
82
|
titleGradient: !0,
|
|
72
83
|
description: "Civic complaints reported by citizens, triaged through to resolution.",
|
|
73
|
-
actions: /* @__PURE__ */
|
|
84
|
+
actions: /* @__PURE__ */ F(I, {
|
|
74
85
|
onClick: () => h(!0),
|
|
75
|
-
children: [/* @__PURE__ */
|
|
86
|
+
children: [/* @__PURE__ */ P(k, { className: "mr-1.5 h-4 w-4" }), " Report grievance"]
|
|
76
87
|
}),
|
|
77
88
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ P("div", {
|
|
79
90
|
className: "mb-5",
|
|
80
|
-
children: /* @__PURE__ */
|
|
81
|
-
options:
|
|
82
|
-
value:
|
|
91
|
+
children: /* @__PURE__ */ P(p, {
|
|
92
|
+
options: Z,
|
|
93
|
+
value: l,
|
|
83
94
|
onChange: (e) => {
|
|
84
|
-
d(e),
|
|
95
|
+
d(e), s.reset();
|
|
85
96
|
}
|
|
86
97
|
})
|
|
87
98
|
}),
|
|
88
|
-
|
|
99
|
+
v ? /* @__PURE__ */ P("div", {
|
|
89
100
|
className: "space-y-3",
|
|
90
|
-
children: Array.from({ length: 6 }, (e, t) => /* @__PURE__ */
|
|
91
|
-
}) :
|
|
101
|
+
children: Array.from({ length: 6 }, (e, t) => /* @__PURE__ */ P(q, { className: "h-[72px] w-full rounded-card" }, t))
|
|
102
|
+
}) : b ? /* @__PURE__ */ P(m, {
|
|
92
103
|
message: "We couldn't load grievances.",
|
|
93
|
-
onRetry: () =>
|
|
94
|
-
}) :
|
|
104
|
+
onRetry: () => w()
|
|
105
|
+
}) : T.length === 0 && s.page === 0 ? /* @__PURE__ */ P(o, {
|
|
95
106
|
illustration: "empty-data",
|
|
96
107
|
title: "No grievances found",
|
|
97
|
-
description:
|
|
98
|
-
action: /* @__PURE__ */
|
|
108
|
+
description: l === "ALL" ? "Report the first civic grievance." : "No grievances match this status.",
|
|
109
|
+
action: /* @__PURE__ */ F(I, {
|
|
99
110
|
onClick: () => h(!0),
|
|
100
|
-
children: [/* @__PURE__ */
|
|
111
|
+
children: [/* @__PURE__ */ P(k, { className: "mr-1.5 h-4 w-4" }), " Report grievance"]
|
|
101
112
|
})
|
|
102
|
-
}) : /* @__PURE__ */
|
|
113
|
+
}) : /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(L, {
|
|
103
114
|
treatment: "plain",
|
|
104
115
|
className: "divide-y divide-border-subtle border-border-seam p-0",
|
|
105
|
-
children:
|
|
116
|
+
children: T.map((e) => /* @__PURE__ */ F("button", {
|
|
106
117
|
type: "button",
|
|
107
|
-
onClick: () =>
|
|
108
|
-
className: "group flex w-full items-center gap-
|
|
118
|
+
onClick: () => t(`grievances/${e.id}`),
|
|
119
|
+
className: "group flex w-full items-center gap-3 px-4 py-4 text-left outline-none transition-colors hover:bg-bg-sunken focus-visible:bg-bg-sunken sm:px-5",
|
|
109
120
|
children: [
|
|
110
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ P("span", {
|
|
122
|
+
className: "inline-flex size-10 shrink-0 items-center justify-center rounded-xl bg-bg-sunken text-text-secondary group-hover:bg-bg-surface",
|
|
123
|
+
children: /* @__PURE__ */ P(Q[e.category] ?? C, { className: "size-5" })
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ F("div", {
|
|
111
126
|
className: "min-w-0 flex-1",
|
|
112
|
-
children: [/* @__PURE__ */
|
|
113
|
-
className: "flex items-center gap-2",
|
|
114
|
-
children: [/* @__PURE__ */
|
|
127
|
+
children: [/* @__PURE__ */ F("div", {
|
|
128
|
+
className: "flex flex-wrap items-center gap-x-2 gap-y-1",
|
|
129
|
+
children: [/* @__PURE__ */ P("span", {
|
|
115
130
|
className: "truncate font-medium text-text-primary",
|
|
116
131
|
children: e.title
|
|
117
|
-
}), /* @__PURE__ */
|
|
118
|
-
}), /* @__PURE__ */
|
|
132
|
+
}), /* @__PURE__ */ P(a, { status: e.priority })]
|
|
133
|
+
}), /* @__PURE__ */ F("p", {
|
|
119
134
|
className: "mt-0.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-text-muted",
|
|
120
135
|
children: [
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
e.location && /* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ P("span", { children: r(e.category) }),
|
|
137
|
+
e.location && /* @__PURE__ */ F("span", {
|
|
123
138
|
className: "flex items-center gap-1",
|
|
124
139
|
children: [
|
|
125
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ P(D, { className: "size-3" }),
|
|
126
141
|
" ",
|
|
127
142
|
e.location
|
|
128
143
|
]
|
|
129
144
|
}),
|
|
130
|
-
/* @__PURE__ */
|
|
145
|
+
e.photoFileIds.length > 0 && /* @__PURE__ */ F("span", {
|
|
146
|
+
className: "flex items-center gap-1",
|
|
147
|
+
children: [
|
|
148
|
+
/* @__PURE__ */ P(x, { className: "size-3" }),
|
|
149
|
+
" ",
|
|
150
|
+
e.photoFileIds.length
|
|
151
|
+
]
|
|
152
|
+
}),
|
|
153
|
+
/* @__PURE__ */ F("span", { children: ["Reported ", i(e.createdAt)] })
|
|
131
154
|
]
|
|
132
155
|
})]
|
|
133
156
|
}),
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
|
|
157
|
+
/* @__PURE__ */ P(a, {
|
|
158
|
+
status: e.status,
|
|
159
|
+
className: "hidden sm:inline-flex"
|
|
160
|
+
}),
|
|
161
|
+
/* @__PURE__ */ P(S, { className: "size-4 shrink-0 text-text-muted transition-transform group-hover:translate-x-0.5" })
|
|
136
162
|
]
|
|
137
163
|
}, e.id))
|
|
138
|
-
}), /* @__PURE__ */
|
|
139
|
-
page:
|
|
140
|
-
pageSize:
|
|
141
|
-
itemCount:
|
|
142
|
-
hasMore:
|
|
143
|
-
onPageChange: (e) =>
|
|
164
|
+
}), /* @__PURE__ */ P(_, {
|
|
165
|
+
page: s.page,
|
|
166
|
+
pageSize: J,
|
|
167
|
+
itemCount: T.length,
|
|
168
|
+
hasMore: g?.pageInfo.hasMore ?? !1,
|
|
169
|
+
onPageChange: (e) => s.onPageChange(e, g?.pageInfo.cursor)
|
|
144
170
|
})] }),
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
open:
|
|
171
|
+
/* @__PURE__ */ P(le, {
|
|
172
|
+
open: f,
|
|
147
173
|
onOpenChange: h,
|
|
148
|
-
onReported: (e) =>
|
|
174
|
+
onReported: (e) => t(`grievances/${e}`)
|
|
149
175
|
})
|
|
150
176
|
]
|
|
151
177
|
});
|
|
152
178
|
}
|
|
153
|
-
function
|
|
154
|
-
let
|
|
155
|
-
|
|
156
|
-
e && (
|
|
179
|
+
function le({ open: e, onOpenChange: n, onReported: i }) {
|
|
180
|
+
let a = l(), { data: o } = s({ isActive: !0 }), [c, u] = y(""), [p, m] = y(""), [_, b] = y("GRIEVANCES"), [S, C] = y("NORMAL"), [w, T] = y(""), [E, O] = y(""), [A, j] = y([]), [M, N] = y(!1), [L, q] = y(null);
|
|
181
|
+
v(() => {
|
|
182
|
+
e && (u(""), m(""), b("GRIEVANCES"), C("NORMAL"), T(""), O(""), j([]), q(null));
|
|
157
183
|
}, [e]);
|
|
158
|
-
let
|
|
184
|
+
let J = async (e) => {
|
|
159
185
|
let t = e.target.files?.[0];
|
|
160
|
-
if (e.target.value = "", t) {
|
|
161
|
-
|
|
186
|
+
if (e.target.value = "", !(!t || A.length >= Y)) {
|
|
187
|
+
N(!0);
|
|
162
188
|
try {
|
|
163
|
-
let e = await
|
|
164
|
-
|
|
189
|
+
let e = await f(t, d.grievances);
|
|
190
|
+
j((t) => [...t, e]), g.success("Photo attached", e.name);
|
|
165
191
|
} catch (e) {
|
|
166
|
-
|
|
192
|
+
g.error("Could not attach photo", h(e));
|
|
167
193
|
} finally {
|
|
168
|
-
|
|
194
|
+
N(!1);
|
|
169
195
|
}
|
|
170
196
|
}
|
|
171
|
-
},
|
|
172
|
-
if (!
|
|
173
|
-
|
|
197
|
+
}, Z = (e) => j((t) => t.filter((t) => t.id !== e)), Q = async () => {
|
|
198
|
+
if (!c.trim()) {
|
|
199
|
+
q("A title is required.");
|
|
174
200
|
return;
|
|
175
201
|
}
|
|
176
|
-
if (!
|
|
177
|
-
|
|
202
|
+
if (!p.trim()) {
|
|
203
|
+
q("Please describe the grievance.");
|
|
178
204
|
return;
|
|
179
205
|
}
|
|
180
206
|
try {
|
|
181
|
-
let e = await
|
|
182
|
-
title:
|
|
183
|
-
description:
|
|
184
|
-
category:
|
|
207
|
+
let e = await a.mutateAsync({
|
|
208
|
+
title: c.trim(),
|
|
209
|
+
description: p.trim(),
|
|
210
|
+
category: _,
|
|
185
211
|
priority: S,
|
|
186
212
|
location: w.trim() || null,
|
|
187
|
-
agencyId:
|
|
188
|
-
photoFileIds:
|
|
213
|
+
agencyId: E || null,
|
|
214
|
+
photoFileIds: A.length ? A.map((e) => e.id) : null
|
|
189
215
|
});
|
|
190
|
-
|
|
216
|
+
g.success("Grievance reported", e.title), i(e.id), n(!1);
|
|
191
217
|
} catch (e) {
|
|
192
|
-
|
|
218
|
+
q(h(e));
|
|
193
219
|
}
|
|
194
|
-
}, $ =
|
|
195
|
-
return /* @__PURE__ */
|
|
220
|
+
}, $ = a.isPending;
|
|
221
|
+
return /* @__PURE__ */ P(ne, {
|
|
196
222
|
open: e,
|
|
197
|
-
onOpenChange: (e) => $ ? void 0 :
|
|
198
|
-
children: /* @__PURE__ */
|
|
199
|
-
className: "max-h-[
|
|
223
|
+
onOpenChange: (e) => $ ? void 0 : n(e),
|
|
224
|
+
children: /* @__PURE__ */ F(re, {
|
|
225
|
+
className: "max-h-[92vh] overflow-y-auto sm:max-w-2xl",
|
|
200
226
|
children: [
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ F(ie, { children: [/* @__PURE__ */ P(ae, { children: "Report a grievance" }), /* @__PURE__ */ P(B, { children: "Tell us what went wrong. We will route it to the right agency and track it to resolution." })] }),
|
|
228
|
+
/* @__PURE__ */ F("div", {
|
|
203
229
|
className: "flex flex-col gap-4 py-2",
|
|
204
230
|
children: [
|
|
205
|
-
/* @__PURE__ */
|
|
206
|
-
className: "grid gap-1.5",
|
|
207
|
-
children: [/* @__PURE__ */ T(A, {
|
|
208
|
-
htmlFor: "g-title",
|
|
209
|
-
children: "Title"
|
|
210
|
-
}), /* @__PURE__ */ T(k, {
|
|
211
|
-
id: "g-title",
|
|
212
|
-
value: s,
|
|
213
|
-
onChange: (e) => l(e.target.value),
|
|
214
|
-
placeholder: "e.g. Broken street light on Main Road"
|
|
215
|
-
})]
|
|
216
|
-
}),
|
|
217
|
-
/* @__PURE__ */ E("div", {
|
|
218
|
-
className: "grid gap-1.5",
|
|
219
|
-
children: [/* @__PURE__ */ T(A, {
|
|
220
|
-
htmlFor: "g-desc",
|
|
221
|
-
children: "Description"
|
|
222
|
-
}), /* @__PURE__ */ T(H, {
|
|
223
|
-
id: "g-desc",
|
|
224
|
-
value: f,
|
|
225
|
-
onChange: (e) => p(e.target.value),
|
|
226
|
-
placeholder: "Describe the issue, when it started, and any impact.",
|
|
227
|
-
rows: 4
|
|
228
|
-
})]
|
|
229
|
-
}),
|
|
230
|
-
/* @__PURE__ */ E("div", {
|
|
231
|
+
/* @__PURE__ */ F("div", {
|
|
231
232
|
className: "grid gap-4 sm:grid-cols-2",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
233
|
+
children: [/* @__PURE__ */ F("div", {
|
|
233
234
|
className: "grid gap-1.5",
|
|
234
|
-
children: [/* @__PURE__ */
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
235
|
+
children: [/* @__PURE__ */ F(z, {
|
|
236
|
+
htmlFor: "g-title",
|
|
237
|
+
children: ["Title ", /* @__PURE__ */ P("span", {
|
|
238
|
+
className: "text-status-error-text",
|
|
239
|
+
children: "*"
|
|
240
|
+
})]
|
|
241
|
+
}), /* @__PURE__ */ P(R, {
|
|
242
|
+
id: "g-title",
|
|
243
|
+
value: c,
|
|
244
|
+
onChange: (e) => u(e.target.value),
|
|
245
|
+
placeholder: "e.g. Broken street light on Main Road"
|
|
244
246
|
})]
|
|
245
|
-
}), /* @__PURE__ */
|
|
247
|
+
}), /* @__PURE__ */ F("div", {
|
|
246
248
|
className: "grid gap-1.5",
|
|
247
|
-
children: [/* @__PURE__ */
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
249
|
+
children: [/* @__PURE__ */ F(z, { children: ["Category ", /* @__PURE__ */ P("span", {
|
|
250
|
+
className: "text-status-error-text",
|
|
251
|
+
children: "*"
|
|
252
|
+
})] }), /* @__PURE__ */ F(H, {
|
|
253
|
+
value: _,
|
|
254
|
+
onValueChange: (e) => b(e),
|
|
255
|
+
children: [/* @__PURE__ */ P(G, {
|
|
256
|
+
"aria-label": "Category",
|
|
257
|
+
children: /* @__PURE__ */ P(K, {})
|
|
258
|
+
}), /* @__PURE__ */ P(U, { children: se.map((e) => /* @__PURE__ */ P(W, {
|
|
254
259
|
value: e,
|
|
255
|
-
children:
|
|
260
|
+
children: r(e)
|
|
256
261
|
}, e)) })]
|
|
257
262
|
})]
|
|
258
263
|
})]
|
|
259
264
|
}),
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
-
className: "grid gap-
|
|
262
|
-
children: [/* @__PURE__ */
|
|
263
|
-
|
|
264
|
-
children:
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
265
|
+
/* @__PURE__ */ F("div", {
|
|
266
|
+
className: "grid gap-4 sm:grid-cols-2",
|
|
267
|
+
children: [/* @__PURE__ */ F("div", {
|
|
268
|
+
className: "grid gap-1.5",
|
|
269
|
+
children: [
|
|
270
|
+
/* @__PURE__ */ F(z, {
|
|
271
|
+
htmlFor: "g-desc",
|
|
272
|
+
children: ["Description ", /* @__PURE__ */ P("span", {
|
|
273
|
+
className: "text-status-error-text",
|
|
274
|
+
children: "*"
|
|
275
|
+
})]
|
|
276
|
+
}),
|
|
277
|
+
/* @__PURE__ */ P(oe, {
|
|
278
|
+
id: "g-desc",
|
|
279
|
+
value: p,
|
|
280
|
+
onChange: (e) => m(e.target.value.slice(0, X)),
|
|
281
|
+
placeholder: "Provide details about the issue. Include when it happened, how often, and any other relevant information.",
|
|
282
|
+
rows: 5
|
|
283
|
+
}),
|
|
284
|
+
/* @__PURE__ */ F("p", {
|
|
285
|
+
className: "text-right text-xs text-text-muted tabular-nums",
|
|
286
|
+
children: [
|
|
287
|
+
p.length,
|
|
288
|
+
" / ",
|
|
289
|
+
X
|
|
290
|
+
]
|
|
291
|
+
})
|
|
292
|
+
]
|
|
293
|
+
}), /* @__PURE__ */ F("div", {
|
|
294
|
+
className: "flex flex-col gap-4",
|
|
295
|
+
children: [/* @__PURE__ */ F("div", {
|
|
296
|
+
className: "grid gap-1.5",
|
|
297
|
+
children: [/* @__PURE__ */ F(z, { children: ["Priority ", /* @__PURE__ */ P("span", {
|
|
298
|
+
className: "text-status-error-text",
|
|
299
|
+
children: "*"
|
|
300
|
+
})] }), /* @__PURE__ */ F(H, {
|
|
301
|
+
value: S,
|
|
302
|
+
onValueChange: (e) => C(e),
|
|
303
|
+
children: [/* @__PURE__ */ P(G, {
|
|
304
|
+
"aria-label": "Priority",
|
|
305
|
+
children: /* @__PURE__ */ P(K, {})
|
|
306
|
+
}), /* @__PURE__ */ P(U, { children: ce.map((e) => /* @__PURE__ */ P(W, {
|
|
307
|
+
value: e,
|
|
308
|
+
children: r(e)
|
|
309
|
+
}, e)) })]
|
|
310
|
+
})]
|
|
311
|
+
}), /* @__PURE__ */ F("div", {
|
|
312
|
+
className: "grid gap-1.5",
|
|
313
|
+
children: [/* @__PURE__ */ P(z, {
|
|
314
|
+
htmlFor: "g-loc",
|
|
315
|
+
children: "Location"
|
|
316
|
+
}), /* @__PURE__ */ F("div", {
|
|
317
|
+
className: "relative",
|
|
318
|
+
children: [/* @__PURE__ */ P(D, { className: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-text-muted" }), /* @__PURE__ */ P(R, {
|
|
319
|
+
id: "g-loc",
|
|
320
|
+
value: w,
|
|
321
|
+
onChange: (e) => T(e.target.value),
|
|
322
|
+
placeholder: "Street, area, landmark",
|
|
323
|
+
className: "pl-9"
|
|
324
|
+
})]
|
|
325
|
+
})]
|
|
326
|
+
})]
|
|
270
327
|
})]
|
|
271
328
|
}),
|
|
272
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ F("div", {
|
|
273
330
|
className: "grid gap-1.5",
|
|
274
|
-
children: [/* @__PURE__ */
|
|
275
|
-
value:
|
|
276
|
-
onValueChange:
|
|
277
|
-
children: [/* @__PURE__ */
|
|
331
|
+
children: [/* @__PURE__ */ P(z, { children: "Route to agency" }), /* @__PURE__ */ F(H, {
|
|
332
|
+
value: E,
|
|
333
|
+
onValueChange: O,
|
|
334
|
+
children: [/* @__PURE__ */ P(G, {
|
|
278
335
|
"aria-label": "Agency",
|
|
279
|
-
children: /* @__PURE__ */
|
|
280
|
-
}), /* @__PURE__ */
|
|
336
|
+
children: /* @__PURE__ */ P(K, { placeholder: "Auto-route to the right agency" })
|
|
337
|
+
}), /* @__PURE__ */ P(U, { children: (o ?? []).map((e) => /* @__PURE__ */ P(W, {
|
|
281
338
|
value: e.id,
|
|
282
339
|
children: e.name
|
|
283
340
|
}, e.id)) })]
|
|
284
341
|
})]
|
|
285
342
|
}),
|
|
286
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ F("div", {
|
|
287
344
|
className: "grid gap-1.5",
|
|
288
|
-
children: [
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
345
|
+
children: [
|
|
346
|
+
/* @__PURE__ */ P(z, { children: "Photos" }),
|
|
347
|
+
/* @__PURE__ */ F("div", {
|
|
348
|
+
className: "flex flex-wrap gap-3",
|
|
349
|
+
children: [A.map((e) => /* @__PURE__ */ F("div", {
|
|
350
|
+
className: "group relative size-24 overflow-hidden rounded-xl border border-border-seam bg-bg-sunken",
|
|
351
|
+
children: [e.url ? /* @__PURE__ */ P("img", {
|
|
352
|
+
src: e.url,
|
|
353
|
+
alt: e.name,
|
|
354
|
+
className: "size-full object-cover",
|
|
355
|
+
loading: "lazy"
|
|
356
|
+
}) : /* @__PURE__ */ P("span", {
|
|
357
|
+
className: "flex size-full items-center justify-center",
|
|
358
|
+
children: /* @__PURE__ */ P(x, { className: "size-6 text-text-muted" })
|
|
359
|
+
}), /* @__PURE__ */ P("button", {
|
|
360
|
+
type: "button",
|
|
361
|
+
onClick: () => Z(e.id),
|
|
362
|
+
"aria-label": `Remove ${e.name}`,
|
|
363
|
+
className: "absolute right-1 top-1 inline-flex size-6 items-center justify-center rounded-full bg-bg-canvas/80 text-text-primary backdrop-blur transition-colors hover:bg-bg-canvas focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
364
|
+
children: /* @__PURE__ */ P(te, { className: "size-3.5" })
|
|
365
|
+
})]
|
|
366
|
+
}, e.id)), A.length < Y && /* @__PURE__ */ F("label", {
|
|
367
|
+
className: t("flex size-24 cursor-pointer flex-col items-center justify-center gap-1 rounded-xl border-2 border-dashed border-border-default text-text-secondary transition-colors hover:border-action-primary-bg hover:bg-[var(--color-accent-soft)]", M && "pointer-events-none opacity-60"),
|
|
368
|
+
children: [
|
|
369
|
+
M ? /* @__PURE__ */ P(ee, { className: "size-5 animate-spin" }) : /* @__PURE__ */ P(x, { className: "size-5" }),
|
|
370
|
+
/* @__PURE__ */ P("span", {
|
|
371
|
+
className: "text-xs font-medium",
|
|
372
|
+
children: M ? "Uploading…" : "Add photo"
|
|
373
|
+
}),
|
|
374
|
+
/* @__PURE__ */ P("input", {
|
|
375
|
+
type: "file",
|
|
376
|
+
accept: "image/*",
|
|
377
|
+
className: "sr-only",
|
|
378
|
+
onChange: (e) => void J(e),
|
|
379
|
+
disabled: M
|
|
380
|
+
})
|
|
381
|
+
]
|
|
382
|
+
})]
|
|
383
|
+
}),
|
|
384
|
+
/* @__PURE__ */ F("p", {
|
|
385
|
+
className: "text-xs text-text-muted",
|
|
386
|
+
children: [
|
|
387
|
+
"JPG or PNG. You can attach up to ",
|
|
388
|
+
Y,
|
|
389
|
+
" photos."
|
|
390
|
+
]
|
|
391
|
+
})
|
|
392
|
+
]
|
|
302
393
|
}),
|
|
303
|
-
|
|
394
|
+
L && /* @__PURE__ */ P("p", {
|
|
304
395
|
className: "text-sm text-status-error-text",
|
|
305
|
-
children:
|
|
396
|
+
children: L
|
|
306
397
|
})
|
|
307
398
|
]
|
|
308
399
|
}),
|
|
309
|
-
/* @__PURE__ */
|
|
400
|
+
/* @__PURE__ */ F(V, { children: [/* @__PURE__ */ P(I, {
|
|
310
401
|
variant: "outline",
|
|
311
|
-
onClick: () =>
|
|
402
|
+
onClick: () => n(!1),
|
|
312
403
|
disabled: $,
|
|
313
404
|
children: "Cancel"
|
|
314
|
-
}), /* @__PURE__ */
|
|
315
|
-
onClick:
|
|
316
|
-
disabled: $ ||
|
|
317
|
-
children: "
|
|
405
|
+
}), /* @__PURE__ */ F(I, {
|
|
406
|
+
onClick: Q,
|
|
407
|
+
disabled: $ || M,
|
|
408
|
+
children: [/* @__PURE__ */ P(k, { className: "mr-1.5 h-4 w-4" }), " Submit grievance"]
|
|
318
409
|
})] })
|
|
319
410
|
]
|
|
320
411
|
})
|
|
321
412
|
});
|
|
322
413
|
}
|
|
323
414
|
//#endregion
|
|
324
|
-
export {
|
|
415
|
+
export { Q as CATEGORY_ICON, $ as GrievancesPage };
|
|
325
416
|
|
|
326
417
|
//# sourceMappingURL=GrievancesPage.js.map
|