@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.
- package/dist/ecoimpacthub/hooks/index.d.ts +2 -0
- package/dist/ecoimpacthub/hooks/index.d.ts.map +1 -1
- package/dist/ecoimpacthub/hooks/index.js +2 -0
- package/dist/ecoimpacthub/hooks/useActiveEcoEntity.d.ts +11 -0
- package/dist/ecoimpacthub/hooks/useActiveEcoEntity.d.ts.map +1 -0
- package/dist/ecoimpacthub/hooks/useActiveEcoEntity.js +21 -0
- package/dist/ecoimpacthub/hooks/useActiveEcoEntity.js.map +1 -0
- package/dist/ecoimpacthub/hooks/useTr.d.ts +4 -0
- package/dist/ecoimpacthub/hooks/useTr.d.ts.map +1 -0
- package/dist/ecoimpacthub/hooks/useTr.js +20 -0
- package/dist/ecoimpacthub/hooks/useTr.js.map +1 -0
- package/dist/ecoimpacthub/pages/DashboardPage.d.ts.map +1 -1
- package/dist/ecoimpacthub/pages/DashboardPage.js +162 -138
- package/dist/ecoimpacthub/pages/DashboardPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/_shared/MethodPicker.d.ts +15 -0
- package/dist/ecoimpacthub/pages/_shared/MethodPicker.d.ts.map +1 -0
- package/dist/ecoimpacthub/pages/_shared/MethodPicker.js +36 -0
- package/dist/ecoimpacthub/pages/_shared/MethodPicker.js.map +1 -0
- package/dist/ecoimpacthub/pages/_shared/UseMyLocationButton.d.ts +15 -0
- package/dist/ecoimpacthub/pages/_shared/UseMyLocationButton.d.ts.map +1 -0
- package/dist/ecoimpacthub/pages/_shared/UseMyLocationButton.js +66 -0
- package/dist/ecoimpacthub/pages/_shared/UseMyLocationButton.js.map +1 -0
- package/dist/ecoimpacthub/pages/habitat/HabitatProjectDetailPage.d.ts.map +1 -1
- package/dist/ecoimpacthub/pages/habitat/HabitatProjectDetailPage.js +127 -124
- package/dist/ecoimpacthub/pages/habitat/HabitatProjectDetailPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/observations/ObservationsPage.d.ts.map +1 -1
- package/dist/ecoimpacthub/pages/observations/ObservationsPage.js +226 -224
- package/dist/ecoimpacthub/pages/observations/ObservationsPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/reports/ReportDetailPage.d.ts.map +1 -1
- package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js +159 -156
- package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/sites/SiteDetailPage.d.ts.map +1 -1
- package/dist/ecoimpacthub/pages/sites/SiteDetailPage.js +40 -37
- package/dist/ecoimpacthub/pages/sites/SiteDetailPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/sites/SitesPage.d.ts.map +1 -1
- package/dist/ecoimpacthub/pages/sites/SitesPage.js +208 -171
- package/dist/ecoimpacthub/pages/sites/SitesPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.d.ts.map +1 -1
- package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.js +211 -214
- package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/species/SpeciesPage.d.ts.map +1 -1
- package/dist/ecoimpacthub/pages/species/SpeciesPage.js +174 -157
- package/dist/ecoimpacthub/pages/species/SpeciesPage.js.map +1 -1
- package/dist/ecoimpacthub/utils/activeEntity.d.ts +30 -0
- package/dist/ecoimpacthub/utils/activeEntity.d.ts.map +1 -0
- package/dist/ecoimpacthub/utils/activeEntity.js +12 -0
- package/dist/ecoimpacthub/utils/activeEntity.js.map +1 -0
- package/dist/ecoimpacthub/utils/pageContext.d.ts.map +1 -1
- package/dist/ecoimpacthub/utils/pageContext.js +30 -25
- package/dist/ecoimpacthub/utils/pageContext.js.map +1 -1
- 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
|
|
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
|
|
11
|
-
import { ActivityTypeBadge as
|
|
12
|
-
import { LifecycleProgress as
|
|
13
|
-
import { useMemo as
|
|
14
|
-
import { ArrowLeft as
|
|
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
|
|
17
|
-
import { Button as
|
|
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
|
|
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
|
-
},
|
|
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
|
-
],
|
|
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
|
-
},
|
|
47
|
+
}, F = () => ({
|
|
47
48
|
type: "PLANTING",
|
|
48
49
|
summary: "",
|
|
49
50
|
details: "",
|
|
50
51
|
quantity: "",
|
|
51
52
|
unit: "",
|
|
52
|
-
performedAt:
|
|
53
|
+
performedAt: P()
|
|
53
54
|
});
|
|
54
|
-
function
|
|
55
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
59
|
+
}), /* @__PURE__ */ m("dd", {
|
|
59
60
|
className: "mt-1 text-sm text-text-primary",
|
|
60
61
|
children: t
|
|
61
62
|
})] });
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
-
let { id:
|
|
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 =
|
|
68
|
-
if (
|
|
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__ */
|
|
73
|
+
children: /* @__PURE__ */ m(ne, {})
|
|
71
74
|
});
|
|
72
|
-
if (
|
|
75
|
+
if (B || !R) return /* @__PURE__ */ m(t, {
|
|
73
76
|
title: "Habitat project",
|
|
74
|
-
children: /* @__PURE__ */
|
|
77
|
+
children: /* @__PURE__ */ m(te, {
|
|
75
78
|
message: "This project could not be loaded.",
|
|
76
|
-
onRetry: () =>
|
|
79
|
+
onRetry: () => V()
|
|
77
80
|
})
|
|
78
81
|
});
|
|
79
|
-
let Q =
|
|
80
|
-
if (
|
|
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:
|
|
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__ */
|
|
93
|
-
title: /* @__PURE__ */
|
|
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__ */
|
|
98
|
+
children: [/* @__PURE__ */ m("span", {
|
|
96
99
|
className: "text-text-primary",
|
|
97
|
-
children:
|
|
98
|
-
}), /* @__PURE__ */
|
|
100
|
+
children: R.name
|
|
101
|
+
}), /* @__PURE__ */ m(u, { status: R.status })]
|
|
99
102
|
}),
|
|
100
|
-
description:
|
|
101
|
-
actions: /* @__PURE__ */
|
|
103
|
+
description: he || void 0,
|
|
104
|
+
actions: /* @__PURE__ */ h(g, {
|
|
102
105
|
variant: "ghost",
|
|
103
|
-
onClick: () =>
|
|
104
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
110
|
+
/* @__PURE__ */ h("div", {
|
|
108
111
|
className: "grid grid-cols-1 gap-4 lg:grid-cols-4",
|
|
109
112
|
children: [
|
|
110
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ h(_, {
|
|
111
114
|
treatment: "glass",
|
|
112
115
|
className: "p-6 lg:col-span-2",
|
|
113
116
|
children: [
|
|
114
|
-
/* @__PURE__ */
|
|
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__ */
|
|
120
|
+
/* @__PURE__ */ m(I, {
|
|
118
121
|
label: "Status",
|
|
119
|
-
children: /* @__PURE__ */
|
|
122
|
+
children: /* @__PURE__ */ m(u, { status: R.status })
|
|
120
123
|
}),
|
|
121
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ m(I, {
|
|
122
125
|
label: "Target area",
|
|
123
|
-
children: /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ m("span", {
|
|
124
127
|
className: "tabular-nums",
|
|
125
|
-
children:
|
|
128
|
+
children: R.targetHectares == null ? "—" : `${i(R.targetHectares)} ha`
|
|
126
129
|
})
|
|
127
130
|
}),
|
|
128
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ m(I, {
|
|
129
132
|
label: "Budget",
|
|
130
|
-
children: /* @__PURE__ */
|
|
133
|
+
children: /* @__PURE__ */ m("span", {
|
|
131
134
|
className: "tabular-nums",
|
|
132
|
-
children:
|
|
135
|
+
children: R.budgetAmount > 0 ? `${i(R.budgetAmount)} ${R.currency}` : "—"
|
|
133
136
|
})
|
|
134
137
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ m(I, {
|
|
136
139
|
label: "Start",
|
|
137
|
-
children: n(
|
|
140
|
+
children: n(R.startDate)
|
|
138
141
|
}),
|
|
139
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ m(I, {
|
|
140
143
|
label: "End",
|
|
141
|
-
children: n(
|
|
144
|
+
children: n(R.endDate)
|
|
142
145
|
}),
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
-
label:
|
|
145
|
-
children:
|
|
146
|
+
/* @__PURE__ */ m(I, {
|
|
147
|
+
label: R.completedAt ? "Completed" : "Site",
|
|
148
|
+
children: R.completedAt ? n(R.completedAt) : Z ?? "—"
|
|
146
149
|
}),
|
|
147
|
-
|
|
150
|
+
R.completedAt && /* @__PURE__ */ m(I, {
|
|
148
151
|
label: "Site",
|
|
149
152
|
children: Z ?? "—"
|
|
150
153
|
})
|
|
151
154
|
]
|
|
152
155
|
}),
|
|
153
|
-
|
|
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:
|
|
158
|
+
children: R.description
|
|
156
159
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ m("div", {
|
|
158
161
|
className: "mt-5 border-t border-border-seam pt-4",
|
|
159
|
-
children: /* @__PURE__ */
|
|
162
|
+
children: /* @__PURE__ */ m(c, {
|
|
160
163
|
entityType: "ecoimpacthub-habitat",
|
|
161
|
-
entityId:
|
|
164
|
+
entityId: R.id
|
|
162
165
|
})
|
|
163
166
|
})
|
|
164
167
|
]
|
|
165
168
|
}),
|
|
166
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ h(_, {
|
|
167
170
|
treatment: "glass",
|
|
168
171
|
className: "flex flex-col p-6",
|
|
169
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
175
|
+
}), /* @__PURE__ */ m("div", {
|
|
173
176
|
className: "flex flex-1 items-center justify-center",
|
|
174
|
-
children: /* @__PURE__ */
|
|
177
|
+
children: /* @__PURE__ */ m(ce, { status: R.status })
|
|
175
178
|
})]
|
|
176
179
|
}),
|
|
177
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ h(_, {
|
|
178
181
|
treatment: "glass",
|
|
179
182
|
className: "flex flex-col gap-3 p-6",
|
|
180
183
|
children: [
|
|
181
|
-
/* @__PURE__ */
|
|
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__ */
|
|
188
|
+
$.length === 0 ? /* @__PURE__ */ h("p", {
|
|
186
189
|
className: "text-sm text-text-secondary",
|
|
187
190
|
children: [
|
|
188
191
|
"This project is ",
|
|
189
|
-
r(
|
|
192
|
+
r(R.status).toLowerCase(),
|
|
190
193
|
" — no further transitions."
|
|
191
194
|
]
|
|
192
|
-
}) : $.map((e) => /* @__PURE__ */
|
|
195
|
+
}) : $.map((e) => /* @__PURE__ */ h(g, {
|
|
193
196
|
variant: "outline",
|
|
194
|
-
onClick: () =>
|
|
197
|
+
onClick: () => ge(e),
|
|
195
198
|
disabled: H.isPending,
|
|
196
199
|
className: "justify-between",
|
|
197
|
-
children: [r(e), /* @__PURE__ */
|
|
200
|
+
children: [r(e), /* @__PURE__ */ m(ue, { className: "h-4 w-4 opacity-60" })]
|
|
198
201
|
}, e)),
|
|
199
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ h(g, {
|
|
200
203
|
className: "mt-auto",
|
|
201
204
|
onClick: () => W(!0),
|
|
202
|
-
children: [/* @__PURE__ */ p
|
|
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__ */
|
|
211
|
+
q && /* @__PURE__ */ m("p", {
|
|
209
212
|
className: "mt-4 text-sm text-status-error-text",
|
|
210
213
|
children: q
|
|
211
214
|
}),
|
|
212
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ m(re, {
|
|
213
216
|
title: "Restoration activities",
|
|
214
217
|
description: "Work logged against this project — planting, removals, surveys & engagement.",
|
|
215
|
-
action: /* @__PURE__ */
|
|
218
|
+
action: /* @__PURE__ */ h(g, {
|
|
216
219
|
size: "sm",
|
|
217
220
|
onClick: () => W(!0),
|
|
218
|
-
children: [/* @__PURE__ */ p
|
|
221
|
+
children: [/* @__PURE__ */ m(p, { className: "mr-1.5 h-4 w-4" }), " Log activity"]
|
|
219
222
|
}),
|
|
220
|
-
children: Q.length === 0 ? /* @__PURE__ */
|
|
223
|
+
children: Q.length === 0 ? /* @__PURE__ */ m(a, {
|
|
221
224
|
illustration: "empty-data",
|
|
222
|
-
icon: /* @__PURE__ */
|
|
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__ */
|
|
228
|
+
action: /* @__PURE__ */ h(g, {
|
|
226
229
|
size: "sm",
|
|
227
230
|
onClick: () => W(!0),
|
|
228
|
-
children: [/* @__PURE__ */ p
|
|
231
|
+
children: [/* @__PURE__ */ m(p, { className: "mr-1.5 h-4 w-4" }), " Log activity"]
|
|
229
232
|
})
|
|
230
|
-
}) : /* @__PURE__ */
|
|
233
|
+
}) : /* @__PURE__ */ m(se, {
|
|
231
234
|
columns: [
|
|
232
235
|
{
|
|
233
236
|
key: "type",
|
|
234
237
|
header: "Type",
|
|
235
|
-
render: (e) => /* @__PURE__ */
|
|
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__ */
|
|
243
|
+
render: (e) => /* @__PURE__ */ h("div", {
|
|
241
244
|
className: "min-w-0",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
245
|
+
children: [/* @__PURE__ */ m("p", {
|
|
243
246
|
className: "text-text-primary",
|
|
244
247
|
children: e.summary
|
|
245
|
-
}), e.details && /* @__PURE__ */
|
|
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__ */
|
|
260
|
+
render: (e) => e.quantity == null ? /* @__PURE__ */ m("span", {
|
|
258
261
|
className: "text-text-tertiary",
|
|
259
262
|
children: "—"
|
|
260
|
-
}) : /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
286
|
-
open:
|
|
288
|
+
/* @__PURE__ */ m(b, {
|
|
289
|
+
open: me,
|
|
287
290
|
onOpenChange: W,
|
|
288
|
-
children: /* @__PURE__ */
|
|
289
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
294
|
+
R.name,
|
|
292
295
|
"."
|
|
293
296
|
] })] }),
|
|
294
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ h("div", {
|
|
295
298
|
className: "grid gap-4 py-2",
|
|
296
299
|
children: [
|
|
297
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ h("div", {
|
|
298
301
|
className: "grid gap-2 sm:grid-cols-2",
|
|
299
|
-
children: [/* @__PURE__ */
|
|
302
|
+
children: [/* @__PURE__ */ h("div", {
|
|
300
303
|
className: "grid gap-1.5",
|
|
301
|
-
children: [/* @__PURE__ */
|
|
304
|
+
children: [/* @__PURE__ */ m(y, {
|
|
302
305
|
htmlFor: "actType",
|
|
303
306
|
children: "Type"
|
|
304
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
313
|
+
children: [/* @__PURE__ */ m(k, {
|
|
311
314
|
id: "actType",
|
|
312
|
-
children: /* @__PURE__ */
|
|
313
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
321
|
+
}), /* @__PURE__ */ h("div", {
|
|
319
322
|
className: "grid gap-1.5",
|
|
320
|
-
children: [/* @__PURE__ */
|
|
323
|
+
children: [/* @__PURE__ */ m(y, {
|
|
321
324
|
htmlFor: "actPerformedAt",
|
|
322
325
|
children: "Performed at"
|
|
323
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
337
|
+
/* @__PURE__ */ h("div", {
|
|
335
338
|
className: "grid gap-1.5",
|
|
336
|
-
children: [/* @__PURE__ */
|
|
339
|
+
children: [/* @__PURE__ */ m(y, {
|
|
337
340
|
htmlFor: "actSummary",
|
|
338
341
|
children: "Summary *"
|
|
339
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
352
|
+
/* @__PURE__ */ h("div", {
|
|
350
353
|
className: "grid gap-1.5",
|
|
351
|
-
children: [/* @__PURE__ */
|
|
354
|
+
children: [/* @__PURE__ */ m(y, {
|
|
352
355
|
htmlFor: "actDetails",
|
|
353
356
|
children: "Details"
|
|
354
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
368
|
+
/* @__PURE__ */ h("div", {
|
|
366
369
|
className: "grid gap-2 sm:grid-cols-2",
|
|
367
|
-
children: [/* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ h("div", {
|
|
368
371
|
className: "grid gap-1.5",
|
|
369
|
-
children: [/* @__PURE__ */
|
|
372
|
+
children: [/* @__PURE__ */ m(y, {
|
|
370
373
|
htmlFor: "actQuantity",
|
|
371
374
|
children: "Quantity"
|
|
372
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
386
|
+
}), /* @__PURE__ */ h("div", {
|
|
384
387
|
className: "grid gap-1.5",
|
|
385
|
-
children: [/* @__PURE__ */
|
|
388
|
+
children: [/* @__PURE__ */ m(y, {
|
|
386
389
|
htmlFor: "actUnit",
|
|
387
390
|
children: "Unit"
|
|
388
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
404
|
+
/* @__PURE__ */ h(C, { children: [/* @__PURE__ */ m(g, {
|
|
402
405
|
variant: "outline",
|
|
403
406
|
onClick: () => W(!1),
|
|
404
407
|
children: "Cancel"
|
|
405
|
-
}), /* @__PURE__ */
|
|
408
|
+
}), /* @__PURE__ */ m(g, {
|
|
406
409
|
onClick: async () => {
|
|
407
|
-
if (!
|
|
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:
|
|
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(
|
|
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 {
|
|
438
|
+
export { L as HabitatProjectDetailPage };
|
|
436
439
|
|
|
437
440
|
//# sourceMappingURL=HabitatProjectDetailPage.js.map
|