@burdenoff/microfe-ecoimpacthub 2026.819.4 → 2026.830.1

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 (51) hide show
  1. package/dist/ecoimpacthub/hooks/index.d.ts +2 -0
  2. package/dist/ecoimpacthub/hooks/index.d.ts.map +1 -1
  3. package/dist/ecoimpacthub/hooks/index.js +2 -0
  4. package/dist/ecoimpacthub/hooks/useActiveEcoEntity.d.ts +11 -0
  5. package/dist/ecoimpacthub/hooks/useActiveEcoEntity.d.ts.map +1 -0
  6. package/dist/ecoimpacthub/hooks/useActiveEcoEntity.js +21 -0
  7. package/dist/ecoimpacthub/hooks/useActiveEcoEntity.js.map +1 -0
  8. package/dist/ecoimpacthub/hooks/useTr.d.ts +4 -0
  9. package/dist/ecoimpacthub/hooks/useTr.d.ts.map +1 -0
  10. package/dist/ecoimpacthub/hooks/useTr.js +20 -0
  11. package/dist/ecoimpacthub/hooks/useTr.js.map +1 -0
  12. package/dist/ecoimpacthub/pages/DashboardPage.d.ts.map +1 -1
  13. package/dist/ecoimpacthub/pages/DashboardPage.js +162 -138
  14. package/dist/ecoimpacthub/pages/DashboardPage.js.map +1 -1
  15. package/dist/ecoimpacthub/pages/_shared/MethodPicker.d.ts +15 -0
  16. package/dist/ecoimpacthub/pages/_shared/MethodPicker.d.ts.map +1 -0
  17. package/dist/ecoimpacthub/pages/_shared/MethodPicker.js +36 -0
  18. package/dist/ecoimpacthub/pages/_shared/MethodPicker.js.map +1 -0
  19. package/dist/ecoimpacthub/pages/_shared/UseMyLocationButton.d.ts +15 -0
  20. package/dist/ecoimpacthub/pages/_shared/UseMyLocationButton.d.ts.map +1 -0
  21. package/dist/ecoimpacthub/pages/_shared/UseMyLocationButton.js +66 -0
  22. package/dist/ecoimpacthub/pages/_shared/UseMyLocationButton.js.map +1 -0
  23. package/dist/ecoimpacthub/pages/habitat/HabitatProjectDetailPage.d.ts.map +1 -1
  24. package/dist/ecoimpacthub/pages/habitat/HabitatProjectDetailPage.js +127 -124
  25. package/dist/ecoimpacthub/pages/habitat/HabitatProjectDetailPage.js.map +1 -1
  26. package/dist/ecoimpacthub/pages/observations/ObservationsPage.d.ts.map +1 -1
  27. package/dist/ecoimpacthub/pages/observations/ObservationsPage.js +226 -224
  28. package/dist/ecoimpacthub/pages/observations/ObservationsPage.js.map +1 -1
  29. package/dist/ecoimpacthub/pages/reports/ReportDetailPage.d.ts.map +1 -1
  30. package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js +159 -156
  31. package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js.map +1 -1
  32. package/dist/ecoimpacthub/pages/sites/SiteDetailPage.d.ts.map +1 -1
  33. package/dist/ecoimpacthub/pages/sites/SiteDetailPage.js +40 -37
  34. package/dist/ecoimpacthub/pages/sites/SiteDetailPage.js.map +1 -1
  35. package/dist/ecoimpacthub/pages/sites/SitesPage.d.ts.map +1 -1
  36. package/dist/ecoimpacthub/pages/sites/SitesPage.js +208 -171
  37. package/dist/ecoimpacthub/pages/sites/SitesPage.js.map +1 -1
  38. package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.d.ts.map +1 -1
  39. package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.js +211 -214
  40. package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.js.map +1 -1
  41. package/dist/ecoimpacthub/pages/species/SpeciesPage.d.ts.map +1 -1
  42. package/dist/ecoimpacthub/pages/species/SpeciesPage.js +174 -157
  43. package/dist/ecoimpacthub/pages/species/SpeciesPage.js.map +1 -1
  44. package/dist/ecoimpacthub/utils/activeEntity.d.ts +30 -0
  45. package/dist/ecoimpacthub/utils/activeEntity.d.ts.map +1 -0
  46. package/dist/ecoimpacthub/utils/activeEntity.js +12 -0
  47. package/dist/ecoimpacthub/utils/activeEntity.js.map +1 -0
  48. package/dist/ecoimpacthub/utils/pageContext.d.ts.map +1 -1
  49. package/dist/ecoimpacthub/utils/pageContext.js +30 -25
  50. package/dist/ecoimpacthub/utils/pageContext.js.map +1 -1
  51. package/package.json +1 -1
@@ -4,19 +4,20 @@ import { formatDate as n, formatDateTime as ee, formatEnumLabel as r, formatNumb
4
4
  import { ErrorView as te, LoadingView as ne, Section as re } from "../../components/StateViews.js";
5
5
  import { EmptyState as a } from "../../components/EmptyState.js";
6
6
  import "../../context/index.js";
7
- import { useEcoHabitatProject as ie, useEcoLogRestorationActivity as o, useEcoSites as ae, useEcoTransitionHabitatProject as oe } from "../../hooks/useEcoImpactHubApi.js";
7
+ import { useEcoHabitatProject as o, useEcoLogRestorationActivity as s, useEcoSites as ie, useEcoTransitionHabitatProject as ae } from "../../hooks/useEcoImpactHubApi.js";
8
+ import { useActiveEcoEntity as oe } from "../../hooks/useActiveEcoEntity.js";
8
9
  import "../../hooks/index.js";
9
10
  import { DataTable as se } from "../../components/DataTable.js";
10
- import { EcoTags as ce } from "../../components/EcoTags.js";
11
- import { ActivityTypeBadge as s, LifecycleBadge as c } from "../badges.js";
12
- import { LifecycleProgress as le } from "./LifecycleProgress.js";
13
- import { useMemo as l, useState as u } from "react";
14
- import { ArrowLeft as ue, ArrowRight as d, Plus as f, Sprout as de } from "lucide-react";
11
+ import { EcoTags as c } from "../../components/EcoTags.js";
12
+ import { ActivityTypeBadge as l, LifecycleBadge as u } from "../badges.js";
13
+ import { LifecycleProgress as ce } from "./LifecycleProgress.js";
14
+ import { useMemo as d, useState as f } from "react";
15
+ import { ArrowLeft as le, ArrowRight as ue, Plus as p, Sprout as de } from "lucide-react";
15
16
  import { useParams as fe } from "react-router";
16
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
17
- import { Button as h, GlassCard as g, Input as _, Label as v, ResponsiveDialog as y, ResponsiveDialogContent as b, ResponsiveDialogDescription as x, ResponsiveDialogFooter as S, ResponsiveDialogHeader as C, ResponsiveDialogTitle as w, Select as T, SelectContent as E, SelectItem as D, SelectTrigger as O, SelectValue as k, Textarea as A } from "@burdenoff/fe-libs/ui";
17
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
18
+ import { Button as g, GlassCard as _, Input as v, Label as y, ResponsiveDialog as b, ResponsiveDialogContent as x, ResponsiveDialogDescription as S, ResponsiveDialogFooter as C, ResponsiveDialogHeader as w, ResponsiveDialogTitle as T, Select as E, SelectContent as D, SelectItem as O, SelectTrigger as k, SelectValue as A, Textarea as j } from "@burdenoff/fe-libs/ui";
18
19
  //#region src/ecoimpacthub/pages/habitat/HabitatProjectDetailPage.tsx
19
- var j = {
20
+ var M = {
20
21
  PLANNED: [
21
22
  "IN_PROGRESS",
22
23
  "ON_HOLD",
@@ -32,7 +33,7 @@ var j = {
32
33
  ON_HOLD: ["IN_PROGRESS", "CANCELLED"],
33
34
  COMPLETED: [],
34
35
  CANCELLED: []
35
- }, M = [
36
+ }, N = [
36
37
  "PLANTING",
37
38
  "INVASIVE_REMOVAL",
38
39
  "REWILDING",
@@ -40,48 +41,50 @@ var j = {
40
41
  "SOIL_REMEDIATION",
41
42
  "COMMUNITY_ENGAGEMENT",
42
43
  "SURVEY"
43
- ], N = () => {
44
+ ], P = () => {
44
45
  let e = /* @__PURE__ */ new Date();
45
46
  return (/* @__PURE__ */ new Date(e.getTime() - e.getTimezoneOffset() * 6e4)).toISOString().slice(0, 16);
46
- }, P = () => ({
47
+ }, F = () => ({
47
48
  type: "PLANTING",
48
49
  summary: "",
49
50
  details: "",
50
51
  quantity: "",
51
52
  unit: "",
52
- performedAt: N()
53
+ performedAt: P()
53
54
  });
54
- function F({ label: e, children: t }) {
55
- return /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("dt", {
55
+ function I({ label: e, children: t }) {
56
+ return /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("dt", {
56
57
  className: "text-xs text-text-tertiary",
57
58
  children: e
58
- }), /* @__PURE__ */ p("dd", {
59
+ }), /* @__PURE__ */ m("dd", {
59
60
  className: "mt-1 text-sm text-text-primary",
60
61
  children: t
61
62
  })] });
62
63
  }
63
- function I() {
64
- let { id: N } = fe(), { navigateTo: I } = e(), { data: L, isLoading: R, isError: z, refetch: B } = ie(N), V = ae({ pagination: {
64
+ function L() {
65
+ let { id: P } = fe(), { navigateTo: L } = e(), { data: R, isLoading: z, isError: B, refetch: V } = o(P);
66
+ oe(R?.id, R?.name);
67
+ let pe = ie({ pagination: {
65
68
  limit: 100,
66
69
  offset: 0
67
- } }), H = oe(), U = o(), [pe, W] = u(!1), [G, K] = u(P), [q, J] = u(null), Y = L?.siteId ?? null, X = V.data?.items, Z = l(() => Y ? X?.find((e) => e.id === Y)?.name ?? null : null, [Y, X]);
68
- if (R) return /* @__PURE__ */ p(t, {
70
+ } }), H = ae(), U = s(), [me, W] = f(!1), [G, K] = f(F), [q, J] = f(null), Y = R?.siteId ?? null, X = pe.data?.items, Z = d(() => Y ? X?.find((e) => e.id === Y)?.name ?? null : null, [Y, X]);
71
+ if (z) return /* @__PURE__ */ m(t, {
69
72
  title: "Habitat project",
70
- children: /* @__PURE__ */ p(ne, {})
73
+ children: /* @__PURE__ */ m(ne, {})
71
74
  });
72
- if (z || !L) return /* @__PURE__ */ p(t, {
75
+ if (B || !R) return /* @__PURE__ */ m(t, {
73
76
  title: "Habitat project",
74
- children: /* @__PURE__ */ p(te, {
77
+ children: /* @__PURE__ */ m(te, {
75
78
  message: "This project could not be loaded.",
76
- onRetry: () => B()
79
+ onRetry: () => V()
77
80
  })
78
81
  });
79
- let Q = L.activities ?? [], $ = j[L.status], me = [Z, [n(L.startDate), n(L.endDate)].join(" – ")].filter((e) => e && e !== "— – —").join(" · "), he = async (e) => {
80
- if (N) {
82
+ let Q = R.activities ?? [], $ = M[R.status], he = [Z, [n(R.startDate), n(R.endDate)].join(" – ")].filter((e) => e && e !== "— – —").join(" · "), ge = async (e) => {
83
+ if (P) {
81
84
  J(null);
82
85
  try {
83
86
  await H.mutateAsync({
84
- id: N,
87
+ id: P,
85
88
  status: e
86
89
  });
87
90
  } catch (e) {
@@ -89,160 +92,160 @@ function I() {
89
92
  }
90
93
  }
91
94
  };
92
- return /* @__PURE__ */ m(t, {
93
- title: /* @__PURE__ */ m("span", {
95
+ return /* @__PURE__ */ h(t, {
96
+ title: /* @__PURE__ */ h("span", {
94
97
  className: "flex flex-wrap items-center gap-x-3 gap-y-2",
95
- children: [/* @__PURE__ */ p("span", {
98
+ children: [/* @__PURE__ */ m("span", {
96
99
  className: "text-text-primary",
97
- children: L.name
98
- }), /* @__PURE__ */ p(c, { status: L.status })]
100
+ children: R.name
101
+ }), /* @__PURE__ */ m(u, { status: R.status })]
99
102
  }),
100
- description: me || void 0,
101
- actions: /* @__PURE__ */ m(h, {
103
+ description: he || void 0,
104
+ actions: /* @__PURE__ */ h(g, {
102
105
  variant: "ghost",
103
- onClick: () => I("habitat"),
104
- children: [/* @__PURE__ */ p(ue, { className: "mr-1.5 h-4 w-4" }), " Back"]
106
+ onClick: () => L("habitat"),
107
+ children: [/* @__PURE__ */ m(le, { className: "mr-1.5 h-4 w-4" }), " Back"]
105
108
  }),
106
109
  children: [
107
- /* @__PURE__ */ m("div", {
110
+ /* @__PURE__ */ h("div", {
108
111
  className: "grid grid-cols-1 gap-4 lg:grid-cols-4",
109
112
  children: [
110
- /* @__PURE__ */ m(g, {
113
+ /* @__PURE__ */ h(_, {
111
114
  treatment: "glass",
112
115
  className: "p-6 lg:col-span-2",
113
116
  children: [
114
- /* @__PURE__ */ m("dl", {
117
+ /* @__PURE__ */ h("dl", {
115
118
  className: "grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3",
116
119
  children: [
117
- /* @__PURE__ */ p(F, {
120
+ /* @__PURE__ */ m(I, {
118
121
  label: "Status",
119
- children: /* @__PURE__ */ p(c, { status: L.status })
122
+ children: /* @__PURE__ */ m(u, { status: R.status })
120
123
  }),
121
- /* @__PURE__ */ p(F, {
124
+ /* @__PURE__ */ m(I, {
122
125
  label: "Target area",
123
- children: /* @__PURE__ */ p("span", {
126
+ children: /* @__PURE__ */ m("span", {
124
127
  className: "tabular-nums",
125
- children: L.targetHectares == null ? "—" : `${i(L.targetHectares)} ha`
128
+ children: R.targetHectares == null ? "—" : `${i(R.targetHectares)} ha`
126
129
  })
127
130
  }),
128
- /* @__PURE__ */ p(F, {
131
+ /* @__PURE__ */ m(I, {
129
132
  label: "Budget",
130
- children: /* @__PURE__ */ p("span", {
133
+ children: /* @__PURE__ */ m("span", {
131
134
  className: "tabular-nums",
132
- children: L.budgetAmount > 0 ? `${i(L.budgetAmount)} ${L.currency}` : "—"
135
+ children: R.budgetAmount > 0 ? `${i(R.budgetAmount)} ${R.currency}` : "—"
133
136
  })
134
137
  }),
135
- /* @__PURE__ */ p(F, {
138
+ /* @__PURE__ */ m(I, {
136
139
  label: "Start",
137
- children: n(L.startDate)
140
+ children: n(R.startDate)
138
141
  }),
139
- /* @__PURE__ */ p(F, {
142
+ /* @__PURE__ */ m(I, {
140
143
  label: "End",
141
- children: n(L.endDate)
144
+ children: n(R.endDate)
142
145
  }),
143
- /* @__PURE__ */ p(F, {
144
- label: L.completedAt ? "Completed" : "Site",
145
- children: L.completedAt ? n(L.completedAt) : Z ?? "—"
146
+ /* @__PURE__ */ m(I, {
147
+ label: R.completedAt ? "Completed" : "Site",
148
+ children: R.completedAt ? n(R.completedAt) : Z ?? "—"
146
149
  }),
147
- L.completedAt && /* @__PURE__ */ p(F, {
150
+ R.completedAt && /* @__PURE__ */ m(I, {
148
151
  label: "Site",
149
152
  children: Z ?? "—"
150
153
  })
151
154
  ]
152
155
  }),
153
- L.description && /* @__PURE__ */ p("p", {
156
+ R.description && /* @__PURE__ */ m("p", {
154
157
  className: "mt-5 rounded-lg bg-bg-sunken/60 p-3 text-sm text-text-secondary",
155
- children: L.description
158
+ children: R.description
156
159
  }),
157
- /* @__PURE__ */ p("div", {
160
+ /* @__PURE__ */ m("div", {
158
161
  className: "mt-5 border-t border-border-seam pt-4",
159
- children: /* @__PURE__ */ p(ce, {
162
+ children: /* @__PURE__ */ m(c, {
160
163
  entityType: "ecoimpacthub-habitat",
161
- entityId: L.id
164
+ entityId: R.id
162
165
  })
163
166
  })
164
167
  ]
165
168
  }),
166
- /* @__PURE__ */ m(g, {
169
+ /* @__PURE__ */ h(_, {
167
170
  treatment: "glass",
168
171
  className: "flex flex-col p-6",
169
- children: [/* @__PURE__ */ p("p", {
172
+ children: [/* @__PURE__ */ m("p", {
170
173
  className: "mb-2 text-xs font-medium uppercase tracking-wide text-text-tertiary",
171
174
  children: "Lifecycle progress"
172
- }), /* @__PURE__ */ p("div", {
175
+ }), /* @__PURE__ */ m("div", {
173
176
  className: "flex flex-1 items-center justify-center",
174
- children: /* @__PURE__ */ p(le, { status: L.status })
177
+ children: /* @__PURE__ */ m(ce, { status: R.status })
175
178
  })]
176
179
  }),
177
- /* @__PURE__ */ m(g, {
180
+ /* @__PURE__ */ h(_, {
178
181
  treatment: "glass",
179
182
  className: "flex flex-col gap-3 p-6",
180
183
  children: [
181
- /* @__PURE__ */ p("p", {
184
+ /* @__PURE__ */ m("p", {
182
185
  className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
183
186
  children: "Advance project"
184
187
  }),
185
- $.length === 0 ? /* @__PURE__ */ m("p", {
188
+ $.length === 0 ? /* @__PURE__ */ h("p", {
186
189
  className: "text-sm text-text-secondary",
187
190
  children: [
188
191
  "This project is ",
189
- r(L.status).toLowerCase(),
192
+ r(R.status).toLowerCase(),
190
193
  " — no further transitions."
191
194
  ]
192
- }) : $.map((e) => /* @__PURE__ */ m(h, {
195
+ }) : $.map((e) => /* @__PURE__ */ h(g, {
193
196
  variant: "outline",
194
- onClick: () => he(e),
197
+ onClick: () => ge(e),
195
198
  disabled: H.isPending,
196
199
  className: "justify-between",
197
- children: [r(e), /* @__PURE__ */ p(d, { className: "h-4 w-4 opacity-60" })]
200
+ children: [r(e), /* @__PURE__ */ m(ue, { className: "h-4 w-4 opacity-60" })]
198
201
  }, e)),
199
- /* @__PURE__ */ m(h, {
202
+ /* @__PURE__ */ h(g, {
200
203
  className: "mt-auto",
201
204
  onClick: () => W(!0),
202
- children: [/* @__PURE__ */ p(f, { className: "mr-1.5 h-4 w-4" }), " Log activity"]
205
+ children: [/* @__PURE__ */ m(p, { className: "mr-1.5 h-4 w-4" }), " Log activity"]
203
206
  })
204
207
  ]
205
208
  })
206
209
  ]
207
210
  }),
208
- q && /* @__PURE__ */ p("p", {
211
+ q && /* @__PURE__ */ m("p", {
209
212
  className: "mt-4 text-sm text-status-error-text",
210
213
  children: q
211
214
  }),
212
- /* @__PURE__ */ p(re, {
215
+ /* @__PURE__ */ m(re, {
213
216
  title: "Restoration activities",
214
217
  description: "Work logged against this project — planting, removals, surveys & engagement.",
215
- action: /* @__PURE__ */ m(h, {
218
+ action: /* @__PURE__ */ h(g, {
216
219
  size: "sm",
217
220
  onClick: () => W(!0),
218
- children: [/* @__PURE__ */ p(f, { className: "mr-1.5 h-4 w-4" }), " Log activity"]
221
+ children: [/* @__PURE__ */ m(p, { className: "mr-1.5 h-4 w-4" }), " Log activity"]
219
222
  }),
220
- children: Q.length === 0 ? /* @__PURE__ */ p(a, {
223
+ children: Q.length === 0 ? /* @__PURE__ */ m(a, {
221
224
  illustration: "empty-data",
222
- icon: /* @__PURE__ */ p(de, { className: "h-10 w-10" }),
225
+ icon: /* @__PURE__ */ m(de, { className: "h-10 w-10" }),
223
226
  title: "No activities yet",
224
227
  description: "Log restoration work to build this project's field record.",
225
- action: /* @__PURE__ */ m(h, {
228
+ action: /* @__PURE__ */ h(g, {
226
229
  size: "sm",
227
230
  onClick: () => W(!0),
228
- children: [/* @__PURE__ */ p(f, { className: "mr-1.5 h-4 w-4" }), " Log activity"]
231
+ children: [/* @__PURE__ */ m(p, { className: "mr-1.5 h-4 w-4" }), " Log activity"]
229
232
  })
230
- }) : /* @__PURE__ */ p(se, {
233
+ }) : /* @__PURE__ */ m(se, {
231
234
  columns: [
232
235
  {
233
236
  key: "type",
234
237
  header: "Type",
235
- render: (e) => /* @__PURE__ */ p(s, { type: e.type })
238
+ render: (e) => /* @__PURE__ */ m(l, { type: e.type })
236
239
  },
237
240
  {
238
241
  key: "summary",
239
242
  header: "Summary",
240
- render: (e) => /* @__PURE__ */ m("div", {
243
+ render: (e) => /* @__PURE__ */ h("div", {
241
244
  className: "min-w-0",
242
- children: [/* @__PURE__ */ p("p", {
245
+ children: [/* @__PURE__ */ m("p", {
243
246
  className: "text-text-primary",
244
247
  children: e.summary
245
- }), e.details && /* @__PURE__ */ p("p", {
248
+ }), e.details && /* @__PURE__ */ m("p", {
246
249
  className: "mt-0.5 max-w-md truncate text-xs text-text-tertiary",
247
250
  children: e.details
248
251
  })]
@@ -254,10 +257,10 @@ function I() {
254
257
  align: "right",
255
258
  hideOnMobile: !0,
256
259
  sortValue: (e) => e.quantity ?? 0,
257
- render: (e) => e.quantity == null ? /* @__PURE__ */ p("span", {
260
+ render: (e) => e.quantity == null ? /* @__PURE__ */ m("span", {
258
261
  className: "text-text-tertiary",
259
262
  children: "—"
260
- }) : /* @__PURE__ */ m("span", {
263
+ }) : /* @__PURE__ */ h("span", {
261
264
  className: "tabular-nums text-text-secondary",
262
265
  children: [i(e.quantity), e.unit ? ` ${e.unit}` : ""]
263
266
  })
@@ -268,7 +271,7 @@ function I() {
268
271
  align: "right",
269
272
  hideOnMobile: !0,
270
273
  sortValue: (e) => e.performedAt,
271
- render: (e) => /* @__PURE__ */ p("span", {
274
+ render: (e) => /* @__PURE__ */ m("span", {
272
275
  className: "text-text-tertiary",
273
276
  children: ee(e.performedAt)
274
277
  })
@@ -282,45 +285,45 @@ function I() {
282
285
  }
283
286
  })
284
287
  }),
285
- /* @__PURE__ */ p(y, {
286
- open: pe,
288
+ /* @__PURE__ */ m(b, {
289
+ open: me,
287
290
  onOpenChange: W,
288
- children: /* @__PURE__ */ m(b, { children: [
289
- /* @__PURE__ */ m(C, { children: [/* @__PURE__ */ p(w, { children: "Log restoration activity" }), /* @__PURE__ */ m(x, { children: [
291
+ children: /* @__PURE__ */ h(x, { children: [
292
+ /* @__PURE__ */ h(w, { children: [/* @__PURE__ */ m(T, { children: "Log restoration activity" }), /* @__PURE__ */ h(S, { children: [
290
293
  "Record a piece of work performed for ",
291
- L.name,
294
+ R.name,
292
295
  "."
293
296
  ] })] }),
294
- /* @__PURE__ */ m("div", {
297
+ /* @__PURE__ */ h("div", {
295
298
  className: "grid gap-4 py-2",
296
299
  children: [
297
- /* @__PURE__ */ m("div", {
300
+ /* @__PURE__ */ h("div", {
298
301
  className: "grid gap-2 sm:grid-cols-2",
299
- children: [/* @__PURE__ */ m("div", {
302
+ children: [/* @__PURE__ */ h("div", {
300
303
  className: "grid gap-1.5",
301
- children: [/* @__PURE__ */ p(v, {
304
+ children: [/* @__PURE__ */ m(y, {
302
305
  htmlFor: "actType",
303
306
  children: "Type"
304
- }), /* @__PURE__ */ m(T, {
307
+ }), /* @__PURE__ */ h(E, {
305
308
  value: G.type,
306
309
  onValueChange: (e) => K({
307
310
  ...G,
308
311
  type: e
309
312
  }),
310
- children: [/* @__PURE__ */ p(O, {
313
+ children: [/* @__PURE__ */ m(k, {
311
314
  id: "actType",
312
- children: /* @__PURE__ */ p(k, {})
313
- }), /* @__PURE__ */ p(E, { children: M.map((e) => /* @__PURE__ */ p(D, {
315
+ children: /* @__PURE__ */ m(A, {})
316
+ }), /* @__PURE__ */ m(D, { children: N.map((e) => /* @__PURE__ */ m(O, {
314
317
  value: e,
315
318
  children: r(e)
316
319
  }, e)) })]
317
320
  })]
318
- }), /* @__PURE__ */ m("div", {
321
+ }), /* @__PURE__ */ h("div", {
319
322
  className: "grid gap-1.5",
320
- children: [/* @__PURE__ */ p(v, {
323
+ children: [/* @__PURE__ */ m(y, {
321
324
  htmlFor: "actPerformedAt",
322
325
  children: "Performed at"
323
- }), /* @__PURE__ */ p(_, {
326
+ }), /* @__PURE__ */ m(v, {
324
327
  id: "actPerformedAt",
325
328
  type: "datetime-local",
326
329
  value: G.performedAt,
@@ -331,12 +334,12 @@ function I() {
331
334
  })]
332
335
  })]
333
336
  }),
334
- /* @__PURE__ */ m("div", {
337
+ /* @__PURE__ */ h("div", {
335
338
  className: "grid gap-1.5",
336
- children: [/* @__PURE__ */ p(v, {
339
+ children: [/* @__PURE__ */ m(y, {
337
340
  htmlFor: "actSummary",
338
341
  children: "Summary *"
339
- }), /* @__PURE__ */ p(_, {
342
+ }), /* @__PURE__ */ m(v, {
340
343
  id: "actSummary",
341
344
  value: G.summary,
342
345
  onChange: (e) => K({
@@ -346,12 +349,12 @@ function I() {
346
349
  placeholder: "Planted 500 mangrove saplings"
347
350
  })]
348
351
  }),
349
- /* @__PURE__ */ m("div", {
352
+ /* @__PURE__ */ h("div", {
350
353
  className: "grid gap-1.5",
351
- children: [/* @__PURE__ */ p(v, {
354
+ children: [/* @__PURE__ */ m(y, {
352
355
  htmlFor: "actDetails",
353
356
  children: "Details"
354
- }), /* @__PURE__ */ p(A, {
357
+ }), /* @__PURE__ */ m(j, {
355
358
  id: "actDetails",
356
359
  value: G.details,
357
360
  onChange: (e) => K({
@@ -362,14 +365,14 @@ function I() {
362
365
  rows: 2
363
366
  })]
364
367
  }),
365
- /* @__PURE__ */ m("div", {
368
+ /* @__PURE__ */ h("div", {
366
369
  className: "grid gap-2 sm:grid-cols-2",
367
- children: [/* @__PURE__ */ m("div", {
370
+ children: [/* @__PURE__ */ h("div", {
368
371
  className: "grid gap-1.5",
369
- children: [/* @__PURE__ */ p(v, {
372
+ children: [/* @__PURE__ */ m(y, {
370
373
  htmlFor: "actQuantity",
371
374
  children: "Quantity"
372
- }), /* @__PURE__ */ p(_, {
375
+ }), /* @__PURE__ */ m(v, {
373
376
  id: "actQuantity",
374
377
  type: "number",
375
378
  step: "any",
@@ -380,12 +383,12 @@ function I() {
380
383
  }),
381
384
  placeholder: "500"
382
385
  })]
383
- }), /* @__PURE__ */ m("div", {
386
+ }), /* @__PURE__ */ h("div", {
384
387
  className: "grid gap-1.5",
385
- children: [/* @__PURE__ */ p(v, {
388
+ children: [/* @__PURE__ */ m(y, {
386
389
  htmlFor: "actUnit",
387
390
  children: "Unit"
388
- }), /* @__PURE__ */ p(_, {
391
+ }), /* @__PURE__ */ m(v, {
389
392
  id: "actUnit",
390
393
  value: G.unit,
391
394
  onChange: (e) => K({
@@ -398,27 +401,27 @@ function I() {
398
401
  })
399
402
  ]
400
403
  }),
401
- /* @__PURE__ */ m(S, { children: [/* @__PURE__ */ p(h, {
404
+ /* @__PURE__ */ h(C, { children: [/* @__PURE__ */ m(g, {
402
405
  variant: "outline",
403
406
  onClick: () => W(!1),
404
407
  children: "Cancel"
405
- }), /* @__PURE__ */ p(h, {
408
+ }), /* @__PURE__ */ m(g, {
406
409
  onClick: async () => {
407
- if (!N || !G.summary.trim()) {
410
+ if (!P || !G.summary.trim()) {
408
411
  J("Activity summary is required.");
409
412
  return;
410
413
  }
411
414
  J(null);
412
415
  try {
413
416
  await U.mutateAsync({
414
- projectId: N,
417
+ projectId: P,
415
418
  type: G.type,
416
419
  summary: G.summary.trim(),
417
420
  details: G.details.trim() || null,
418
421
  quantity: G.quantity ? Number(G.quantity) : null,
419
422
  unit: G.unit.trim() || null,
420
423
  performedAt: G.performedAt ? new Date(G.performedAt).toISOString() : (/* @__PURE__ */ new Date()).toISOString()
421
- }), W(!1), K(P());
424
+ }), W(!1), K(F());
422
425
  } catch (e) {
423
426
  J(e instanceof Error ? e.message : "Failed to log activity.");
424
427
  }
@@ -432,6 +435,6 @@ function I() {
432
435
  });
433
436
  }
434
437
  //#endregion
435
- export { I as HabitatProjectDetailPage };
438
+ export { L as HabitatProjectDetailPage };
436
439
 
437
440
  //# sourceMappingURL=HabitatProjectDetailPage.js.map