@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,25 +1,27 @@
|
|
|
1
1
|
import { useEcoImpactHub as e } from "../../context/EcoImpactHubContext.js";
|
|
2
2
|
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
|
-
import { formatDateTime as
|
|
4
|
-
import { ErrorView as
|
|
3
|
+
import { formatDateTime as n, formatEnumLabel as r, formatNumber as i } from "../../utils/formatters.js";
|
|
4
|
+
import { ErrorView as a, LoadingView as ee, Section as te } from "../../components/StateViews.js";
|
|
5
5
|
import { EmptyState as ne } from "../../components/EmptyState.js";
|
|
6
6
|
import "../../context/index.js";
|
|
7
7
|
import { useEcoArchiveSpecies as re, useEcoRecordObservation as ie, useEcoSites as ae, useEcoSpeciesDetail as oe, useEcoUpdateSpecies as se } from "../../hooks/useEcoImpactHubApi.js";
|
|
8
|
+
import { useActiveEcoEntity as ce } from "../../hooks/useActiveEcoEntity.js";
|
|
8
9
|
import "../../hooks/index.js";
|
|
9
|
-
import { DataTable as
|
|
10
|
-
import { EcoTags as
|
|
11
|
-
import { EvidenceUpload as
|
|
12
|
-
import { MethodBadge as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
10
|
+
import { DataTable as le } from "../../components/DataTable.js";
|
|
11
|
+
import { EcoTags as ue } from "../../components/EcoTags.js";
|
|
12
|
+
import { EvidenceUpload as de } from "../../components/EvidenceUpload.js";
|
|
13
|
+
import { MethodBadge as fe } from "../_shared/MethodBadge.js";
|
|
14
|
+
import { MethodPicker as pe } from "../_shared/MethodPicker.js";
|
|
15
|
+
import { EvidenceThumb as me } from "../_shared/EvidenceThumb.js";
|
|
16
|
+
import { ConservationBadge as o } from "../_shared/ConservationBadge.js";
|
|
17
|
+
import { TaxonChip as s } from "../_shared/TaxonChip.js";
|
|
18
|
+
import { useState as c } from "react";
|
|
19
|
+
import { Archive as l, ArrowLeft as u, Binoculars as d, Pencil as he, Star as f } from "lucide-react";
|
|
20
|
+
import { useParams as ge } from "react-router";
|
|
21
|
+
import { Fragment as _e, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
22
|
+
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";
|
|
21
23
|
//#region src/ecoimpacthub/pages/species/SpeciesDetailPage.tsx
|
|
22
|
-
var
|
|
24
|
+
var j = [
|
|
23
25
|
"DIRECT_SIGHTING",
|
|
24
26
|
"CAMERA_TRAP",
|
|
25
27
|
"ACOUSTIC",
|
|
@@ -27,7 +29,7 @@ var M = [
|
|
|
27
29
|
"EDNA",
|
|
28
30
|
"TELEMETRY",
|
|
29
31
|
"COMMUNITY_REPORT"
|
|
30
|
-
],
|
|
32
|
+
], M = [
|
|
31
33
|
"MAMMAL",
|
|
32
34
|
"BIRD",
|
|
33
35
|
"REPTILE",
|
|
@@ -37,7 +39,7 @@ var M = [
|
|
|
37
39
|
"PLANT",
|
|
38
40
|
"FUNGI",
|
|
39
41
|
"OTHER"
|
|
40
|
-
],
|
|
42
|
+
], N = [
|
|
41
43
|
"LEAST_CONCERN",
|
|
42
44
|
"NEAR_THREATENED",
|
|
43
45
|
"VULNERABLE",
|
|
@@ -46,223 +48,225 @@ var M = [
|
|
|
46
48
|
"EXTINCT_IN_WILD",
|
|
47
49
|
"DATA_DEFICIENT",
|
|
48
50
|
"NOT_EVALUATED"
|
|
49
|
-
],
|
|
51
|
+
], P = (e) => {
|
|
50
52
|
let t = (e) => String(e).padStart(2, "0");
|
|
51
53
|
return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`;
|
|
52
54
|
};
|
|
53
|
-
function
|
|
54
|
-
let { id:
|
|
55
|
+
function F() {
|
|
56
|
+
let { id: F } = ge(), { navigateTo: I } = e(), { data: L, isLoading: ve, isError: ye, refetch: be } = oe(F);
|
|
57
|
+
ce(L?.id, L?.commonName);
|
|
58
|
+
let xe = ae({ pagination: {
|
|
55
59
|
limit: 100,
|
|
56
60
|
offset: 0
|
|
57
|
-
} }),
|
|
61
|
+
} }), R = ie(), z = se(), B = re(), [Se, V] = c(!1), [H, U] = c({
|
|
58
62
|
method: "DIRECT_SIGHTING",
|
|
59
63
|
count: "1",
|
|
60
|
-
observedAt:
|
|
64
|
+
observedAt: P(/* @__PURE__ */ new Date()),
|
|
61
65
|
siteId: "",
|
|
62
66
|
notes: "",
|
|
63
67
|
evidence: null
|
|
64
|
-
}), [
|
|
68
|
+
}), [W, G] = c(!1), [K, q] = c({
|
|
65
69
|
commonName: "",
|
|
66
70
|
scientificName: "",
|
|
67
71
|
taxonGroup: "MAMMAL",
|
|
68
72
|
conservationStatus: "NOT_EVALUATED",
|
|
69
73
|
isPriority: !1,
|
|
70
74
|
description: ""
|
|
71
|
-
}), [J, Y] =
|
|
72
|
-
if (
|
|
75
|
+
}), [J, Y] = c(null);
|
|
76
|
+
if (ve) return /* @__PURE__ */ p(t, {
|
|
73
77
|
title: "Species",
|
|
74
|
-
children: /* @__PURE__ */
|
|
78
|
+
children: /* @__PURE__ */ p(ee, {})
|
|
75
79
|
});
|
|
76
|
-
if (
|
|
80
|
+
if (ye || !L) return /* @__PURE__ */ p(t, {
|
|
77
81
|
title: "Species",
|
|
78
|
-
children: /* @__PURE__ */
|
|
82
|
+
children: /* @__PURE__ */ p(a, {
|
|
79
83
|
message: "This species could not be loaded.",
|
|
80
|
-
onRetry: () =>
|
|
84
|
+
onRetry: () => be()
|
|
81
85
|
})
|
|
82
86
|
});
|
|
83
|
-
let X =
|
|
87
|
+
let X = L.observations ?? [], Z = xe.data?.items ?? [], Q = /* @__PURE__ */ new Map();
|
|
84
88
|
for (let e of Z) Q.set(e.id, e.name);
|
|
85
89
|
let $ = () => {
|
|
86
|
-
|
|
90
|
+
U({
|
|
87
91
|
method: "DIRECT_SIGHTING",
|
|
88
92
|
count: "1",
|
|
89
|
-
observedAt:
|
|
93
|
+
observedAt: P(/* @__PURE__ */ new Date()),
|
|
90
94
|
siteId: "",
|
|
91
95
|
notes: "",
|
|
92
96
|
evidence: null
|
|
93
|
-
}), Y(null),
|
|
97
|
+
}), Y(null), V(!0);
|
|
94
98
|
};
|
|
95
|
-
return /* @__PURE__ */
|
|
96
|
-
title:
|
|
97
|
-
description: [
|
|
98
|
-
actions: /* @__PURE__ */
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
|
|
99
|
+
return /* @__PURE__ */ m(t, {
|
|
100
|
+
title: L.commonName,
|
|
101
|
+
description: [L.scientificName, r(L.taxonGroup)].filter(Boolean).join(" · "),
|
|
102
|
+
actions: /* @__PURE__ */ m(_e, { children: [
|
|
103
|
+
/* @__PURE__ */ p(o, { status: L.conservationStatus }),
|
|
104
|
+
L.isPriority && /* @__PURE__ */ m("span", {
|
|
101
105
|
className: "inline-flex items-center gap-1 rounded-full bg-status-warning-bg-subtle px-2.5 py-0.5 text-xs font-semibold text-status-warning-text",
|
|
102
106
|
title: "Priority species",
|
|
103
|
-
children: [/* @__PURE__ */
|
|
107
|
+
children: [/* @__PURE__ */ p(f, { className: "h-3.5 w-3.5 fill-current" }), " Priority"]
|
|
104
108
|
}),
|
|
105
|
-
/* @__PURE__ */ h
|
|
109
|
+
/* @__PURE__ */ m(h, {
|
|
106
110
|
variant: "ghost",
|
|
107
|
-
onClick: () =>
|
|
108
|
-
children: [/* @__PURE__ */
|
|
111
|
+
onClick: () => I("species"),
|
|
112
|
+
children: [/* @__PURE__ */ p(u, { className: "mr-1.5 h-4 w-4" }), " Back"]
|
|
109
113
|
})
|
|
110
114
|
] }),
|
|
111
115
|
children: [
|
|
112
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ m("div", {
|
|
113
117
|
className: "grid grid-cols-1 gap-4 lg:grid-cols-3",
|
|
114
|
-
children: [/* @__PURE__ */
|
|
118
|
+
children: [/* @__PURE__ */ m(g, {
|
|
115
119
|
treatment: "glass",
|
|
116
120
|
className: "p-6 lg:col-span-2",
|
|
117
121
|
children: [
|
|
118
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ m("dl", {
|
|
119
123
|
className: "grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3",
|
|
120
124
|
children: [
|
|
121
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("dt", {
|
|
122
126
|
className: "text-xs text-text-tertiary",
|
|
123
127
|
children: "Scientific name"
|
|
124
|
-
}), /* @__PURE__ */
|
|
128
|
+
}), /* @__PURE__ */ p("dd", {
|
|
125
129
|
className: "mt-0.5 text-sm italic text-text-primary",
|
|
126
|
-
children:
|
|
130
|
+
children: L.scientificName ?? "—"
|
|
127
131
|
})] }),
|
|
128
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("dt", {
|
|
129
133
|
className: "text-xs text-text-tertiary",
|
|
130
134
|
children: "Taxon group"
|
|
131
|
-
}), /* @__PURE__ */
|
|
135
|
+
}), /* @__PURE__ */ p("dd", {
|
|
132
136
|
className: "mt-1",
|
|
133
|
-
children: /* @__PURE__ */
|
|
137
|
+
children: /* @__PURE__ */ p(s, { group: L.taxonGroup })
|
|
134
138
|
})] }),
|
|
135
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("dt", {
|
|
136
140
|
className: "text-xs text-text-tertiary",
|
|
137
141
|
children: "Conservation"
|
|
138
|
-
}), /* @__PURE__ */
|
|
142
|
+
}), /* @__PURE__ */ p("dd", {
|
|
139
143
|
className: "mt-1",
|
|
140
|
-
children: /* @__PURE__ */
|
|
144
|
+
children: /* @__PURE__ */ p(o, { status: L.conservationStatus })
|
|
141
145
|
})] }),
|
|
142
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("dt", {
|
|
143
147
|
className: "text-xs text-text-tertiary",
|
|
144
148
|
children: "Priority"
|
|
145
|
-
}), /* @__PURE__ */
|
|
149
|
+
}), /* @__PURE__ */ p("dd", {
|
|
146
150
|
className: "mt-0.5 text-sm text-text-primary",
|
|
147
|
-
children:
|
|
151
|
+
children: L.isPriority ? /* @__PURE__ */ m("span", {
|
|
148
152
|
className: "inline-flex items-center gap-1 text-status-warning-text",
|
|
149
|
-
children: [/* @__PURE__ */
|
|
153
|
+
children: [/* @__PURE__ */ p(f, { className: "h-4 w-4 fill-current" }), " Priority"]
|
|
150
154
|
}) : "—"
|
|
151
155
|
})] }),
|
|
152
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("dt", {
|
|
153
157
|
className: "text-xs text-text-tertiary",
|
|
154
158
|
children: "Observations"
|
|
155
|
-
}), /* @__PURE__ */
|
|
159
|
+
}), /* @__PURE__ */ p("dd", {
|
|
156
160
|
className: "mt-0.5 text-sm text-text-primary tabular-nums",
|
|
157
161
|
children: X.length
|
|
158
162
|
})] })
|
|
159
163
|
]
|
|
160
164
|
}),
|
|
161
|
-
|
|
165
|
+
L.description && /* @__PURE__ */ p("p", {
|
|
162
166
|
className: "mt-5 rounded-lg bg-bg-sunken/60 p-3 text-sm text-text-secondary",
|
|
163
|
-
children:
|
|
167
|
+
children: L.description
|
|
164
168
|
}),
|
|
165
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ p("div", {
|
|
166
170
|
className: "mt-5 border-t border-border-seam pt-4",
|
|
167
|
-
children: /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ p(ue, {
|
|
168
172
|
entityType: "ecoimpacthub-species",
|
|
169
|
-
entityId:
|
|
173
|
+
entityId: L.id
|
|
170
174
|
})
|
|
171
175
|
})
|
|
172
176
|
]
|
|
173
|
-
}), /* @__PURE__ */
|
|
177
|
+
}), /* @__PURE__ */ m(g, {
|
|
174
178
|
treatment: "glass",
|
|
175
179
|
className: "flex flex-col gap-3 p-6",
|
|
176
180
|
children: [
|
|
177
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ p("p", {
|
|
178
182
|
className: "text-xs text-text-tertiary",
|
|
179
183
|
children: "Quick actions"
|
|
180
184
|
}),
|
|
181
|
-
/* @__PURE__ */ h
|
|
185
|
+
/* @__PURE__ */ m(h, {
|
|
182
186
|
onClick: $,
|
|
183
|
-
children: [/* @__PURE__ */
|
|
187
|
+
children: [/* @__PURE__ */ p(d, { className: "mr-1.5 h-4 w-4" }), " Record observation"]
|
|
184
188
|
}),
|
|
185
|
-
/* @__PURE__ */ h
|
|
189
|
+
/* @__PURE__ */ m(h, {
|
|
186
190
|
variant: "outline",
|
|
187
191
|
onClick: () => {
|
|
188
192
|
q({
|
|
189
|
-
commonName:
|
|
190
|
-
scientificName:
|
|
191
|
-
taxonGroup:
|
|
192
|
-
conservationStatus:
|
|
193
|
-
isPriority:
|
|
194
|
-
description:
|
|
193
|
+
commonName: L.commonName,
|
|
194
|
+
scientificName: L.scientificName ?? "",
|
|
195
|
+
taxonGroup: L.taxonGroup,
|
|
196
|
+
conservationStatus: L.conservationStatus,
|
|
197
|
+
isPriority: L.isPriority,
|
|
198
|
+
description: L.description ?? ""
|
|
195
199
|
}), Y(null), G(!0);
|
|
196
200
|
},
|
|
197
|
-
children: [/* @__PURE__ */
|
|
201
|
+
children: [/* @__PURE__ */ p(he, { className: "mr-1.5 h-4 w-4" }), " Edit species"]
|
|
198
202
|
}),
|
|
199
|
-
/* @__PURE__ */ h
|
|
203
|
+
/* @__PURE__ */ m(h, {
|
|
200
204
|
variant: "ghost",
|
|
201
205
|
onClick: async () => {
|
|
202
|
-
if (
|
|
206
|
+
if (F) {
|
|
203
207
|
Y(null);
|
|
204
208
|
try {
|
|
205
|
-
await
|
|
209
|
+
await B.mutateAsync(F), I("species");
|
|
206
210
|
} catch (e) {
|
|
207
211
|
Y(e instanceof Error ? e.message : "Failed to archive species.");
|
|
208
212
|
}
|
|
209
213
|
}
|
|
210
214
|
},
|
|
211
|
-
disabled:
|
|
215
|
+
disabled: B.isPending,
|
|
212
216
|
className: "text-status-error-text hover:text-status-error-text",
|
|
213
|
-
children: [/* @__PURE__ */
|
|
217
|
+
children: [/* @__PURE__ */ p(l, { className: "mr-1.5 h-4 w-4" }), " Archive"]
|
|
214
218
|
})
|
|
215
219
|
]
|
|
216
220
|
})]
|
|
217
221
|
}),
|
|
218
|
-
J && /* @__PURE__ */
|
|
222
|
+
J && /* @__PURE__ */ p("p", {
|
|
219
223
|
className: "mt-4 text-sm text-status-error-text",
|
|
220
224
|
children: J
|
|
221
225
|
}),
|
|
222
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ p(te, {
|
|
223
227
|
title: "Observations",
|
|
224
228
|
description: "Field records logged against this species.",
|
|
225
|
-
action: /* @__PURE__ */ h
|
|
229
|
+
action: /* @__PURE__ */ m(h, {
|
|
226
230
|
size: "sm",
|
|
227
231
|
onClick: $,
|
|
228
|
-
children: [/* @__PURE__ */
|
|
232
|
+
children: [/* @__PURE__ */ p(d, { className: "mr-1.5 h-4 w-4" }), " Record observation"]
|
|
229
233
|
}),
|
|
230
|
-
children: X.length === 0 ? /* @__PURE__ */
|
|
234
|
+
children: X.length === 0 ? /* @__PURE__ */ p(ne, {
|
|
231
235
|
illustration: "empty-data",
|
|
232
236
|
title: "No observations yet",
|
|
233
237
|
description: "Record a field observation to see it here."
|
|
234
|
-
}) : /* @__PURE__ */
|
|
238
|
+
}) : /* @__PURE__ */ p(le, {
|
|
235
239
|
columns: [
|
|
236
240
|
{
|
|
237
241
|
key: "evidence",
|
|
238
242
|
header: "Evidence",
|
|
239
|
-
render: (e) => /* @__PURE__ */
|
|
243
|
+
render: (e) => /* @__PURE__ */ p(me, {
|
|
240
244
|
fileId: e.evidence?.id,
|
|
241
|
-
alt:
|
|
245
|
+
alt: L.commonName
|
|
242
246
|
})
|
|
243
247
|
},
|
|
244
248
|
{
|
|
245
249
|
key: "method",
|
|
246
250
|
header: "Method",
|
|
247
|
-
render: (e) => /* @__PURE__ */
|
|
251
|
+
render: (e) => /* @__PURE__ */ p(fe, { method: e.method })
|
|
248
252
|
},
|
|
249
253
|
{
|
|
250
254
|
key: "count",
|
|
251
255
|
header: "Count",
|
|
252
256
|
align: "right",
|
|
253
257
|
sortValue: (e) => e.count,
|
|
254
|
-
render: (e) => /* @__PURE__ */
|
|
258
|
+
render: (e) => /* @__PURE__ */ m("span", {
|
|
255
259
|
className: "tabular-nums font-medium text-text-primary",
|
|
256
|
-
children: ["×",
|
|
260
|
+
children: ["×", i(e.count)]
|
|
257
261
|
})
|
|
258
262
|
},
|
|
259
263
|
{
|
|
260
264
|
key: "observedAt",
|
|
261
265
|
header: "Observed",
|
|
262
266
|
hideOnMobile: !0,
|
|
263
|
-
render: (e) => /* @__PURE__ */
|
|
267
|
+
render: (e) => /* @__PURE__ */ p("span", {
|
|
264
268
|
className: "whitespace-nowrap text-text-secondary",
|
|
265
|
-
children:
|
|
269
|
+
children: n(e.observedAt)
|
|
266
270
|
})
|
|
267
271
|
},
|
|
268
272
|
{
|
|
@@ -271,10 +275,10 @@ function I() {
|
|
|
271
275
|
hideOnMobile: !0,
|
|
272
276
|
render: (e) => {
|
|
273
277
|
let t = e.siteId ? Q.get(e.siteId) : void 0;
|
|
274
|
-
return t ? /* @__PURE__ */
|
|
278
|
+
return t ? /* @__PURE__ */ p("span", {
|
|
275
279
|
className: "text-text-secondary",
|
|
276
280
|
children: t
|
|
277
|
-
}) : /* @__PURE__ */
|
|
281
|
+
}) : /* @__PURE__ */ p("span", {
|
|
278
282
|
className: "text-text-tertiary",
|
|
279
283
|
children: "—"
|
|
280
284
|
});
|
|
@@ -284,11 +288,11 @@ function I() {
|
|
|
284
288
|
key: "notes",
|
|
285
289
|
header: "Notes",
|
|
286
290
|
hideOnMobile: !0,
|
|
287
|
-
render: (e) => e.notes ? /* @__PURE__ */
|
|
291
|
+
render: (e) => e.notes ? /* @__PURE__ */ p("span", {
|
|
288
292
|
className: "block max-w-xs truncate text-text-secondary",
|
|
289
293
|
title: e.notes,
|
|
290
294
|
children: e.notes
|
|
291
|
-
}) : /* @__PURE__ */
|
|
295
|
+
}) : /* @__PURE__ */ p("span", {
|
|
292
296
|
className: "text-text-tertiary",
|
|
293
297
|
children: "—"
|
|
294
298
|
})
|
|
@@ -298,165 +302,158 @@ function I() {
|
|
|
298
302
|
rowKey: (e) => e.id
|
|
299
303
|
})
|
|
300
304
|
}),
|
|
301
|
-
/* @__PURE__ */
|
|
302
|
-
open:
|
|
303
|
-
onOpenChange:
|
|
304
|
-
children: /* @__PURE__ */
|
|
305
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ p(y, {
|
|
306
|
+
open: Se,
|
|
307
|
+
onOpenChange: V,
|
|
308
|
+
children: /* @__PURE__ */ m(b, { children: [
|
|
309
|
+
/* @__PURE__ */ m(C, { children: [/* @__PURE__ */ p(w, { children: "Record observation" }), /* @__PURE__ */ m(x, { children: [
|
|
306
310
|
"Log a field sighting or detection of ",
|
|
307
|
-
|
|
311
|
+
L.commonName,
|
|
308
312
|
"."
|
|
309
313
|
] })] }),
|
|
310
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ m("div", {
|
|
311
315
|
className: "grid gap-4 py-2",
|
|
312
316
|
children: [
|
|
313
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ m("div", {
|
|
318
|
+
className: "grid gap-1.5",
|
|
319
|
+
children: [/* @__PURE__ */ p(v, { children: "Method" }), /* @__PURE__ */ p(pe, {
|
|
320
|
+
options: j,
|
|
321
|
+
value: H.method,
|
|
322
|
+
onChange: (e) => U({
|
|
323
|
+
...H,
|
|
324
|
+
method: e
|
|
325
|
+
}),
|
|
326
|
+
label: "Observation method"
|
|
327
|
+
})]
|
|
328
|
+
}),
|
|
329
|
+
/* @__PURE__ */ p("div", {
|
|
314
330
|
className: "grid gap-2 sm:grid-cols-2",
|
|
315
|
-
children:
|
|
331
|
+
children: /* @__PURE__ */ m("div", {
|
|
316
332
|
className: "grid gap-1.5",
|
|
317
|
-
children: [/* @__PURE__ */
|
|
318
|
-
htmlFor: "obsMethod",
|
|
319
|
-
children: "Method"
|
|
320
|
-
}), /* @__PURE__ */ h(E, {
|
|
321
|
-
value: U.method,
|
|
322
|
-
onValueChange: (e) => W({
|
|
323
|
-
...U,
|
|
324
|
-
method: e
|
|
325
|
-
}),
|
|
326
|
-
children: [/* @__PURE__ */ m(k, {
|
|
327
|
-
id: "obsMethod",
|
|
328
|
-
children: /* @__PURE__ */ m(A, {})
|
|
329
|
-
}), /* @__PURE__ */ m(D, { children: M.map((e) => /* @__PURE__ */ m(O, {
|
|
330
|
-
value: e,
|
|
331
|
-
children: n(e)
|
|
332
|
-
}, e)) })]
|
|
333
|
-
})]
|
|
334
|
-
}), /* @__PURE__ */ h("div", {
|
|
335
|
-
className: "grid gap-1.5",
|
|
336
|
-
children: [/* @__PURE__ */ m(y, {
|
|
333
|
+
children: [/* @__PURE__ */ p(v, {
|
|
337
334
|
htmlFor: "obsCount",
|
|
338
335
|
children: "Count"
|
|
339
|
-
}), /* @__PURE__ */
|
|
336
|
+
}), /* @__PURE__ */ p(_, {
|
|
340
337
|
id: "obsCount",
|
|
341
338
|
type: "number",
|
|
342
339
|
min: "1",
|
|
343
340
|
step: "1",
|
|
344
|
-
value:
|
|
345
|
-
onChange: (e) =>
|
|
346
|
-
...
|
|
341
|
+
value: H.count,
|
|
342
|
+
onChange: (e) => U({
|
|
343
|
+
...H,
|
|
347
344
|
count: e.target.value
|
|
348
345
|
}),
|
|
349
346
|
placeholder: "1"
|
|
350
347
|
})]
|
|
351
|
-
})
|
|
348
|
+
})
|
|
352
349
|
}),
|
|
353
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ m("div", {
|
|
354
351
|
className: "grid gap-1.5",
|
|
355
|
-
children: [/* @__PURE__ */
|
|
352
|
+
children: [/* @__PURE__ */ p(v, {
|
|
356
353
|
htmlFor: "obsAt",
|
|
357
354
|
children: "Observed at"
|
|
358
|
-
}), /* @__PURE__ */
|
|
355
|
+
}), /* @__PURE__ */ p(_, {
|
|
359
356
|
id: "obsAt",
|
|
360
357
|
type: "datetime-local",
|
|
361
|
-
value:
|
|
362
|
-
onChange: (e) =>
|
|
363
|
-
...
|
|
358
|
+
value: H.observedAt,
|
|
359
|
+
onChange: (e) => U({
|
|
360
|
+
...H,
|
|
364
361
|
observedAt: e.target.value
|
|
365
362
|
})
|
|
366
363
|
})]
|
|
367
364
|
}),
|
|
368
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ m("div", {
|
|
369
366
|
className: "grid gap-1.5",
|
|
370
|
-
children: [/* @__PURE__ */
|
|
367
|
+
children: [/* @__PURE__ */ p(v, {
|
|
371
368
|
htmlFor: "obsSite",
|
|
372
369
|
children: "Site (optional)"
|
|
373
|
-
}), /* @__PURE__ */
|
|
374
|
-
value:
|
|
375
|
-
onValueChange: (e) =>
|
|
376
|
-
...
|
|
370
|
+
}), /* @__PURE__ */ m(T, {
|
|
371
|
+
value: H.siteId,
|
|
372
|
+
onValueChange: (e) => U({
|
|
373
|
+
...H,
|
|
377
374
|
siteId: e
|
|
378
375
|
}),
|
|
379
|
-
children: [/* @__PURE__ */
|
|
376
|
+
children: [/* @__PURE__ */ p(O, {
|
|
380
377
|
id: "obsSite",
|
|
381
|
-
children: /* @__PURE__ */
|
|
382
|
-
}), /* @__PURE__ */
|
|
378
|
+
children: /* @__PURE__ */ p(k, { placeholder: "No site" })
|
|
379
|
+
}), /* @__PURE__ */ p(E, { children: Z.map((e) => /* @__PURE__ */ p(D, {
|
|
383
380
|
value: e.id,
|
|
384
381
|
children: e.name
|
|
385
382
|
}, e.id)) })]
|
|
386
383
|
})]
|
|
387
384
|
}),
|
|
388
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ m("div", {
|
|
389
386
|
className: "grid gap-1.5",
|
|
390
|
-
children: [/* @__PURE__ */
|
|
387
|
+
children: [/* @__PURE__ */ p(v, {
|
|
391
388
|
htmlFor: "obsNotes",
|
|
392
389
|
children: "Notes"
|
|
393
|
-
}), /* @__PURE__ */
|
|
390
|
+
}), /* @__PURE__ */ p(A, {
|
|
394
391
|
id: "obsNotes",
|
|
395
|
-
value:
|
|
396
|
-
onChange: (e) =>
|
|
397
|
-
...
|
|
392
|
+
value: H.notes,
|
|
393
|
+
onChange: (e) => U({
|
|
394
|
+
...H,
|
|
398
395
|
notes: e.target.value
|
|
399
396
|
}),
|
|
400
397
|
placeholder: "Optional context — behaviour, conditions, evidence.",
|
|
401
398
|
rows: 2
|
|
402
399
|
})]
|
|
403
400
|
}),
|
|
404
|
-
/* @__PURE__ */
|
|
401
|
+
/* @__PURE__ */ p(de, {
|
|
405
402
|
id: "speciesObsEvidence",
|
|
406
403
|
label: "Evidence photo (optional)",
|
|
407
|
-
value:
|
|
408
|
-
onChange: (e) =>
|
|
409
|
-
...
|
|
404
|
+
value: H.evidence,
|
|
405
|
+
onChange: (e) => U({
|
|
406
|
+
...H,
|
|
410
407
|
evidence: e
|
|
411
408
|
}),
|
|
412
409
|
hint: "Attach a photo, audio clip or PDF as supporting evidence."
|
|
413
410
|
})
|
|
414
411
|
]
|
|
415
412
|
}),
|
|
416
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ m(S, { children: [/* @__PURE__ */ p(h, {
|
|
417
414
|
variant: "outline",
|
|
418
|
-
onClick: () =>
|
|
415
|
+
onClick: () => V(!1),
|
|
419
416
|
children: "Cancel"
|
|
420
|
-
}), /* @__PURE__ */
|
|
417
|
+
}), /* @__PURE__ */ p(h, {
|
|
421
418
|
onClick: async () => {
|
|
422
|
-
if (
|
|
419
|
+
if (F) {
|
|
423
420
|
Y(null);
|
|
424
421
|
try {
|
|
425
|
-
await
|
|
426
|
-
speciesId:
|
|
427
|
-
method:
|
|
428
|
-
count:
|
|
429
|
-
observedAt: new Date(
|
|
430
|
-
siteId:
|
|
431
|
-
notes:
|
|
432
|
-
evidenceFileId:
|
|
433
|
-
}),
|
|
422
|
+
await R.mutateAsync({
|
|
423
|
+
speciesId: F,
|
|
424
|
+
method: H.method,
|
|
425
|
+
count: H.count ? Number(H.count) : 1,
|
|
426
|
+
observedAt: new Date(H.observedAt).toISOString(),
|
|
427
|
+
siteId: H.siteId || null,
|
|
428
|
+
notes: H.notes.trim() || null,
|
|
429
|
+
evidenceFileId: H.evidence?.fileId ?? null
|
|
430
|
+
}), V(!1);
|
|
434
431
|
} catch (e) {
|
|
435
432
|
Y(e instanceof Error ? e.message : "Failed to record observation.");
|
|
436
433
|
}
|
|
437
434
|
}
|
|
438
435
|
},
|
|
439
|
-
disabled:
|
|
440
|
-
children:
|
|
436
|
+
disabled: R.isPending,
|
|
437
|
+
children: R.isPending ? "Recording…" : "Record"
|
|
441
438
|
})] })
|
|
442
439
|
] })
|
|
443
440
|
}),
|
|
444
|
-
/* @__PURE__ */
|
|
445
|
-
open:
|
|
441
|
+
/* @__PURE__ */ p(y, {
|
|
442
|
+
open: W,
|
|
446
443
|
onOpenChange: G,
|
|
447
|
-
children: /* @__PURE__ */
|
|
448
|
-
/* @__PURE__ */
|
|
449
|
-
/* @__PURE__ */
|
|
444
|
+
children: /* @__PURE__ */ m(b, { children: [
|
|
445
|
+
/* @__PURE__ */ m(C, { children: [/* @__PURE__ */ p(w, { children: "Edit species" }), /* @__PURE__ */ p(x, { children: "Update naming, classification and priority for this species." })] }),
|
|
446
|
+
/* @__PURE__ */ m("div", {
|
|
450
447
|
className: "grid gap-4 py-2",
|
|
451
448
|
children: [
|
|
452
|
-
/* @__PURE__ */
|
|
449
|
+
/* @__PURE__ */ m("div", {
|
|
453
450
|
className: "grid gap-2 sm:grid-cols-2",
|
|
454
|
-
children: [/* @__PURE__ */
|
|
451
|
+
children: [/* @__PURE__ */ m("div", {
|
|
455
452
|
className: "grid gap-1.5",
|
|
456
|
-
children: [/* @__PURE__ */
|
|
453
|
+
children: [/* @__PURE__ */ p(v, {
|
|
457
454
|
htmlFor: "editCommon",
|
|
458
455
|
children: "Common name *"
|
|
459
|
-
}), /* @__PURE__ */
|
|
456
|
+
}), /* @__PURE__ */ p(_, {
|
|
460
457
|
id: "editCommon",
|
|
461
458
|
value: K.commonName,
|
|
462
459
|
onChange: (e) => q({
|
|
@@ -465,12 +462,12 @@ function I() {
|
|
|
465
462
|
}),
|
|
466
463
|
placeholder: "Indian Pangolin"
|
|
467
464
|
})]
|
|
468
|
-
}), /* @__PURE__ */
|
|
465
|
+
}), /* @__PURE__ */ m("div", {
|
|
469
466
|
className: "grid gap-1.5",
|
|
470
|
-
children: [/* @__PURE__ */
|
|
467
|
+
children: [/* @__PURE__ */ p(v, {
|
|
471
468
|
htmlFor: "editScientific",
|
|
472
469
|
children: "Scientific name"
|
|
473
|
-
}), /* @__PURE__ */
|
|
470
|
+
}), /* @__PURE__ */ p(_, {
|
|
474
471
|
id: "editScientific",
|
|
475
472
|
value: K.scientificName,
|
|
476
473
|
onChange: (e) => q({
|
|
@@ -481,51 +478,51 @@ function I() {
|
|
|
481
478
|
})]
|
|
482
479
|
})]
|
|
483
480
|
}),
|
|
484
|
-
/* @__PURE__ */
|
|
481
|
+
/* @__PURE__ */ m("div", {
|
|
485
482
|
className: "grid gap-2 sm:grid-cols-2",
|
|
486
|
-
children: [/* @__PURE__ */
|
|
483
|
+
children: [/* @__PURE__ */ m("div", {
|
|
487
484
|
className: "grid gap-1.5",
|
|
488
|
-
children: [/* @__PURE__ */
|
|
485
|
+
children: [/* @__PURE__ */ p(v, {
|
|
489
486
|
htmlFor: "editTaxon",
|
|
490
487
|
children: "Taxon group"
|
|
491
|
-
}), /* @__PURE__ */
|
|
488
|
+
}), /* @__PURE__ */ m(T, {
|
|
492
489
|
value: K.taxonGroup,
|
|
493
490
|
onValueChange: (e) => q({
|
|
494
491
|
...K,
|
|
495
492
|
taxonGroup: e
|
|
496
493
|
}),
|
|
497
|
-
children: [/* @__PURE__ */
|
|
494
|
+
children: [/* @__PURE__ */ p(O, {
|
|
498
495
|
id: "editTaxon",
|
|
499
|
-
children: /* @__PURE__ */
|
|
500
|
-
}), /* @__PURE__ */
|
|
496
|
+
children: /* @__PURE__ */ p(k, {})
|
|
497
|
+
}), /* @__PURE__ */ p(E, { children: M.map((e) => /* @__PURE__ */ p(D, {
|
|
501
498
|
value: e,
|
|
502
|
-
children:
|
|
499
|
+
children: r(e)
|
|
503
500
|
}, e)) })]
|
|
504
501
|
})]
|
|
505
|
-
}), /* @__PURE__ */
|
|
502
|
+
}), /* @__PURE__ */ m("div", {
|
|
506
503
|
className: "grid gap-1.5",
|
|
507
|
-
children: [/* @__PURE__ */
|
|
504
|
+
children: [/* @__PURE__ */ p(v, {
|
|
508
505
|
htmlFor: "editConservation",
|
|
509
506
|
children: "Conservation status"
|
|
510
|
-
}), /* @__PURE__ */
|
|
507
|
+
}), /* @__PURE__ */ m(T, {
|
|
511
508
|
value: K.conservationStatus,
|
|
512
509
|
onValueChange: (e) => q({
|
|
513
510
|
...K,
|
|
514
511
|
conservationStatus: e
|
|
515
512
|
}),
|
|
516
|
-
children: [/* @__PURE__ */
|
|
513
|
+
children: [/* @__PURE__ */ p(O, {
|
|
517
514
|
id: "editConservation",
|
|
518
|
-
children: /* @__PURE__ */
|
|
519
|
-
}), /* @__PURE__ */
|
|
515
|
+
children: /* @__PURE__ */ p(k, {})
|
|
516
|
+
}), /* @__PURE__ */ p(E, { children: N.map((e) => /* @__PURE__ */ p(D, {
|
|
520
517
|
value: e,
|
|
521
|
-
children:
|
|
518
|
+
children: r(e)
|
|
522
519
|
}, e)) })]
|
|
523
520
|
})]
|
|
524
521
|
})]
|
|
525
522
|
}),
|
|
526
|
-
/* @__PURE__ */
|
|
523
|
+
/* @__PURE__ */ m("label", {
|
|
527
524
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
528
|
-
children: [/* @__PURE__ */
|
|
525
|
+
children: [/* @__PURE__ */ p("input", {
|
|
529
526
|
type: "checkbox",
|
|
530
527
|
checked: K.isPriority,
|
|
531
528
|
onChange: (e) => q({
|
|
@@ -535,12 +532,12 @@ function I() {
|
|
|
535
532
|
className: "h-4 w-4 rounded border-border-seam accent-action-primary-bg"
|
|
536
533
|
}), "Mark as priority species"]
|
|
537
534
|
}),
|
|
538
|
-
/* @__PURE__ */
|
|
535
|
+
/* @__PURE__ */ m("div", {
|
|
539
536
|
className: "grid gap-1.5",
|
|
540
|
-
children: [/* @__PURE__ */
|
|
537
|
+
children: [/* @__PURE__ */ p(v, {
|
|
541
538
|
htmlFor: "editDescription",
|
|
542
539
|
children: "Description"
|
|
543
|
-
}), /* @__PURE__ */
|
|
540
|
+
}), /* @__PURE__ */ p(A, {
|
|
544
541
|
id: "editDescription",
|
|
545
542
|
value: K.description,
|
|
546
543
|
onChange: (e) => q({
|
|
@@ -553,20 +550,20 @@ function I() {
|
|
|
553
550
|
})
|
|
554
551
|
]
|
|
555
552
|
}),
|
|
556
|
-
/* @__PURE__ */
|
|
553
|
+
/* @__PURE__ */ m(S, { children: [/* @__PURE__ */ p(h, {
|
|
557
554
|
variant: "outline",
|
|
558
555
|
onClick: () => G(!1),
|
|
559
556
|
children: "Cancel"
|
|
560
|
-
}), /* @__PURE__ */
|
|
557
|
+
}), /* @__PURE__ */ p(h, {
|
|
561
558
|
onClick: async () => {
|
|
562
|
-
if (!
|
|
559
|
+
if (!F || !K.commonName.trim()) {
|
|
563
560
|
Y("Common name is required.");
|
|
564
561
|
return;
|
|
565
562
|
}
|
|
566
563
|
Y(null);
|
|
567
564
|
try {
|
|
568
|
-
await
|
|
569
|
-
id:
|
|
565
|
+
await z.mutateAsync({
|
|
566
|
+
id: F,
|
|
570
567
|
input: {
|
|
571
568
|
commonName: K.commonName.trim(),
|
|
572
569
|
scientificName: K.scientificName.trim() || null,
|
|
@@ -580,8 +577,8 @@ function I() {
|
|
|
580
577
|
Y(e instanceof Error ? e.message : "Failed to update species.");
|
|
581
578
|
}
|
|
582
579
|
},
|
|
583
|
-
disabled:
|
|
584
|
-
children:
|
|
580
|
+
disabled: z.isPending,
|
|
581
|
+
children: z.isPending ? "Saving…" : "Save changes"
|
|
585
582
|
})] })
|
|
586
583
|
] })
|
|
587
584
|
})
|
|
@@ -589,6 +586,6 @@ function I() {
|
|
|
589
586
|
});
|
|
590
587
|
}
|
|
591
588
|
//#endregion
|
|
592
|
-
export {
|
|
589
|
+
export { F as SpeciesDetailPage };
|
|
593
590
|
|
|
594
591
|
//# sourceMappingURL=SpeciesDetailPage.js.map
|