@burdenoff/microfe-govcitizenhub 2026.720.1 → 2026.720.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.
@@ -6,14 +6,14 @@ import { formatCurrency as s, formatEnumLabel as c, formatNumber as l, formatRel
6
6
  import { StatusBadge as d } from "../components/StatusBadge.js";
7
7
  import { EmptyState as f } from "../components/EmptyState.js";
8
8
  import "../context/index.js";
9
- import { useGovApplications as p, useGovDashboardSummary as m } from "../hooks/useGovApi.js";
9
+ import { useGovApplications as p, useGovApplicationsByService as m, useGovDashboardSummary as h } from "../hooks/useGovApi.js";
10
10
  import "../hooks/index.js";
11
- import { useMemo as h, useState as g } from "react";
12
- import { BadgeCheck as _, Briefcase as v, Building2 as y, ChevronRight as b, CreditCard as x, FileText as S, MessageSquareWarning as C } from "lucide-react";
13
- import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
14
- import { GlassCard as D, Skeleton as O } from "@burdenoff/fe-libs/ui";
11
+ import { useMemo as g, useState as _ } from "react";
12
+ import { BadgeCheck as v, Briefcase as y, Building2 as b, ChevronRight as x, CreditCard as S, FileText as C, MessageSquareWarning as w } from "lucide-react";
13
+ import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
14
+ import { GlassCard as O, Skeleton as k } from "@burdenoff/fe-libs/ui";
15
15
  //#region src/govcitizenhub/pages/DashboardPage.tsx
16
- var k = 1440 * 60 * 1e3, A = 30, j = "INR", M = 100, N = [
16
+ var A = 1440 * 60 * 1e3, j = 30, M = "INR", N = 100, P = 5, F = [
17
17
  "DRAFT",
18
18
  "SUBMITTED",
19
19
  "IN_REVIEW",
@@ -22,142 +22,159 @@ var k = 1440 * 60 * 1e3, A = 30, j = "INR", M = 100, N = [
22
22
  "REJECTED",
23
23
  "WITHDRAWN"
24
24
  ];
25
- function P(e, t) {
25
+ function I(e, t) {
26
+ if (e.direction === "FLAT") return;
27
+ let n = e.direction === "UP";
28
+ return {
29
+ value: e.changePercent == null ? `${e.current} new` : `${Math.abs(e.changePercent).toFixed(1)}%`,
30
+ direction: n ? "up" : "down",
31
+ positive: n === t,
32
+ caption: "vs last 30 days"
33
+ };
34
+ }
35
+ function L(e, t) {
26
36
  let n = new Date(t), r = new Date(n.getFullYear(), n.getMonth(), n.getDate());
27
- r.setTime(r.getTime() - (A - 1) * k);
28
- let i = Array(A).fill(0), a = 0;
37
+ r.setTime(r.getTime() - (j - 1) * A);
38
+ let i = Array(j).fill(0), a = 0;
29
39
  for (let t of e) {
30
40
  let e = new Date(t);
31
41
  if (Number.isNaN(e.getTime())) continue;
32
- let n = Math.floor((e.getTime() - r.getTime()) / k);
33
- n < 0 ? a += 1 : n < A && (i[n] += 1);
42
+ let n = Math.floor((e.getTime() - r.getTime()) / A);
43
+ n < 0 ? a += 1 : n < j && (i[n] += 1);
34
44
  }
35
45
  let o = a;
36
46
  return i.map((e, t) => (o += e, {
37
- label: new Date(r.getTime() + t * k).toLocaleDateString(void 0, {
47
+ label: new Date(r.getTime() + t * A).toLocaleDateString(void 0, {
38
48
  month: "short",
39
49
  day: "numeric"
40
50
  }),
41
51
  value: o
42
52
  }));
43
53
  }
44
- function F() {
45
- let { navigateTo: k } = e(), [A] = g(() => Date.now()), F = m(), I = p({ pagination: { limit: M } }), L = h(() => I.data?.items ?? [], [I.data]), R = h(() => P(L.map((e) => e.createdAt), A), [L, A]), z = h(() => (F.data?.applicationsByStatus ?? []).map((e) => {
46
- let t = N.indexOf(e.status), n = t >= 0 ? t : 0;
54
+ function R() {
55
+ let { navigateTo: A } = e(), [j] = _(() => Date.now()), R = h(), z = p({ pagination: { limit: N } }), B = m(), V = g(() => z.data?.items ?? [], [z.data]), H = g(() => L(V.map((e) => e.createdAt), j), [V, j]), U = g(() => (R.data?.applicationsByStatus ?? []).map((e) => {
56
+ let t = F.indexOf(e.status), n = t >= 0 ? t : 0;
47
57
  return {
48
58
  name: c(e.status),
49
59
  value: e.count,
50
60
  color: r[n % r.length]
51
61
  };
52
- }).filter((e) => e.value > 0), [F.data]), B = h(() => z.reduce((e, t) => e + t.value, 0), [z]), V = h(() => [...L].sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime()).slice(0, 6), [L]), H = F.isLoading, U = I.isLoading, W = F.data?.applicationsTotal ?? 0, G = F.data?.pendingPaymentsAmount ?? 0;
53
- return /* @__PURE__ */ E(t, {
62
+ }).filter((e) => e.value > 0), [R.data]), W = g(() => U.reduce((e, t) => e + t.value, 0), [U]), G = g(() => [...V].sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime()).slice(0, 6), [V]), K = g(() => (B.data ?? []).slice(0, P), [B.data]), q = g(() => K.reduce((e, t) => Math.max(e, t.count), 0), [K]), J = R.isLoading, Y = z.isLoading, X = R.data?.applicationsTotal ?? 0, Z = R.data?.pendingPaymentsAmount ?? 0;
63
+ return /* @__PURE__ */ D(t, {
54
64
  title: "GovCitizenHub",
55
65
  titleGradient: !0,
56
66
  aurora: !0,
57
67
  description: "Your live government service-delivery operations, at a glance.",
58
68
  children: [
59
- /* @__PURE__ */ T("div", {
69
+ /* @__PURE__ */ E("div", {
60
70
  className: "grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-6",
61
71
  children: [
62
72
  {
63
73
  label: "Applications",
64
- value: l(W),
74
+ value: l(X),
65
75
  sublabel: "filed to date",
66
- icon: /* @__PURE__ */ T(S, { className: "h-5 w-5" }),
76
+ delta: R.data ? I(R.data.applicationsTotalTrend, !0) : void 0,
77
+ icon: /* @__PURE__ */ E(C, { className: "h-5 w-5" }),
67
78
  path: "applications",
68
79
  featured: !0
69
80
  },
70
81
  {
71
82
  label: "Pending payments",
72
- value: l(F.data?.pendingPayments ?? 0),
73
- sublabel: G > 0 ? `${s(G, j)} due` : "all settled",
74
- icon: /* @__PURE__ */ T(x, { className: "h-5 w-5" }),
83
+ value: l(R.data?.pendingPayments ?? 0),
84
+ sublabel: Z > 0 ? `${s(Z, M)} due` : "all settled",
85
+ delta: R.data ? I(R.data.pendingPaymentsTrend, !1) : void 0,
86
+ icon: /* @__PURE__ */ E(S, { className: "h-5 w-5" }),
75
87
  path: "payments",
76
88
  accent: "warning"
77
89
  },
78
90
  {
79
91
  label: "Open grievances",
80
- value: l(F.data?.openGrievances ?? 0),
92
+ value: l(R.data?.openGrievances ?? 0),
81
93
  sublabel: "awaiting acknowledgement",
82
- icon: /* @__PURE__ */ T(C, { className: "h-5 w-5" }),
94
+ delta: R.data ? I(R.data.openGrievancesTrend, !1) : void 0,
95
+ icon: /* @__PURE__ */ E(w, { className: "h-5 w-5" }),
83
96
  path: "grievances",
84
97
  accent: "error"
85
98
  },
86
99
  {
87
100
  label: "Active permits",
88
- value: l(F.data?.activePermits ?? 0),
101
+ value: l(R.data?.activePermits ?? 0),
89
102
  sublabel: "currently valid",
90
- icon: /* @__PURE__ */ T(_, { className: "h-5 w-5" }),
103
+ delta: R.data ? I(R.data.activePermitsTrend, !0) : void 0,
104
+ icon: /* @__PURE__ */ E(v, { className: "h-5 w-5" }),
91
105
  path: "permits",
92
106
  accent: "success"
93
107
  },
94
108
  {
95
109
  label: "Published services",
96
- value: l(F.data?.publishedServices ?? 0),
110
+ value: l(R.data?.publishedServices ?? 0),
97
111
  sublabel: "available to citizens",
98
- icon: /* @__PURE__ */ T(v, { className: "h-5 w-5" }),
112
+ delta: R.data ? I(R.data.publishedServicesTrend, !0) : void 0,
113
+ icon: /* @__PURE__ */ E(y, { className: "h-5 w-5" }),
99
114
  path: "services"
100
115
  },
101
116
  {
102
117
  label: "Active agencies",
103
- value: l(F.data?.activeAgencies ?? 0),
118
+ value: l(R.data?.activeAgencies ?? 0),
104
119
  sublabel: "delivering services",
105
- icon: /* @__PURE__ */ T(y, { className: "h-5 w-5" }),
120
+ delta: R.data ? I(R.data.activeAgenciesTrend, !0) : void 0,
121
+ icon: /* @__PURE__ */ E(b, { className: "h-5 w-5" }),
106
122
  path: "agencies"
107
123
  }
108
- ].map((e) => /* @__PURE__ */ T(n, {
124
+ ].map((e) => /* @__PURE__ */ E(n, {
109
125
  icon: e.icon,
110
- value: H ? "—" : e.value,
126
+ value: J ? "—" : e.value,
111
127
  label: e.label,
112
128
  sublabel: e.sublabel,
129
+ delta: J ? void 0 : e.delta,
113
130
  featured: e.featured,
114
131
  accent: e.accent,
115
- onClick: () => k(e.path)
132
+ onClick: () => A(e.path)
116
133
  }, e.label))
117
134
  }),
118
- /* @__PURE__ */ E("div", {
135
+ /* @__PURE__ */ D("div", {
119
136
  className: "mt-6 grid grid-cols-1 gap-4 lg:grid-cols-5",
120
- children: [/* @__PURE__ */ E(D, {
137
+ children: [/* @__PURE__ */ D(O, {
121
138
  treatment: "glass",
122
139
  className: "p-5 lg:col-span-3",
123
- children: [/* @__PURE__ */ E("div", {
140
+ children: [/* @__PURE__ */ D("div", {
124
141
  className: "flex items-start justify-between gap-4",
125
- children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h2", {
142
+ children: [/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("h2", {
126
143
  className: "text-lg font-semibold text-text-primary",
127
144
  children: "Applications over time"
128
- }), /* @__PURE__ */ T("p", {
145
+ }), /* @__PURE__ */ E("p", {
129
146
  className: "mt-0.5 text-xs text-text-muted",
130
147
  children: "Cumulative filings (recent sample, not a total)"
131
- })] }), /* @__PURE__ */ T("span", {
148
+ })] }), /* @__PURE__ */ E("span", {
132
149
  className: "shrink-0 rounded-full border border-border-seam bg-bg-surface px-3 py-1 text-xs font-medium text-text-secondary",
133
150
  children: "Last 30 days"
134
151
  })]
135
- }), /* @__PURE__ */ T("div", {
152
+ }), /* @__PURE__ */ E("div", {
136
153
  className: "mt-4",
137
- children: U ? /* @__PURE__ */ T(O, { className: "h-[260px] w-full rounded-card" }) : /* @__PURE__ */ T(a, {
138
- data: R,
154
+ children: Y ? /* @__PURE__ */ E(k, { className: "h-[260px] w-full rounded-card" }) : /* @__PURE__ */ E(a, {
155
+ data: H,
139
156
  emptyLabel: "No applications filed recently."
140
157
  })
141
158
  })]
142
- }), /* @__PURE__ */ E(D, {
159
+ }), /* @__PURE__ */ D(O, {
143
160
  treatment: "plain",
144
161
  className: "border-border-seam p-5 lg:col-span-2",
145
- children: [/* @__PURE__ */ T("h2", {
162
+ children: [/* @__PURE__ */ E("h2", {
146
163
  className: "text-lg font-semibold text-text-primary",
147
164
  children: "Applications by status"
148
- }), /* @__PURE__ */ T("div", {
165
+ }), /* @__PURE__ */ E("div", {
149
166
  className: "mt-3",
150
- children: H ? /* @__PURE__ */ T(O, { className: "h-[240px] w-full rounded-card" }) : z.length === 0 ? /* @__PURE__ */ T(f, {
167
+ children: J ? /* @__PURE__ */ E(k, { className: "h-[240px] w-full rounded-card" }) : U.length === 0 ? /* @__PURE__ */ E(f, {
151
168
  title: "No applications yet",
152
169
  description: "Filed applications will break down here by status."
153
- }) : /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(o, {
154
- data: z,
155
- centerValue: l(W),
170
+ }) : /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(o, {
171
+ data: U,
172
+ centerValue: l(X),
156
173
  centerLabel: "Total"
157
- }), /* @__PURE__ */ T(i, {
174
+ }), /* @__PURE__ */ E(i, {
158
175
  className: "mt-4",
159
- items: z.map((e) => {
160
- let t = B || 1, n = Math.round(e.value / t * 100);
176
+ items: U.map((e) => {
177
+ let t = W || 1, n = Math.round(e.value / t * 100);
161
178
  return {
162
179
  label: e.name,
163
180
  color: e.color,
@@ -168,103 +185,150 @@ function F() {
168
185
  })]
169
186
  })]
170
187
  }),
171
- /* @__PURE__ */ E(D, {
188
+ /* @__PURE__ */ D(O, {
189
+ treatment: "plain",
190
+ className: "mt-6 border-border-seam p-5",
191
+ children: [/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("h2", {
192
+ className: "text-lg font-semibold text-text-primary",
193
+ children: "Applications by service"
194
+ }), /* @__PURE__ */ E("p", {
195
+ className: "mt-0.5 text-xs text-text-muted",
196
+ children: "Corpus-wide volume, not limited to the recent sample above"
197
+ })] }), /* @__PURE__ */ E("div", {
198
+ className: "mt-4",
199
+ children: B.isLoading ? /* @__PURE__ */ E("div", {
200
+ className: "space-y-3",
201
+ children: Array.from({ length: 3 }, (e, t) => /* @__PURE__ */ E(k, { className: "h-8 w-full rounded-card" }, t))
202
+ }) : K.length === 0 ? /* @__PURE__ */ E(f, {
203
+ title: "No applications yet",
204
+ description: "Once citizens file applications, the busiest services will rank here."
205
+ }) : /* @__PURE__ */ E("ul", {
206
+ className: "space-y-3",
207
+ children: K.map((e) => {
208
+ let t = q > 0 ? Math.round(e.count / q * 100) : 0;
209
+ return /* @__PURE__ */ E("li", { children: /* @__PURE__ */ D("button", {
210
+ type: "button",
211
+ onClick: () => A(`services/${e.serviceId}`),
212
+ className: "flex w-full items-center gap-3 rounded-button text-left outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]",
213
+ children: [
214
+ /* @__PURE__ */ E("span", {
215
+ className: "w-40 shrink-0 truncate text-sm font-medium text-text-primary",
216
+ children: e.serviceName
217
+ }),
218
+ /* @__PURE__ */ E("span", {
219
+ className: "h-2 flex-1 overflow-hidden rounded-full bg-bg-sunken",
220
+ children: /* @__PURE__ */ E("span", {
221
+ className: "block h-full rounded-full bg-[var(--color-action-primary-bg)]",
222
+ style: { width: `${t}%` }
223
+ })
224
+ }),
225
+ /* @__PURE__ */ E("span", {
226
+ className: "w-10 shrink-0 text-right text-sm font-semibold tabular-nums text-text-primary",
227
+ children: l(e.count)
228
+ })
229
+ ]
230
+ }) }, e.serviceId);
231
+ })
232
+ })
233
+ })]
234
+ }),
235
+ /* @__PURE__ */ D(O, {
172
236
  treatment: "plain",
173
237
  className: "mt-6 border-border-seam p-5",
174
- children: [/* @__PURE__ */ E("div", {
238
+ children: [/* @__PURE__ */ D("div", {
175
239
  className: "flex items-center justify-between gap-4",
176
- children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h2", {
240
+ children: [/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("h2", {
177
241
  className: "text-lg font-semibold text-text-primary",
178
242
  children: "Recent applications"
179
- }), /* @__PURE__ */ T("p", {
243
+ }), /* @__PURE__ */ E("p", {
180
244
  className: "mt-0.5 text-xs text-text-muted",
181
245
  children: "Latest filings (recent sample)"
182
- })] }), /* @__PURE__ */ E("button", {
246
+ })] }), /* @__PURE__ */ D("button", {
183
247
  type: "button",
184
- onClick: () => k("applications"),
248
+ onClick: () => A("applications"),
185
249
  className: "inline-flex items-center gap-1 text-sm font-medium text-action-primary-text outline-none transition-opacity hover:opacity-80 focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]",
186
- children: ["View all ", /* @__PURE__ */ T(b, { className: "h-4 w-4" })]
250
+ children: ["View all ", /* @__PURE__ */ E(x, { className: "h-4 w-4" })]
187
251
  })]
188
- }), /* @__PURE__ */ T("div", {
252
+ }), /* @__PURE__ */ E("div", {
189
253
  className: "mt-3",
190
- children: U ? /* @__PURE__ */ T("div", {
254
+ children: Y ? /* @__PURE__ */ E("div", {
191
255
  className: "space-y-3",
192
- children: Array.from({ length: 4 }, (e, t) => /* @__PURE__ */ T(O, { className: "h-12 w-full rounded-card" }, t))
193
- }) : V.length === 0 ? /* @__PURE__ */ T(f, {
256
+ children: Array.from({ length: 4 }, (e, t) => /* @__PURE__ */ E(k, { className: "h-12 w-full rounded-card" }, t))
257
+ }) : G.length === 0 ? /* @__PURE__ */ E(f, {
194
258
  illustration: "empty-data",
195
259
  title: "No applications yet",
196
260
  description: "Citizen applications will appear here as they are filed."
197
- }) : /* @__PURE__ */ T("div", {
261
+ }) : /* @__PURE__ */ E("div", {
198
262
  className: "overflow-x-auto",
199
- children: /* @__PURE__ */ E("table", {
263
+ children: /* @__PURE__ */ D("table", {
200
264
  className: "w-full min-w-[34rem] border-collapse text-left",
201
- children: [/* @__PURE__ */ T("thead", { children: /* @__PURE__ */ E("tr", {
265
+ children: [/* @__PURE__ */ E("thead", { children: /* @__PURE__ */ D("tr", {
202
266
  className: "border-b border-border-seam text-xs font-medium uppercase tracking-wide text-text-muted",
203
267
  children: [
204
- /* @__PURE__ */ T("th", {
268
+ /* @__PURE__ */ E("th", {
205
269
  scope: "col",
206
270
  className: "py-2.5 pr-3 font-medium",
207
271
  children: "Reference No."
208
272
  }),
209
- /* @__PURE__ */ T("th", {
273
+ /* @__PURE__ */ E("th", {
210
274
  scope: "col",
211
275
  className: "px-3 py-2.5 font-medium",
212
276
  children: "Status"
213
277
  }),
214
- /* @__PURE__ */ T("th", {
278
+ /* @__PURE__ */ E("th", {
215
279
  scope: "col",
216
280
  className: "px-3 py-2.5 font-medium",
217
281
  children: "Priority"
218
282
  }),
219
- /* @__PURE__ */ T("th", {
283
+ /* @__PURE__ */ E("th", {
220
284
  scope: "col",
221
285
  className: "px-3 py-2.5 font-medium",
222
286
  children: "Submitted on"
223
287
  }),
224
- /* @__PURE__ */ T("th", {
288
+ /* @__PURE__ */ E("th", {
225
289
  scope: "col",
226
290
  className: "w-8",
227
291
  "aria-label": "Open"
228
292
  })
229
293
  ]
230
- }) }), /* @__PURE__ */ T("tbody", { children: V.map((e) => /* @__PURE__ */ E("tr", {
294
+ }) }), /* @__PURE__ */ E("tbody", { children: G.map((e) => /* @__PURE__ */ D("tr", {
231
295
  tabIndex: 0,
232
296
  role: "button",
233
297
  "aria-label": `Open application ${e.reference}`,
234
- onClick: () => k(`applications/${e.id}`),
298
+ onClick: () => A(`applications/${e.id}`),
235
299
  onKeyDown: (t) => {
236
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), k(`applications/${e.id}`));
300
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), A(`applications/${e.id}`));
237
301
  },
238
302
  className: "group cursor-pointer border-b border-border-subtle outline-none transition-colors last:border-0 hover:bg-bg-sunken/60 focus-visible:bg-bg-sunken/60",
239
303
  children: [
240
- /* @__PURE__ */ T("td", {
304
+ /* @__PURE__ */ E("td", {
241
305
  className: "py-3 pr-3",
242
- children: /* @__PURE__ */ E("span", {
306
+ children: /* @__PURE__ */ D("span", {
243
307
  className: "flex items-center gap-2.5",
244
- children: [/* @__PURE__ */ T("span", {
308
+ children: [/* @__PURE__ */ E("span", {
245
309
  className: "flex size-8 shrink-0 items-center justify-center rounded-button bg-[var(--color-accent-soft)] text-action-primary-text",
246
- children: /* @__PURE__ */ T(S, { className: "h-4 w-4" })
247
- }), /* @__PURE__ */ T("span", {
310
+ children: /* @__PURE__ */ E(C, { className: "h-4 w-4" })
311
+ }), /* @__PURE__ */ E("span", {
248
312
  className: "truncate text-sm font-medium text-text-primary",
249
313
  children: e.reference
250
314
  })]
251
315
  })
252
316
  }),
253
- /* @__PURE__ */ T("td", {
317
+ /* @__PURE__ */ E("td", {
254
318
  className: "px-3 py-3",
255
- children: /* @__PURE__ */ T(d, { status: e.status })
319
+ children: /* @__PURE__ */ E(d, { status: e.status })
256
320
  }),
257
- /* @__PURE__ */ T("td", {
321
+ /* @__PURE__ */ E("td", {
258
322
  className: "px-3 py-3",
259
- children: /* @__PURE__ */ T(d, { status: e.priority })
323
+ children: /* @__PURE__ */ E(d, { status: e.priority })
260
324
  }),
261
- /* @__PURE__ */ T("td", {
325
+ /* @__PURE__ */ E("td", {
262
326
  className: "px-3 py-3 text-sm text-text-secondary",
263
327
  children: u(e.submittedAt ?? e.createdAt)
264
328
  }),
265
- /* @__PURE__ */ T("td", {
329
+ /* @__PURE__ */ E("td", {
266
330
  className: "pr-1",
267
- children: /* @__PURE__ */ T(b, { className: "h-4 w-4 text-text-muted transition-transform group-hover:translate-x-0.5" })
331
+ children: /* @__PURE__ */ E(x, { className: "h-4 w-4 text-text-muted transition-transform group-hover:translate-x-0.5" })
268
332
  })
269
333
  ]
270
334
  }, e.id)) })]
@@ -276,6 +340,6 @@ function F() {
276
340
  });
277
341
  }
278
342
  //#endregion
279
- export { F as DashboardPage };
343
+ export { R as DashboardPage };
280
344
 
281
345
  //# sourceMappingURL=DashboardPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardPage.js","names":[],"sources":["../../../src/govcitizenhub/pages/DashboardPage.tsx"],"sourcesContent":["/**\n * DashboardPage — the GovCitizenHub operations control center.\n * @module govcitizenhub/pages\n *\n * The six metric tiles and the \"Applications by status\" donut read from\n * `govDashboardSummary` — svc-computed, full-corpus AUTHORITATIVE counts, never\n * a capped client-side window. The \"Recent applications\" area trend and the\n * recent-activity list are the ONLY surfaces sourced from a paged read of the\n * latest applications, and are labelled as a recent sample so they never imply\n * a total.\n */\n\nimport { useMemo, useState } from 'react';\nimport {\n FileText,\n CreditCard,\n MessageSquareWarning,\n BadgeCheck,\n Briefcase,\n Building2,\n ChevronRight,\n} from 'lucide-react';\nimport { GlassCard, Skeleton } from '@burdenoff/fe-libs/ui';\n\nimport { PageLayout } from '../components/PageLayout';\nimport { MetricsCard } from '../components/MetricsCard';\nimport {\n GovAreaChart,\n GovDonutChart,\n ChartLegend,\n CHART_SERIES_COLORS,\n type AreaPoint,\n} from '../components/GovCharts';\nimport { StatusBadge } from '../components/StatusBadge';\nimport { EmptyState } from '../components/EmptyState';\nimport { useGovApplications, useGovDashboardSummary } from '../hooks';\nimport { useGovCitizenHub } from '../context';\nimport {\n formatNumber,\n formatCurrency,\n formatRelativeTime,\n formatEnumLabel,\n} from '../utils/formatters';\nimport type { GovApplicationStatus } from '../types';\n\nconst DAY_MS = 24 * 60 * 60 * 1000;\nconst TREND_DAYS = 30;\n/** Default currency for the aggregate pending-payments amount (svc summary has no currency). */\nconst DEFAULT_CURRENCY = 'INR';\n/** Size of the recent-applications window used for the trend + activity list only. */\nconst RECENT_WINDOW = 100;\n\n// Stable donut colour order — index into CHART_SERIES_COLORS by status.\nconst APP_STATUSES: GovApplicationStatus[] = [\n 'DRAFT',\n 'SUBMITTED',\n 'IN_REVIEW',\n 'INFO_REQUESTED',\n 'APPROVED',\n 'REJECTED',\n 'WITHDRAWN',\n];\n\nfunction buildTrendSeries(dates: string[], nowMs: number): AreaPoint[] {\n const now = new Date(nowMs);\n const start = new Date(now.getFullYear(), now.getMonth(), now.getDate());\n start.setTime(start.getTime() - (TREND_DAYS - 1) * DAY_MS);\n\n const perDay = new Array<number>(TREND_DAYS).fill(0);\n let baseline = 0;\n\n for (const iso of dates) {\n const when = new Date(iso);\n if (Number.isNaN(when.getTime())) continue;\n const dayIndex = Math.floor((when.getTime() - start.getTime()) / DAY_MS);\n if (dayIndex < 0) baseline += 1;\n else if (dayIndex < TREND_DAYS) perDay[dayIndex] += 1;\n }\n\n let running = baseline;\n return perDay.map((count, index) => {\n running += count;\n const day = new Date(start.getTime() + index * DAY_MS);\n return {\n label: day.toLocaleDateString(undefined, { month: 'short', day: 'numeric' }),\n value: running,\n };\n });\n}\n\nexport function DashboardPage() {\n const { navigateTo } = useGovCitizenHub();\n const [nowMs] = useState(() => Date.now());\n\n // Authoritative, backend-computed totals for every tile + the status donut.\n const summary = useGovDashboardSummary();\n // A recent window — ONLY drives the trend chart + recent-activity list.\n const applications = useGovApplications({ pagination: { limit: RECENT_WINDOW } });\n\n const appItems = useMemo(() => applications.data?.items ?? [], [applications.data]);\n\n const trend = useMemo(\n () =>\n buildTrendSeries(\n appItems.map((a) => a.createdAt),\n nowMs\n ),\n [appItems, nowMs]\n );\n\n const statusBuckets = useMemo(() => {\n const byStatus = summary.data?.applicationsByStatus ?? [];\n return byStatus\n .map((bucket) => {\n const orderIndex = APP_STATUSES.indexOf(bucket.status);\n const colorIndex = orderIndex >= 0 ? orderIndex : 0;\n return {\n name: formatEnumLabel(bucket.status),\n value: bucket.count,\n color: CHART_SERIES_COLORS[colorIndex % CHART_SERIES_COLORS.length],\n };\n })\n .filter((slice) => slice.value > 0);\n }, [summary.data]);\n\n const statusTotal = useMemo(\n () => statusBuckets.reduce((sum, slice) => sum + slice.value, 0),\n [statusBuckets]\n );\n\n const recent = useMemo(\n () =>\n [...appItems]\n .sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime())\n .slice(0, 6),\n [appItems]\n );\n\n const metricsLoading = summary.isLoading;\n const trendLoading = applications.isLoading;\n const applicationsTotal = summary.data?.applicationsTotal ?? 0;\n const pendingAmount = summary.data?.pendingPaymentsAmount ?? 0;\n\n const cards = [\n {\n label: 'Applications',\n value: formatNumber(applicationsTotal),\n sublabel: 'filed to date',\n icon: <FileText className=\"h-5 w-5\" />,\n path: 'applications',\n featured: true,\n },\n {\n label: 'Pending payments',\n value: formatNumber(summary.data?.pendingPayments ?? 0),\n sublabel:\n pendingAmount > 0\n ? `${formatCurrency(pendingAmount, DEFAULT_CURRENCY)} due`\n : 'all settled',\n icon: <CreditCard className=\"h-5 w-5\" />,\n path: 'payments',\n accent: 'warning' as const,\n },\n {\n label: 'Open grievances',\n value: formatNumber(summary.data?.openGrievances ?? 0),\n sublabel: 'awaiting acknowledgement',\n icon: <MessageSquareWarning className=\"h-5 w-5\" />,\n path: 'grievances',\n accent: 'error' as const,\n },\n {\n label: 'Active permits',\n value: formatNumber(summary.data?.activePermits ?? 0),\n sublabel: 'currently valid',\n icon: <BadgeCheck className=\"h-5 w-5\" />,\n path: 'permits',\n accent: 'success' as const,\n },\n {\n label: 'Published services',\n value: formatNumber(summary.data?.publishedServices ?? 0),\n sublabel: 'available to citizens',\n icon: <Briefcase className=\"h-5 w-5\" />,\n path: 'services',\n },\n {\n label: 'Active agencies',\n value: formatNumber(summary.data?.activeAgencies ?? 0),\n sublabel: 'delivering services',\n icon: <Building2 className=\"h-5 w-5\" />,\n path: 'agencies',\n },\n ];\n\n return (\n <PageLayout\n title=\"GovCitizenHub\"\n titleGradient\n aurora\n description=\"Your live government service-delivery operations, at a glance.\"\n >\n <div className=\"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-6\">\n {cards.map((card) => (\n <MetricsCard\n key={card.label}\n icon={card.icon}\n value={metricsLoading ? '—' : card.value}\n label={card.label}\n sublabel={card.sublabel}\n featured={card.featured}\n accent={card.accent}\n onClick={() => navigateTo(card.path)}\n />\n ))}\n </div>\n\n <div className=\"mt-6 grid grid-cols-1 gap-4 lg:grid-cols-5\">\n <GlassCard treatment=\"glass\" className=\"p-5 lg:col-span-3\">\n <div className=\"flex items-start justify-between gap-4\">\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">Applications over time</h2>\n <p className=\"mt-0.5 text-xs text-text-muted\">\n Cumulative filings (recent sample, not a total)\n </p>\n </div>\n <span className=\"shrink-0 rounded-full border border-border-seam bg-bg-surface px-3 py-1 text-xs font-medium text-text-secondary\">\n Last 30 days\n </span>\n </div>\n <div className=\"mt-4\">\n {trendLoading ? (\n <Skeleton className=\"h-[260px] w-full rounded-card\" />\n ) : (\n <GovAreaChart data={trend} emptyLabel=\"No applications filed recently.\" />\n )}\n </div>\n </GlassCard>\n\n <GlassCard treatment=\"plain\" className=\"border-border-seam p-5 lg:col-span-2\">\n <h2 className=\"text-lg font-semibold text-text-primary\">Applications by status</h2>\n <div className=\"mt-3\">\n {metricsLoading ? (\n <Skeleton className=\"h-[240px] w-full rounded-card\" />\n ) : statusBuckets.length === 0 ? (\n <EmptyState\n title=\"No applications yet\"\n description=\"Filed applications will break down here by status.\"\n />\n ) : (\n <>\n <GovDonutChart\n data={statusBuckets}\n centerValue={formatNumber(applicationsTotal)}\n centerLabel=\"Total\"\n />\n <ChartLegend\n className=\"mt-4\"\n items={statusBuckets.map((slice) => {\n const denom = statusTotal || 1;\n const pct = Math.round((slice.value / denom) * 100);\n return {\n label: slice.name,\n color: slice.color,\n value: `${formatNumber(slice.value)} (${pct}%)`,\n };\n })}\n />\n </>\n )}\n </div>\n </GlassCard>\n </div>\n\n <GlassCard treatment=\"plain\" className=\"mt-6 border-border-seam p-5\">\n <div className=\"flex items-center justify-between gap-4\">\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">Recent applications</h2>\n <p className=\"mt-0.5 text-xs text-text-muted\">Latest filings (recent sample)</p>\n </div>\n <button\n type=\"button\"\n onClick={() => navigateTo('applications')}\n className=\"inline-flex items-center gap-1 text-sm font-medium text-action-primary-text outline-none transition-opacity hover:opacity-80 focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]\"\n >\n View all <ChevronRight className=\"h-4 w-4\" />\n </button>\n </div>\n <div className=\"mt-3\">\n {trendLoading ? (\n <div className=\"space-y-3\">\n {Array.from({ length: 4 }, (_, i) => (\n <Skeleton key={i} className=\"h-12 w-full rounded-card\" />\n ))}\n </div>\n ) : recent.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title=\"No applications yet\"\n description=\"Citizen applications will appear here as they are filed.\"\n />\n ) : (\n <div className=\"overflow-x-auto\">\n <table className=\"w-full min-w-[34rem] border-collapse text-left\">\n <thead>\n <tr className=\"border-b border-border-seam text-xs font-medium uppercase tracking-wide text-text-muted\">\n <th scope=\"col\" className=\"py-2.5 pr-3 font-medium\">\n Reference No.\n </th>\n <th scope=\"col\" className=\"px-3 py-2.5 font-medium\">\n Status\n </th>\n <th scope=\"col\" className=\"px-3 py-2.5 font-medium\">\n Priority\n </th>\n <th scope=\"col\" className=\"px-3 py-2.5 font-medium\">\n Submitted on\n </th>\n <th scope=\"col\" className=\"w-8\" aria-label=\"Open\" />\n </tr>\n </thead>\n <tbody>\n {recent.map((app) => (\n <tr\n key={app.id}\n tabIndex={0}\n role=\"button\"\n aria-label={`Open application ${app.reference}`}\n onClick={() => navigateTo(`applications/${app.id}`)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n navigateTo(`applications/${app.id}`);\n }\n }}\n className=\"group cursor-pointer border-b border-border-subtle outline-none transition-colors last:border-0 hover:bg-bg-sunken/60 focus-visible:bg-bg-sunken/60\"\n >\n <td className=\"py-3 pr-3\">\n <span className=\"flex items-center gap-2.5\">\n <span className=\"flex size-8 shrink-0 items-center justify-center rounded-button bg-[var(--color-accent-soft)] text-action-primary-text\">\n <FileText className=\"h-4 w-4\" />\n </span>\n <span className=\"truncate text-sm font-medium text-text-primary\">\n {app.reference}\n </span>\n </span>\n </td>\n <td className=\"px-3 py-3\">\n <StatusBadge status={app.status} />\n </td>\n <td className=\"px-3 py-3\">\n <StatusBadge status={app.priority} />\n </td>\n <td className=\"px-3 py-3 text-sm text-text-secondary\">\n {formatRelativeTime(app.submittedAt ?? app.createdAt)}\n </td>\n <td className=\"pr-1\">\n <ChevronRight className=\"h-4 w-4 text-text-muted transition-transform group-hover:translate-x-0.5\" />\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n )}\n </div>\n </GlassCard>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA6CA,IAAM,IAAS,OAAU,KAAK,KACxB,IAAa,IAEb,IAAmB,OAEnB,IAAgB,KAGhB,IAAuC;CAC3C;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,SAAS,EAAiB,GAAiB,GAA4B;CACrE,IAAM,IAAM,IAAI,KAAK,EAAM,EACrB,IAAQ,IAAI,KAAK,EAAI,aAAa,EAAE,EAAI,UAAU,EAAE,EAAI,SAAS,CAAC;AACxE,GAAM,QAAQ,EAAM,SAAS,IAAI,IAAa,KAAK,EAAO;CAE1D,IAAM,IAAa,MAAc,EAAW,CAAC,KAAK,EAAE,EAChD,IAAW;AAEf,MAAK,IAAM,KAAO,GAAO;EACvB,IAAM,IAAO,IAAI,KAAK,EAAI;AAC1B,MAAI,OAAO,MAAM,EAAK,SAAS,CAAC,CAAE;EAClC,IAAM,IAAW,KAAK,OAAO,EAAK,SAAS,GAAG,EAAM,SAAS,IAAI,EAAO;AACxE,EAAI,IAAW,IAAG,KAAY,IACrB,IAAW,MAAY,EAAO,MAAa;;CAGtD,IAAI,IAAU;AACd,QAAO,EAAO,KAAK,GAAO,OACxB,KAAW,GAEJ;EACL,OAFU,IAAI,KAAK,EAAM,SAAS,GAAG,IAAQ,EAAO,CAEzC,mBAAmB,KAAA,GAAW;GAAE,OAAO;GAAS,KAAK;GAAW,CAAC;EAC5E,OAAO;EACR,EACD;;AAGJ,SAAgB,IAAgB;CAC9B,IAAM,EAAE,kB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AY,CAAA;YAC3B,CAAA,EACP,kBAAC,QAAD;YAAM,WAAU;sBACb,EAAI;YACA,CAAA,CACF;;UACJ,CAAA;SACL,kBAAC,MAAD;UAAI,WAAU;oBACZ,kBAAC,GAAD,EAAa,QAAQ,EAAI,QAAU,CAAA;UAChC,CAAA;SACL,kBAAC,MAAD;UAAI,WAAU;oBACZ,kBAAC,GAAD,EAAa,QAAQ,EAAI,UAAY,CAAA;UAClC,CAAA;SACL,kBAAC,MAAD;UAAI,WAAU;oBACX,EAAmB,EAAI,eAAe,EAAI,UAAU;UAClD,CAAA;SACL,kBAAC,MAAD;UAAI,WAAU;oBACZ,kBAAC,GAAD,EAAc,WAAU,4EAA6E,CAAA;UAClG,CAAA;SACF;UAnCE,EAAI,GAmCN,CACL,EACI,CAAA,CACF;;MACJ,CAAA;KAEJ,CAAA,CACI;;GACD"}
1
+ {"version":3,"file":"DashboardPage.js","names":[],"sources":["../../../src/govcitizenhub/pages/DashboardPage.tsx"],"sourcesContent":["/**\n * DashboardPage — the GovCitizenHub operations control center.\n * @module govcitizenhub/pages\n *\n * The six metric tiles and the \"Applications by status\" donut read from\n * `govDashboardSummary` — svc-computed, full-corpus AUTHORITATIVE counts, never\n * a capped client-side window. The \"Recent applications\" area trend and the\n * recent-activity list are the ONLY surfaces sourced from a paged read of the\n * latest applications, and are labelled as a recent sample so they never imply\n * a total.\n */\n\nimport { useMemo, useState } from 'react';\nimport {\n FileText,\n CreditCard,\n MessageSquareWarning,\n BadgeCheck,\n Briefcase,\n Building2,\n ChevronRight,\n} from 'lucide-react';\nimport { GlassCard, Skeleton } from '@burdenoff/fe-libs/ui';\n\nimport { PageLayout } from '../components/PageLayout';\nimport { MetricsCard } from '../components/MetricsCard';\nimport {\n GovAreaChart,\n GovDonutChart,\n ChartLegend,\n CHART_SERIES_COLORS,\n type AreaPoint,\n} from '../components/GovCharts';\nimport { StatusBadge } from '../components/StatusBadge';\nimport { EmptyState } from '../components/EmptyState';\nimport type { MetricDelta } from '../components/MetricsCard';\nimport { useGovApplications, useGovDashboardSummary, useGovApplicationsByService } from '../hooks';\nimport { useGovCitizenHub } from '../context';\nimport {\n formatNumber,\n formatCurrency,\n formatRelativeTime,\n formatEnumLabel,\n} from '../utils/formatters';\nimport type { GovApplicationStatus, GovDashboardTrend } from '../types';\n\nconst DAY_MS = 24 * 60 * 60 * 1000;\nconst TREND_DAYS = 30;\n/** Default currency for the aggregate pending-payments amount (svc summary has no currency). */\nconst DEFAULT_CURRENCY = 'INR';\n/** Size of the recent-applications window used for the trend + activity list only. */\nconst RECENT_WINDOW = 100;\n/** How many services to show in the \"Applications by service\" breakdown. */\nconst TOP_SERVICES_COUNT = 5;\n\n// Stable donut colour order — index into CHART_SERIES_COLORS by status.\nconst APP_STATUSES: GovApplicationStatus[] = [\n 'DRAFT',\n 'SUBMITTED',\n 'IN_REVIEW',\n 'INFO_REQUESTED',\n 'APPROVED',\n 'REJECTED',\n 'WITHDRAWN',\n];\n\n/**\n * Converts a svc-computed `GovDashboardTrend` into the `MetricsCard` delta prop.\n * FLAT trends (no meaningful period-over-period movement) return undefined so\n * the tile falls back to its plain sublabel instead of an ambiguous 0% arrow.\n *\n * `goodWhenUp` flips the green/red framing per metric — e.g. more applications\n * filed is good news (green on UP), but more pending payments or open\n * grievances is NOT (green on DOWN instead).\n */\nfunction toDelta(trend: GovDashboardTrend, goodWhenUp: boolean): MetricDelta | undefined {\n if (trend.direction === 'FLAT') return undefined;\n const isUp = trend.direction === 'UP';\n const magnitude =\n trend.changePercent != null\n ? `${Math.abs(trend.changePercent).toFixed(1)}%`\n : `${trend.current} new`;\n return {\n value: magnitude,\n direction: isUp ? 'up' : 'down',\n positive: isUp === goodWhenUp,\n caption: 'vs last 30 days',\n };\n}\n\nfunction buildTrendSeries(dates: string[], nowMs: number): AreaPoint[] {\n const now = new Date(nowMs);\n const start = new Date(now.getFullYear(), now.getMonth(), now.getDate());\n start.setTime(start.getTime() - (TREND_DAYS - 1) * DAY_MS);\n\n const perDay = new Array<number>(TREND_DAYS).fill(0);\n let baseline = 0;\n\n for (const iso of dates) {\n const when = new Date(iso);\n if (Number.isNaN(when.getTime())) continue;\n const dayIndex = Math.floor((when.getTime() - start.getTime()) / DAY_MS);\n if (dayIndex < 0) baseline += 1;\n else if (dayIndex < TREND_DAYS) perDay[dayIndex] += 1;\n }\n\n let running = baseline;\n return perDay.map((count, index) => {\n running += count;\n const day = new Date(start.getTime() + index * DAY_MS);\n return {\n label: day.toLocaleDateString(undefined, { month: 'short', day: 'numeric' }),\n value: running,\n };\n });\n}\n\nexport function DashboardPage() {\n const { navigateTo } = useGovCitizenHub();\n const [nowMs] = useState(() => Date.now());\n\n // Authoritative, backend-computed totals for every tile + the status donut.\n const summary = useGovDashboardSummary();\n // A recent window — ONLY drives the trend chart + recent-activity list.\n const applications = useGovApplications({ pagination: { limit: RECENT_WINDOW } });\n // Corpus-wide service breakdown (not capped to the recent window above).\n const byService = useGovApplicationsByService();\n\n const appItems = useMemo(() => applications.data?.items ?? [], [applications.data]);\n\n const trend = useMemo(\n () =>\n buildTrendSeries(\n appItems.map((a) => a.createdAt),\n nowMs\n ),\n [appItems, nowMs]\n );\n\n const statusBuckets = useMemo(() => {\n const byStatus = summary.data?.applicationsByStatus ?? [];\n return byStatus\n .map((bucket) => {\n const orderIndex = APP_STATUSES.indexOf(bucket.status);\n const colorIndex = orderIndex >= 0 ? orderIndex : 0;\n return {\n name: formatEnumLabel(bucket.status),\n value: bucket.count,\n color: CHART_SERIES_COLORS[colorIndex % CHART_SERIES_COLORS.length],\n };\n })\n .filter((slice) => slice.value > 0);\n }, [summary.data]);\n\n const statusTotal = useMemo(\n () => statusBuckets.reduce((sum, slice) => sum + slice.value, 0),\n [statusBuckets]\n );\n\n const recent = useMemo(\n () =>\n [...appItems]\n .sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime())\n .slice(0, 6),\n [appItems]\n );\n\n const topServices = useMemo(\n () => (byService.data ?? []).slice(0, TOP_SERVICES_COUNT),\n [byService.data]\n );\n const topServicesMax = useMemo(\n () => topServices.reduce((max, row) => Math.max(max, row.count), 0),\n [topServices]\n );\n\n const metricsLoading = summary.isLoading;\n const trendLoading = applications.isLoading;\n const applicationsTotal = summary.data?.applicationsTotal ?? 0;\n const pendingAmount = summary.data?.pendingPaymentsAmount ?? 0;\n\n const cards = [\n {\n label: 'Applications',\n value: formatNumber(applicationsTotal),\n sublabel: 'filed to date',\n delta: summary.data ? toDelta(summary.data.applicationsTotalTrend, true) : undefined,\n icon: <FileText className=\"h-5 w-5\" />,\n path: 'applications',\n featured: true,\n },\n {\n label: 'Pending payments',\n value: formatNumber(summary.data?.pendingPayments ?? 0),\n sublabel:\n pendingAmount > 0\n ? `${formatCurrency(pendingAmount, DEFAULT_CURRENCY)} due`\n : 'all settled',\n delta: summary.data ? toDelta(summary.data.pendingPaymentsTrend, false) : undefined,\n icon: <CreditCard className=\"h-5 w-5\" />,\n path: 'payments',\n accent: 'warning' as const,\n },\n {\n label: 'Open grievances',\n value: formatNumber(summary.data?.openGrievances ?? 0),\n sublabel: 'awaiting acknowledgement',\n delta: summary.data ? toDelta(summary.data.openGrievancesTrend, false) : undefined,\n icon: <MessageSquareWarning className=\"h-5 w-5\" />,\n path: 'grievances',\n accent: 'error' as const,\n },\n {\n label: 'Active permits',\n value: formatNumber(summary.data?.activePermits ?? 0),\n sublabel: 'currently valid',\n delta: summary.data ? toDelta(summary.data.activePermitsTrend, true) : undefined,\n icon: <BadgeCheck className=\"h-5 w-5\" />,\n path: 'permits',\n accent: 'success' as const,\n },\n {\n label: 'Published services',\n value: formatNumber(summary.data?.publishedServices ?? 0),\n sublabel: 'available to citizens',\n delta: summary.data ? toDelta(summary.data.publishedServicesTrend, true) : undefined,\n icon: <Briefcase className=\"h-5 w-5\" />,\n path: 'services',\n },\n {\n label: 'Active agencies',\n value: formatNumber(summary.data?.activeAgencies ?? 0),\n sublabel: 'delivering services',\n delta: summary.data ? toDelta(summary.data.activeAgenciesTrend, true) : undefined,\n icon: <Building2 className=\"h-5 w-5\" />,\n path: 'agencies',\n },\n ];\n\n return (\n <PageLayout\n title=\"GovCitizenHub\"\n titleGradient\n aurora\n description=\"Your live government service-delivery operations, at a glance.\"\n >\n <div className=\"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-6\">\n {cards.map((card) => (\n <MetricsCard\n key={card.label}\n icon={card.icon}\n value={metricsLoading ? '—' : card.value}\n label={card.label}\n sublabel={card.sublabel}\n delta={metricsLoading ? undefined : card.delta}\n featured={card.featured}\n accent={card.accent}\n onClick={() => navigateTo(card.path)}\n />\n ))}\n </div>\n\n <div className=\"mt-6 grid grid-cols-1 gap-4 lg:grid-cols-5\">\n <GlassCard treatment=\"glass\" className=\"p-5 lg:col-span-3\">\n <div className=\"flex items-start justify-between gap-4\">\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">Applications over time</h2>\n <p className=\"mt-0.5 text-xs text-text-muted\">\n Cumulative filings (recent sample, not a total)\n </p>\n </div>\n <span className=\"shrink-0 rounded-full border border-border-seam bg-bg-surface px-3 py-1 text-xs font-medium text-text-secondary\">\n Last 30 days\n </span>\n </div>\n <div className=\"mt-4\">\n {trendLoading ? (\n <Skeleton className=\"h-[260px] w-full rounded-card\" />\n ) : (\n <GovAreaChart data={trend} emptyLabel=\"No applications filed recently.\" />\n )}\n </div>\n </GlassCard>\n\n <GlassCard treatment=\"plain\" className=\"border-border-seam p-5 lg:col-span-2\">\n <h2 className=\"text-lg font-semibold text-text-primary\">Applications by status</h2>\n <div className=\"mt-3\">\n {metricsLoading ? (\n <Skeleton className=\"h-[240px] w-full rounded-card\" />\n ) : statusBuckets.length === 0 ? (\n <EmptyState\n title=\"No applications yet\"\n description=\"Filed applications will break down here by status.\"\n />\n ) : (\n <>\n <GovDonutChart\n data={statusBuckets}\n centerValue={formatNumber(applicationsTotal)}\n centerLabel=\"Total\"\n />\n <ChartLegend\n className=\"mt-4\"\n items={statusBuckets.map((slice) => {\n const denom = statusTotal || 1;\n const pct = Math.round((slice.value / denom) * 100);\n return {\n label: slice.name,\n color: slice.color,\n value: `${formatNumber(slice.value)} (${pct}%)`,\n };\n })}\n />\n </>\n )}\n </div>\n </GlassCard>\n </div>\n\n <GlassCard treatment=\"plain\" className=\"mt-6 border-border-seam p-5\">\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">Applications by service</h2>\n <p className=\"mt-0.5 text-xs text-text-muted\">\n Corpus-wide volume, not limited to the recent sample above\n </p>\n </div>\n <div className=\"mt-4\">\n {byService.isLoading ? (\n <div className=\"space-y-3\">\n {Array.from({ length: 3 }, (_, i) => (\n <Skeleton key={i} className=\"h-8 w-full rounded-card\" />\n ))}\n </div>\n ) : topServices.length === 0 ? (\n <EmptyState\n title=\"No applications yet\"\n description=\"Once citizens file applications, the busiest services will rank here.\"\n />\n ) : (\n <ul className=\"space-y-3\">\n {topServices.map((row) => {\n const pct = topServicesMax > 0 ? Math.round((row.count / topServicesMax) * 100) : 0;\n return (\n <li key={row.serviceId}>\n <button\n type=\"button\"\n onClick={() => navigateTo(`services/${row.serviceId}`)}\n className=\"flex w-full items-center gap-3 rounded-button text-left outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]\"\n >\n <span className=\"w-40 shrink-0 truncate text-sm font-medium text-text-primary\">\n {row.serviceName}\n </span>\n <span className=\"h-2 flex-1 overflow-hidden rounded-full bg-bg-sunken\">\n <span\n className=\"block h-full rounded-full bg-[var(--color-action-primary-bg)]\"\n style={{ width: `${pct}%` }}\n />\n </span>\n <span className=\"w-10 shrink-0 text-right text-sm font-semibold tabular-nums text-text-primary\">\n {formatNumber(row.count)}\n </span>\n </button>\n </li>\n );\n })}\n </ul>\n )}\n </div>\n </GlassCard>\n\n <GlassCard treatment=\"plain\" className=\"mt-6 border-border-seam p-5\">\n <div className=\"flex items-center justify-between gap-4\">\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">Recent applications</h2>\n <p className=\"mt-0.5 text-xs text-text-muted\">Latest filings (recent sample)</p>\n </div>\n <button\n type=\"button\"\n onClick={() => navigateTo('applications')}\n className=\"inline-flex items-center gap-1 text-sm font-medium text-action-primary-text outline-none transition-opacity hover:opacity-80 focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]\"\n >\n View all <ChevronRight className=\"h-4 w-4\" />\n </button>\n </div>\n <div className=\"mt-3\">\n {trendLoading ? (\n <div className=\"space-y-3\">\n {Array.from({ length: 4 }, (_, i) => (\n <Skeleton key={i} className=\"h-12 w-full rounded-card\" />\n ))}\n </div>\n ) : recent.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title=\"No applications yet\"\n description=\"Citizen applications will appear here as they are filed.\"\n />\n ) : (\n <div className=\"overflow-x-auto\">\n <table className=\"w-full min-w-[34rem] border-collapse text-left\">\n <thead>\n <tr className=\"border-b border-border-seam text-xs font-medium uppercase tracking-wide text-text-muted\">\n <th scope=\"col\" className=\"py-2.5 pr-3 font-medium\">\n Reference No.\n </th>\n <th scope=\"col\" className=\"px-3 py-2.5 font-medium\">\n Status\n </th>\n <th scope=\"col\" className=\"px-3 py-2.5 font-medium\">\n Priority\n </th>\n <th scope=\"col\" className=\"px-3 py-2.5 font-medium\">\n Submitted on\n </th>\n <th scope=\"col\" className=\"w-8\" aria-label=\"Open\" />\n </tr>\n </thead>\n <tbody>\n {recent.map((app) => (\n <tr\n key={app.id}\n tabIndex={0}\n role=\"button\"\n aria-label={`Open application ${app.reference}`}\n onClick={() => navigateTo(`applications/${app.id}`)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n navigateTo(`applications/${app.id}`);\n }\n }}\n className=\"group cursor-pointer border-b border-border-subtle outline-none transition-colors last:border-0 hover:bg-bg-sunken/60 focus-visible:bg-bg-sunken/60\"\n >\n <td className=\"py-3 pr-3\">\n <span className=\"flex items-center gap-2.5\">\n <span className=\"flex size-8 shrink-0 items-center justify-center rounded-button bg-[var(--color-accent-soft)] text-action-primary-text\">\n <FileText className=\"h-4 w-4\" />\n </span>\n <span className=\"truncate text-sm font-medium text-text-primary\">\n {app.reference}\n </span>\n </span>\n </td>\n <td className=\"px-3 py-3\">\n <StatusBadge status={app.status} />\n </td>\n <td className=\"px-3 py-3\">\n <StatusBadge status={app.priority} />\n </td>\n <td className=\"px-3 py-3 text-sm text-text-secondary\">\n {formatRelativeTime(app.submittedAt ?? app.createdAt)}\n </td>\n <td className=\"pr-1\">\n <ChevronRight className=\"h-4 w-4 text-text-muted transition-transform group-hover:translate-x-0.5\" />\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n )}\n </div>\n </GlassCard>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA8CA,IAAM,IAAS,OAAU,KAAK,KACxB,IAAa,IAEb,IAAmB,OAEnB,IAAgB,KAEhB,IAAqB,GAGrB,IAAuC;CAC3C;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAWD,SAAS,EAAQ,GAA0B,GAA8C;AACvF,KAAI,EAAM,cAAc,OAAQ;CAChC,IAAM,IAAO,EAAM,cAAc;AAKjC,QAAO;EACL,OAJA,EAAM,iBAAiB,OAEnB,GAAG,EAAM,QAAQ,QADjB,GAAG,KAAK,IAAI,EAAM,cAAc,CAAC,QAAQ,EAAE,CAAC;EAIhD,WAAW,IAAO,OAAO;EACzB,UAAU,MAAS;EACnB,SAAS;EACV;;AAGH,SAAS,EAAiB,GAAiB,GAA4B;CACrE,IAAM,IAAM,IAAI,KAAK,EAAM,EACrB,IAAQ,IAAI,KAAK,EAAI,aAAa,EAAE,EAAI,UAAU,EAAE,EAAI,SAAS,CAAC;AACxE,GAAM,QAAQ,EAAM,SAAS,IAAI,IAAa,KAAK,EAAO;CAE1D,IAAM,IAAa,MAAc,EAAW,CAAC,KAAK,EAAE,EAChD,IAAW;AAEf,MAAK,IAAM,KAAO,GAAO;EACvB,IAAM,IAAO,IAAI,KAAK,EAAI;AAC1B,MAAI,OAAO,MAAM,EAAK,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I,UAAU;UAClD,CAAA;SACL,kBAAC,MAAD;UAAI,WAAU;oBACZ,kBAAC,GAAD,EAAc,WAAU,4EAA6E,CAAA;UAClG,CAAA;SACF;UAnCE,EAAI,GAmCN,CACL,EACI,CAAA,CACF;;MACJ,CAAA;KAEJ,CAAA,CACI;;GACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"ApplicationsPage.d.ts","sourceRoot":"","sources":["../../../../src/govcitizenhub/pages/applications/ApplicationsPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAkNH,wBAAgB,gBAAgB,4CA4M/B"}
1
+ {"version":3,"file":"ApplicationsPage.d.ts","sourceRoot":"","sources":["../../../../src/govcitizenhub/pages/applications/ApplicationsPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA4NH,wBAAgB,gBAAgB,4CA6Q/B"}