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