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