@burdenoff/microfe-ecoimpacthub 2026.704.4 → 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 +337 -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,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { useCursorPager as c } from "../../hooks/useCursorPager.js";
|
|
1
|
+
import { PageLayout as e } from "../../components/PageLayout.js";
|
|
2
|
+
import { formatCoords as t, formatDateTime as n, formatEnumLabel as r, formatNumber as i } from "../../utils/formatters.js";
|
|
3
|
+
import { ErrorView as a, LoadingView as o } from "../../components/StateViews.js";
|
|
4
|
+
import { EmptyState as s } from "../../components/EmptyState.js";
|
|
5
|
+
import { useEcoObservations as ee, useEcoRecordObservation as te, useEcoSites as ne, useEcoSpecies as re } from "../../hooks/useEcoImpactHubApi.js";
|
|
6
|
+
import { useCursorPager as ie } from "../../hooks/useCursorPager.js";
|
|
8
7
|
import "../../hooks/index.js";
|
|
9
8
|
import { DataTable as ae } from "../../components/DataTable.js";
|
|
10
|
-
import { Pagination as
|
|
11
|
-
import { EvidenceUpload as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
9
|
+
import { Pagination as oe } from "../../components/Pagination.js";
|
|
10
|
+
import { EvidenceUpload as se } from "../../components/EvidenceUpload.js";
|
|
11
|
+
import { MethodBadge as c } from "../_shared/MethodBadge.js";
|
|
12
|
+
import { EvidenceThumb as l } from "../_shared/EvidenceThumb.js";
|
|
13
|
+
import { useMemo as u, useState as d } from "react";
|
|
14
|
+
import { Binoculars as f, MapPin as p, Plus as m } from "lucide-react";
|
|
15
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
16
|
+
import { Button as v, GlassCard as ce, Input as y, Label as b, ResponsiveDialog as le, ResponsiveDialogContent as ue, ResponsiveDialogDescription as de, ResponsiveDialogFooter as fe, ResponsiveDialogHeader as pe, ResponsiveDialogTitle as me, Select as x, SelectContent as S, SelectItem as C, SelectTrigger as w, SelectValue as T, Textarea as E } from "@burdenoff/fe-libs/ui";
|
|
17
17
|
//#region src/ecoimpacthub/pages/observations/ObservationsPage.tsx
|
|
18
|
-
var
|
|
18
|
+
var D = [
|
|
19
19
|
"DIRECT_SIGHTING",
|
|
20
20
|
"CAMERA_TRAP",
|
|
21
21
|
"ACOUSTIC",
|
|
@@ -23,53 +23,61 @@ var ue = [
|
|
|
23
23
|
"EDNA",
|
|
24
24
|
"TELEMETRY",
|
|
25
25
|
"COMMUNITY_REPORT"
|
|
26
|
-
],
|
|
26
|
+
], O = 25, k = {
|
|
27
27
|
limit: 100,
|
|
28
28
|
offset: 0
|
|
29
|
-
},
|
|
30
|
-
function
|
|
29
|
+
}, A = "NONE";
|
|
30
|
+
function j() {
|
|
31
31
|
let e = /* @__PURE__ */ new Date();
|
|
32
32
|
return (/* @__PURE__ */ new Date(e.getTime() - e.getTimezoneOffset() * 6e4)).toISOString().slice(0, 16);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function M() {
|
|
35
35
|
return {
|
|
36
36
|
speciesId: "",
|
|
37
|
-
observedAt:
|
|
37
|
+
observedAt: j(),
|
|
38
38
|
count: "1",
|
|
39
39
|
method: "DIRECT_SIGHTING",
|
|
40
|
-
siteId:
|
|
40
|
+
siteId: A,
|
|
41
41
|
latitude: "",
|
|
42
42
|
longitude: "",
|
|
43
43
|
notes: "",
|
|
44
44
|
evidence: null
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
let [
|
|
49
|
-
speciesId:
|
|
50
|
-
siteId:
|
|
47
|
+
function N() {
|
|
48
|
+
let [j, N] = d("ALL"), [P, F] = d("ALL"), I = ie(), [L, R] = d(!1), [z, B] = d(M), [V, H] = d(null), U = ne({ pagination: k }), W = re({ pagination: k }), { data: G, isLoading: he, isError: ge, refetch: _e } = ee({
|
|
49
|
+
speciesId: j === "ALL" ? void 0 : j,
|
|
50
|
+
siteId: P === "ALL" ? void 0 : P,
|
|
51
51
|
pagination: {
|
|
52
|
-
limit:
|
|
53
|
-
cursor:
|
|
52
|
+
limit: O,
|
|
53
|
+
cursor: I.cursor
|
|
54
54
|
}
|
|
55
|
-
}),
|
|
55
|
+
}), K = te(), q = u(() => U.data?.items ?? [], [U.data]), J = u(() => W.data?.items ?? [], [W.data]), Y = u(() => G?.items ?? [], [G]), ve = u(() => {
|
|
56
56
|
let e = /* @__PURE__ */ new Map();
|
|
57
|
-
for (let t of
|
|
57
|
+
for (let t of q) e.set(t.id, t.name);
|
|
58
58
|
return e;
|
|
59
|
-
}, [
|
|
59
|
+
}, [q]), X = u(() => {
|
|
60
60
|
let e = /* @__PURE__ */ new Map();
|
|
61
|
-
for (let t of
|
|
61
|
+
for (let t of J) e.set(t.id, t.commonName);
|
|
62
62
|
return e;
|
|
63
|
-
}, [
|
|
63
|
+
}, [J]), Z = [
|
|
64
|
+
{
|
|
65
|
+
key: "evidence",
|
|
66
|
+
header: "Evidence",
|
|
67
|
+
render: (e) => /* @__PURE__ */ g(l, {
|
|
68
|
+
fileId: e.evidence?.id,
|
|
69
|
+
alt: e.species?.commonName ?? X.get(e.speciesId)
|
|
70
|
+
})
|
|
71
|
+
},
|
|
64
72
|
{
|
|
65
73
|
key: "species",
|
|
66
74
|
header: "Species",
|
|
67
|
-
render: (e) => /* @__PURE__ */
|
|
75
|
+
render: (e) => /* @__PURE__ */ _("div", {
|
|
68
76
|
className: "min-w-0",
|
|
69
|
-
children: [/* @__PURE__ */
|
|
77
|
+
children: [/* @__PURE__ */ g("p", {
|
|
70
78
|
className: "font-semibold text-text-primary",
|
|
71
|
-
children: e.species?.commonName ??
|
|
72
|
-
}), e.species?.scientificName && /* @__PURE__ */
|
|
79
|
+
children: e.species?.commonName ?? X.get(e.speciesId) ?? "Unknown species"
|
|
80
|
+
}), e.species?.scientificName && /* @__PURE__ */ g("p", {
|
|
73
81
|
className: "truncate text-xs italic text-text-tertiary",
|
|
74
82
|
children: e.species.scientificName
|
|
75
83
|
})]
|
|
@@ -78,29 +86,25 @@ function F() {
|
|
|
78
86
|
{
|
|
79
87
|
key: "method",
|
|
80
88
|
header: "Method",
|
|
81
|
-
render: (e) => /* @__PURE__ */
|
|
82
|
-
className: "inline-flex rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary",
|
|
83
|
-
children: i(e.method)
|
|
84
|
-
})
|
|
89
|
+
render: (e) => /* @__PURE__ */ g(c, { method: e.method })
|
|
85
90
|
},
|
|
86
91
|
{
|
|
87
92
|
key: "count",
|
|
88
93
|
header: "Count",
|
|
89
94
|
align: "right",
|
|
90
95
|
sortValue: (e) => e.count,
|
|
91
|
-
render: (e) => /* @__PURE__ */
|
|
92
|
-
className: "tabular-nums text-text-
|
|
93
|
-
children: ["×",
|
|
96
|
+
render: (e) => /* @__PURE__ */ _("span", {
|
|
97
|
+
className: "tabular-nums font-medium text-text-primary",
|
|
98
|
+
children: ["×", i(e.count)]
|
|
94
99
|
})
|
|
95
100
|
},
|
|
96
101
|
{
|
|
97
102
|
key: "observedAt",
|
|
98
103
|
header: "Observed",
|
|
99
|
-
align: "right",
|
|
100
104
|
hideOnMobile: !0,
|
|
101
|
-
render: (e) => /* @__PURE__ */
|
|
105
|
+
render: (e) => /* @__PURE__ */ g("span", {
|
|
102
106
|
className: "whitespace-nowrap text-text-secondary",
|
|
103
|
-
children:
|
|
107
|
+
children: n(e.observedAt)
|
|
104
108
|
})
|
|
105
109
|
},
|
|
106
110
|
{
|
|
@@ -108,11 +112,11 @@ function F() {
|
|
|
108
112
|
header: "Site",
|
|
109
113
|
hideOnMobile: !0,
|
|
110
114
|
render: (e) => {
|
|
111
|
-
let t = e.siteId ?
|
|
112
|
-
return t ? /* @__PURE__ */
|
|
115
|
+
let t = e.siteId ? ve.get(e.siteId) : void 0;
|
|
116
|
+
return t ? /* @__PURE__ */ g("span", {
|
|
113
117
|
className: "text-text-secondary",
|
|
114
118
|
children: t
|
|
115
|
-
}) : /* @__PURE__ */
|
|
119
|
+
}) : /* @__PURE__ */ g("span", {
|
|
116
120
|
className: "text-text-tertiary",
|
|
117
121
|
children: "—"
|
|
118
122
|
});
|
|
@@ -120,13 +124,19 @@ function F() {
|
|
|
120
124
|
},
|
|
121
125
|
{
|
|
122
126
|
key: "coords",
|
|
123
|
-
header: "
|
|
127
|
+
header: "Coords",
|
|
124
128
|
hideOnMobile: !0,
|
|
125
|
-
render: (
|
|
126
|
-
let
|
|
127
|
-
return /* @__PURE__ */
|
|
128
|
-
className:
|
|
129
|
-
children:
|
|
129
|
+
render: (e) => {
|
|
130
|
+
let n = t(e.latitude, e.longitude);
|
|
131
|
+
return n === "—" ? /* @__PURE__ */ g("span", {
|
|
132
|
+
className: "text-text-tertiary",
|
|
133
|
+
children: "—"
|
|
134
|
+
}) : /* @__PURE__ */ _("span", {
|
|
135
|
+
className: "inline-flex items-center gap-1 tabular-nums text-text-secondary",
|
|
136
|
+
children: [/* @__PURE__ */ g(p, {
|
|
137
|
+
className: "h-3.5 w-3.5 shrink-0 text-text-tertiary",
|
|
138
|
+
"aria-hidden": "true"
|
|
139
|
+
}), n]
|
|
130
140
|
});
|
|
131
141
|
}
|
|
132
142
|
},
|
|
@@ -134,307 +144,314 @@ function F() {
|
|
|
134
144
|
key: "notes",
|
|
135
145
|
header: "Notes",
|
|
136
146
|
hideOnMobile: !0,
|
|
137
|
-
render: (e) => e.notes ? /* @__PURE__ */
|
|
147
|
+
render: (e) => e.notes ? /* @__PURE__ */ g("span", {
|
|
138
148
|
className: "block max-w-xs truncate text-text-secondary",
|
|
139
149
|
title: e.notes,
|
|
140
150
|
children: e.notes
|
|
141
|
-
}) : /* @__PURE__ */
|
|
142
|
-
className: "text-text-tertiary",
|
|
143
|
-
children: "—"
|
|
144
|
-
})
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
key: "evidence",
|
|
148
|
-
header: "Evidence",
|
|
149
|
-
hideOnMobile: !0,
|
|
150
|
-
render: (e) => e.evidence?.id ? /* @__PURE__ */ _(d, { fileId: e.evidence.id }) : /* @__PURE__ */ _("span", {
|
|
151
|
+
}) : /* @__PURE__ */ g("span", {
|
|
151
152
|
className: "text-text-tertiary",
|
|
152
153
|
children: "—"
|
|
153
154
|
})
|
|
154
155
|
}
|
|
155
156
|
], Q = () => {
|
|
156
|
-
|
|
157
|
+
B(M()), H(null), R(!0);
|
|
157
158
|
}, $ = () => {
|
|
158
|
-
|
|
159
|
-
},
|
|
160
|
-
if (!
|
|
161
|
-
|
|
159
|
+
B(M()), H(null);
|
|
160
|
+
}, ye = async () => {
|
|
161
|
+
if (!z.speciesId) {
|
|
162
|
+
H("Species is required.");
|
|
162
163
|
return;
|
|
163
164
|
}
|
|
164
165
|
try {
|
|
165
|
-
await
|
|
166
|
-
speciesId:
|
|
167
|
-
observedAt:
|
|
168
|
-
count:
|
|
169
|
-
method:
|
|
170
|
-
siteId:
|
|
171
|
-
latitude:
|
|
172
|
-
longitude:
|
|
173
|
-
notes:
|
|
174
|
-
evidenceFileId:
|
|
175
|
-
}),
|
|
166
|
+
await K.mutateAsync({
|
|
167
|
+
speciesId: z.speciesId,
|
|
168
|
+
observedAt: z.observedAt ? new Date(z.observedAt).toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
|
|
169
|
+
count: z.count ? Number(z.count) : 1,
|
|
170
|
+
method: z.method,
|
|
171
|
+
siteId: z.siteId && z.siteId !== A ? z.siteId : null,
|
|
172
|
+
latitude: z.latitude ? Number(z.latitude) : null,
|
|
173
|
+
longitude: z.longitude ? Number(z.longitude) : null,
|
|
174
|
+
notes: z.notes.trim() || null,
|
|
175
|
+
evidenceFileId: z.evidence?.fileId ?? null
|
|
176
|
+
}), R(!1), $();
|
|
176
177
|
} catch (e) {
|
|
177
|
-
|
|
178
|
+
H(e instanceof Error ? e.message : "Failed to record observation.");
|
|
178
179
|
}
|
|
179
|
-
},
|
|
180
|
-
return /* @__PURE__ */
|
|
180
|
+
}, be = j !== "ALL" || P !== "ALL";
|
|
181
|
+
return /* @__PURE__ */ _(e, {
|
|
181
182
|
title: "Field Observations",
|
|
182
183
|
description: "Wildlife & biodiversity sightings across every species and site — your citizen-science field log.",
|
|
183
|
-
actions: /* @__PURE__ */ v
|
|
184
|
+
actions: /* @__PURE__ */ _(v, {
|
|
184
185
|
onClick: Q,
|
|
185
|
-
children: [/* @__PURE__ */
|
|
186
|
+
children: [/* @__PURE__ */ g(m, { className: "mr-1.5 h-4 w-4" }), " Record observation"]
|
|
186
187
|
}),
|
|
187
188
|
children: [
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
189
|
+
/* @__PURE__ */ g(ce, {
|
|
190
|
+
treatment: "plain",
|
|
191
|
+
className: "mb-5 p-4",
|
|
192
|
+
children: /* @__PURE__ */ _("div", {
|
|
193
|
+
className: "flex flex-col gap-3 sm:flex-row sm:flex-wrap sm:items-end",
|
|
194
|
+
children: [/* @__PURE__ */ _("div", {
|
|
195
|
+
className: "grid gap-1.5",
|
|
196
|
+
children: [/* @__PURE__ */ g("span", {
|
|
197
|
+
className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
|
|
198
|
+
children: "Species"
|
|
199
|
+
}), /* @__PURE__ */ _(x, {
|
|
200
|
+
value: j,
|
|
201
|
+
onValueChange: (e) => {
|
|
202
|
+
N(e), I.reset();
|
|
203
|
+
},
|
|
204
|
+
children: [/* @__PURE__ */ g(w, {
|
|
205
|
+
className: "w-full sm:w-52",
|
|
206
|
+
children: /* @__PURE__ */ g(T, { placeholder: "All species" })
|
|
207
|
+
}), /* @__PURE__ */ _(S, { children: [/* @__PURE__ */ g(C, {
|
|
208
|
+
value: "ALL",
|
|
209
|
+
children: "All species"
|
|
210
|
+
}), J.map((e) => /* @__PURE__ */ g(C, {
|
|
211
|
+
value: e.id,
|
|
212
|
+
children: e.commonName
|
|
213
|
+
}, e.id))] })]
|
|
214
|
+
})]
|
|
215
|
+
}), /* @__PURE__ */ _("div", {
|
|
216
|
+
className: "grid gap-1.5",
|
|
217
|
+
children: [/* @__PURE__ */ g("span", {
|
|
218
|
+
className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
|
|
219
|
+
children: "Site"
|
|
220
|
+
}), /* @__PURE__ */ _(x, {
|
|
221
|
+
value: P,
|
|
222
|
+
onValueChange: (e) => {
|
|
223
|
+
F(e), I.reset();
|
|
224
|
+
},
|
|
225
|
+
children: [/* @__PURE__ */ g(w, {
|
|
226
|
+
className: "w-full sm:w-52",
|
|
227
|
+
children: /* @__PURE__ */ g(T, { placeholder: "All sites" })
|
|
228
|
+
}), /* @__PURE__ */ _(S, { children: [/* @__PURE__ */ g(C, {
|
|
229
|
+
value: "ALL",
|
|
230
|
+
children: "All sites"
|
|
231
|
+
}), q.map((e) => /* @__PURE__ */ g(C, {
|
|
232
|
+
value: e.id,
|
|
233
|
+
children: e.name
|
|
234
|
+
}, e.id))] })]
|
|
235
|
+
})]
|
|
236
|
+
})]
|
|
237
|
+
})
|
|
221
238
|
}),
|
|
222
|
-
|
|
239
|
+
he ? /* @__PURE__ */ g(o, { label: "Loading observations…" }) : ge ? /* @__PURE__ */ g(a, {
|
|
223
240
|
message: "Couldn't load observations.",
|
|
224
|
-
onRetry: () =>
|
|
225
|
-
}) :
|
|
241
|
+
onRetry: () => _e()
|
|
242
|
+
}) : Y.length === 0 ? /* @__PURE__ */ g(s, {
|
|
226
243
|
illustration: "empty-data",
|
|
227
|
-
icon: /* @__PURE__ */
|
|
244
|
+
icon: /* @__PURE__ */ g(f, { className: "h-10 w-10" }),
|
|
228
245
|
title: "No observations yet",
|
|
229
|
-
description:
|
|
230
|
-
action: /* @__PURE__ */ v
|
|
246
|
+
description: be ? "No observations match these filters." : "Record your first field observation to start building your biodiversity dataset.",
|
|
247
|
+
action: /* @__PURE__ */ _(v, {
|
|
231
248
|
onClick: Q,
|
|
232
|
-
children: [/* @__PURE__ */
|
|
249
|
+
children: [/* @__PURE__ */ g(m, { className: "mr-1.5 h-4 w-4" }), " Record observation"]
|
|
233
250
|
})
|
|
234
|
-
}) : /* @__PURE__ */
|
|
235
|
-
columns:
|
|
236
|
-
rows:
|
|
251
|
+
}) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(ae, {
|
|
252
|
+
columns: Z,
|
|
253
|
+
rows: Y,
|
|
237
254
|
rowKey: (e) => e.id
|
|
238
|
-
}), /* @__PURE__ */
|
|
239
|
-
page:
|
|
240
|
-
pageSize:
|
|
241
|
-
itemCount:
|
|
242
|
-
hasMore:
|
|
243
|
-
onPageChange: (e) =>
|
|
255
|
+
}), /* @__PURE__ */ g(oe, {
|
|
256
|
+
page: I.page,
|
|
257
|
+
pageSize: O,
|
|
258
|
+
itemCount: Y.length,
|
|
259
|
+
hasMore: G?.pageInfo?.hasMore ?? !1,
|
|
260
|
+
onPageChange: (e) => I.onPageChange(e, G?.pageInfo?.cursor)
|
|
244
261
|
})] }),
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
-
open:
|
|
262
|
+
/* @__PURE__ */ g(le, {
|
|
263
|
+
open: L,
|
|
247
264
|
onOpenChange: (e) => {
|
|
248
|
-
|
|
265
|
+
R(e), e || $();
|
|
249
266
|
},
|
|
250
|
-
children: /* @__PURE__ */
|
|
251
|
-
/* @__PURE__ */
|
|
252
|
-
/* @__PURE__ */
|
|
267
|
+
children: /* @__PURE__ */ _(ue, { children: [
|
|
268
|
+
/* @__PURE__ */ _(pe, { children: [/* @__PURE__ */ g(me, { children: "Record observation" }), /* @__PURE__ */ g(de, { children: "Log a wildlife or biodiversity sighting in the field." })] }),
|
|
269
|
+
/* @__PURE__ */ _("div", {
|
|
253
270
|
className: "grid gap-4 py-2",
|
|
254
271
|
children: [
|
|
255
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ _("div", {
|
|
256
273
|
className: "grid gap-1.5",
|
|
257
274
|
children: [
|
|
258
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ g(b, {
|
|
259
276
|
htmlFor: "species",
|
|
260
277
|
children: "Species *"
|
|
261
278
|
}),
|
|
262
|
-
/* @__PURE__ */
|
|
263
|
-
value:
|
|
264
|
-
onValueChange: (e) =>
|
|
265
|
-
...
|
|
279
|
+
/* @__PURE__ */ _(x, {
|
|
280
|
+
value: z.speciesId,
|
|
281
|
+
onValueChange: (e) => B({
|
|
282
|
+
...z,
|
|
266
283
|
speciesId: e
|
|
267
284
|
}),
|
|
268
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ g(w, {
|
|
269
286
|
id: "species",
|
|
270
|
-
children: /* @__PURE__ */
|
|
271
|
-
}), /* @__PURE__ */
|
|
287
|
+
children: /* @__PURE__ */ g(T, { placeholder: "Select a species" })
|
|
288
|
+
}), /* @__PURE__ */ g(S, { children: J.map((e) => /* @__PURE__ */ g(C, {
|
|
272
289
|
value: e.id,
|
|
273
290
|
children: e.commonName
|
|
274
291
|
}, e.id)) })]
|
|
275
292
|
}),
|
|
276
|
-
|
|
293
|
+
J.length === 0 && /* @__PURE__ */ g("p", {
|
|
277
294
|
className: "text-xs text-text-tertiary",
|
|
278
295
|
children: "No species defined yet — add one in the Species section first."
|
|
279
296
|
})
|
|
280
297
|
]
|
|
281
298
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ _("div", {
|
|
283
300
|
className: "grid gap-2 sm:grid-cols-2",
|
|
284
|
-
children: [/* @__PURE__ */
|
|
301
|
+
children: [/* @__PURE__ */ _("div", {
|
|
285
302
|
className: "grid gap-1.5",
|
|
286
|
-
children: [/* @__PURE__ */
|
|
303
|
+
children: [/* @__PURE__ */ g(b, {
|
|
287
304
|
htmlFor: "observedAt",
|
|
288
305
|
children: "Observed at"
|
|
289
|
-
}), /* @__PURE__ */
|
|
306
|
+
}), /* @__PURE__ */ g(y, {
|
|
290
307
|
id: "observedAt",
|
|
291
308
|
type: "datetime-local",
|
|
292
|
-
value:
|
|
293
|
-
onChange: (e) =>
|
|
294
|
-
...
|
|
309
|
+
value: z.observedAt,
|
|
310
|
+
onChange: (e) => B({
|
|
311
|
+
...z,
|
|
295
312
|
observedAt: e.target.value
|
|
296
313
|
})
|
|
297
314
|
})]
|
|
298
|
-
}), /* @__PURE__ */
|
|
315
|
+
}), /* @__PURE__ */ _("div", {
|
|
299
316
|
className: "grid gap-1.5",
|
|
300
|
-
children: [/* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ g(b, {
|
|
301
318
|
htmlFor: "count",
|
|
302
319
|
children: "Count"
|
|
303
|
-
}), /* @__PURE__ */
|
|
320
|
+
}), /* @__PURE__ */ g(y, {
|
|
304
321
|
id: "count",
|
|
305
322
|
type: "number",
|
|
306
323
|
min: "1",
|
|
307
324
|
step: "1",
|
|
308
|
-
value:
|
|
309
|
-
onChange: (e) =>
|
|
310
|
-
...
|
|
325
|
+
value: z.count,
|
|
326
|
+
onChange: (e) => B({
|
|
327
|
+
...z,
|
|
311
328
|
count: e.target.value
|
|
312
329
|
}),
|
|
313
330
|
placeholder: "1"
|
|
314
331
|
})]
|
|
315
332
|
})]
|
|
316
333
|
}),
|
|
317
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ _("div", {
|
|
318
335
|
className: "grid gap-2 sm:grid-cols-2",
|
|
319
|
-
children: [/* @__PURE__ */
|
|
336
|
+
children: [/* @__PURE__ */ _("div", {
|
|
320
337
|
className: "grid gap-1.5",
|
|
321
|
-
children: [/* @__PURE__ */
|
|
338
|
+
children: [/* @__PURE__ */ g(b, {
|
|
322
339
|
htmlFor: "method",
|
|
323
340
|
children: "Method"
|
|
324
|
-
}), /* @__PURE__ */
|
|
325
|
-
value:
|
|
326
|
-
onValueChange: (e) =>
|
|
327
|
-
...
|
|
341
|
+
}), /* @__PURE__ */ _(x, {
|
|
342
|
+
value: z.method,
|
|
343
|
+
onValueChange: (e) => B({
|
|
344
|
+
...z,
|
|
328
345
|
method: e
|
|
329
346
|
}),
|
|
330
|
-
children: [/* @__PURE__ */
|
|
347
|
+
children: [/* @__PURE__ */ g(w, {
|
|
331
348
|
id: "method",
|
|
332
|
-
children: /* @__PURE__ */
|
|
333
|
-
}), /* @__PURE__ */
|
|
349
|
+
children: /* @__PURE__ */ g(T, {})
|
|
350
|
+
}), /* @__PURE__ */ g(S, { children: D.map((e) => /* @__PURE__ */ g(C, {
|
|
334
351
|
value: e,
|
|
335
|
-
children:
|
|
352
|
+
children: r(e)
|
|
336
353
|
}, e)) })]
|
|
337
354
|
})]
|
|
338
|
-
}), /* @__PURE__ */
|
|
355
|
+
}), /* @__PURE__ */ _("div", {
|
|
339
356
|
className: "grid gap-1.5",
|
|
340
|
-
children: [/* @__PURE__ */
|
|
357
|
+
children: [/* @__PURE__ */ g(b, {
|
|
341
358
|
htmlFor: "site",
|
|
342
359
|
children: "Site"
|
|
343
|
-
}), /* @__PURE__ */
|
|
344
|
-
value:
|
|
345
|
-
onValueChange: (e) =>
|
|
346
|
-
...
|
|
360
|
+
}), /* @__PURE__ */ _(x, {
|
|
361
|
+
value: z.siteId,
|
|
362
|
+
onValueChange: (e) => B({
|
|
363
|
+
...z,
|
|
347
364
|
siteId: e
|
|
348
365
|
}),
|
|
349
|
-
children: [/* @__PURE__ */
|
|
366
|
+
children: [/* @__PURE__ */ g(w, {
|
|
350
367
|
id: "site",
|
|
351
|
-
children: /* @__PURE__ */
|
|
352
|
-
}), /* @__PURE__ */
|
|
353
|
-
value:
|
|
368
|
+
children: /* @__PURE__ */ g(T, { placeholder: "No site" })
|
|
369
|
+
}), /* @__PURE__ */ _(S, { children: [/* @__PURE__ */ g(C, {
|
|
370
|
+
value: A,
|
|
354
371
|
children: "No site"
|
|
355
|
-
}),
|
|
372
|
+
}), q.map((e) => /* @__PURE__ */ g(C, {
|
|
356
373
|
value: e.id,
|
|
357
374
|
children: e.name
|
|
358
375
|
}, e.id))] })]
|
|
359
376
|
})]
|
|
360
377
|
})]
|
|
361
378
|
}),
|
|
362
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ _("div", {
|
|
363
380
|
className: "grid gap-2 sm:grid-cols-2",
|
|
364
|
-
children: [/* @__PURE__ */
|
|
381
|
+
children: [/* @__PURE__ */ _("div", {
|
|
365
382
|
className: "grid gap-1.5",
|
|
366
|
-
children: [/* @__PURE__ */
|
|
383
|
+
children: [/* @__PURE__ */ g(b, {
|
|
367
384
|
htmlFor: "lat",
|
|
368
385
|
children: "Latitude"
|
|
369
|
-
}), /* @__PURE__ */
|
|
386
|
+
}), /* @__PURE__ */ g(y, {
|
|
370
387
|
id: "lat",
|
|
371
388
|
type: "number",
|
|
372
389
|
step: "any",
|
|
373
|
-
value:
|
|
374
|
-
onChange: (e) =>
|
|
375
|
-
...
|
|
390
|
+
value: z.latitude,
|
|
391
|
+
onChange: (e) => B({
|
|
392
|
+
...z,
|
|
376
393
|
latitude: e.target.value
|
|
377
394
|
}),
|
|
378
395
|
placeholder: "12.9716"
|
|
379
396
|
})]
|
|
380
|
-
}), /* @__PURE__ */
|
|
397
|
+
}), /* @__PURE__ */ _("div", {
|
|
381
398
|
className: "grid gap-1.5",
|
|
382
|
-
children: [/* @__PURE__ */
|
|
399
|
+
children: [/* @__PURE__ */ g(b, {
|
|
383
400
|
htmlFor: "lng",
|
|
384
401
|
children: "Longitude"
|
|
385
|
-
}), /* @__PURE__ */
|
|
402
|
+
}), /* @__PURE__ */ g(y, {
|
|
386
403
|
id: "lng",
|
|
387
404
|
type: "number",
|
|
388
405
|
step: "any",
|
|
389
|
-
value:
|
|
390
|
-
onChange: (e) =>
|
|
391
|
-
...
|
|
406
|
+
value: z.longitude,
|
|
407
|
+
onChange: (e) => B({
|
|
408
|
+
...z,
|
|
392
409
|
longitude: e.target.value
|
|
393
410
|
}),
|
|
394
411
|
placeholder: "77.5946"
|
|
395
412
|
})]
|
|
396
413
|
})]
|
|
397
414
|
}),
|
|
398
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ _("div", {
|
|
399
416
|
className: "grid gap-1.5",
|
|
400
|
-
children: [/* @__PURE__ */
|
|
417
|
+
children: [/* @__PURE__ */ g(b, {
|
|
401
418
|
htmlFor: "notes",
|
|
402
419
|
children: "Notes"
|
|
403
|
-
}), /* @__PURE__ */
|
|
420
|
+
}), /* @__PURE__ */ g(E, {
|
|
404
421
|
id: "notes",
|
|
405
|
-
value:
|
|
406
|
-
onChange: (e) =>
|
|
407
|
-
...
|
|
422
|
+
value: z.notes,
|
|
423
|
+
onChange: (e) => B({
|
|
424
|
+
...z,
|
|
408
425
|
notes: e.target.value
|
|
409
426
|
}),
|
|
410
427
|
placeholder: "Behaviour, habitat, weather or other field context.",
|
|
411
428
|
rows: 2
|
|
412
429
|
})]
|
|
413
430
|
}),
|
|
414
|
-
/* @__PURE__ */
|
|
431
|
+
/* @__PURE__ */ g(se, {
|
|
415
432
|
id: "obsEvidence",
|
|
416
433
|
label: "Evidence photo (optional)",
|
|
417
|
-
value:
|
|
418
|
-
onChange: (e) =>
|
|
419
|
-
...
|
|
434
|
+
value: z.evidence,
|
|
435
|
+
onChange: (e) => B({
|
|
436
|
+
...z,
|
|
420
437
|
evidence: e
|
|
421
438
|
}),
|
|
422
439
|
hint: "Attach a photo, audio clip or PDF as supporting evidence."
|
|
423
440
|
}),
|
|
424
|
-
|
|
441
|
+
V && /* @__PURE__ */ g("p", {
|
|
425
442
|
className: "text-sm text-status-error-text",
|
|
426
|
-
children:
|
|
443
|
+
children: V
|
|
427
444
|
})
|
|
428
445
|
]
|
|
429
446
|
}),
|
|
430
|
-
/* @__PURE__ */
|
|
447
|
+
/* @__PURE__ */ _(fe, { children: [/* @__PURE__ */ g(v, {
|
|
431
448
|
variant: "outline",
|
|
432
|
-
onClick: () =>
|
|
449
|
+
onClick: () => R(!1),
|
|
433
450
|
children: "Cancel"
|
|
434
|
-
}), /* @__PURE__ */
|
|
435
|
-
onClick:
|
|
436
|
-
disabled:
|
|
437
|
-
children:
|
|
451
|
+
}), /* @__PURE__ */ g(v, {
|
|
452
|
+
onClick: ye,
|
|
453
|
+
disabled: K.isPending,
|
|
454
|
+
children: K.isPending ? "Recording…" : "Record observation"
|
|
438
455
|
})] })
|
|
439
456
|
] })
|
|
440
457
|
})
|
|
@@ -442,6 +459,6 @@ function F() {
|
|
|
442
459
|
});
|
|
443
460
|
}
|
|
444
461
|
//#endregion
|
|
445
|
-
export {
|
|
462
|
+
export { N as ObservationsPage };
|
|
446
463
|
|
|
447
464
|
//# sourceMappingURL=ObservationsPage.js.map
|