@burdenoff/microfe-ecoimpacthub 2026.1124.3 → 2026.1201.2
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/EcoImpactHubAdminRoot.js.map +1 -1
- package/dist/ecoimpacthub/components/DashboardCustomizerDialog.js +1 -1
- package/dist/ecoimpacthub/components/DashboardCustomizerDialog.js.map +1 -1
- package/dist/ecoimpacthub/components/EcoDiscussion.js +2 -2
- package/dist/ecoimpacthub/components/EcoDiscussion.js.map +1 -1
- package/dist/ecoimpacthub/components/EcoTags.js +2 -2
- package/dist/ecoimpacthub/components/EcoTags.js.map +1 -1
- package/dist/ecoimpacthub/components/EmptyState.d.ts +14 -0
- package/dist/ecoimpacthub/components/EmptyState.js +36 -16
- package/dist/ecoimpacthub/components/EmptyState.js.map +1 -1
- package/dist/ecoimpacthub/components/EvidenceUpload.js +2 -2
- package/dist/ecoimpacthub/components/EvidenceUpload.js.map +1 -1
- package/dist/ecoimpacthub/components/FilterTabs.js +1 -1
- package/dist/ecoimpacthub/components/FilterTabs.js.map +1 -1
- package/dist/ecoimpacthub/components/Pagination.js +2 -2
- package/dist/ecoimpacthub/components/Pagination.js.map +1 -1
- package/dist/ecoimpacthub/components/ai/AiAnomalyPanel.js +5 -5
- package/dist/ecoimpacthub/components/ai/AiAnomalyPanel.js.map +1 -1
- package/dist/ecoimpacthub/components/ai/AiShared.js +1 -1
- package/dist/ecoimpacthub/components/ai/AiShared.js.map +1 -1
- package/dist/ecoimpacthub/components/ai/AiThresholdSuggest.js +2 -2
- package/dist/ecoimpacthub/components/ai/AiThresholdSuggest.js.map +1 -1
- package/dist/ecoimpacthub/components/ai/AiTriageDialog.js +1 -1
- package/dist/ecoimpacthub/components/ai/AiTriageDialog.js.map +1 -1
- package/dist/ecoimpacthub/pages/DashboardPage.js +4 -4
- package/dist/ecoimpacthub/pages/DashboardPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/_shared/UseMyLocationButton.js +2 -2
- package/dist/ecoimpacthub/pages/_shared/UseMyLocationButton.js.map +1 -1
- package/dist/ecoimpacthub/pages/ai/AiOperationsPage.js +6 -6
- package/dist/ecoimpacthub/pages/ai/AiOperationsPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/carbon/CarbonPage.js +8 -8
- package/dist/ecoimpacthub/pages/carbon/CarbonPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/carbon/DraftReviewPanel.js +4 -4
- package/dist/ecoimpacthub/pages/carbon/DraftReviewPanel.js.map +1 -1
- package/dist/ecoimpacthub/pages/carbon/DraftWithAiDialog.js +2 -2
- package/dist/ecoimpacthub/pages/carbon/DraftWithAiDialog.js.map +1 -1
- package/dist/ecoimpacthub/pages/carbon/SuggestFactorPanel.js +3 -3
- package/dist/ecoimpacthub/pages/carbon/SuggestFactorPanel.js.map +1 -1
- package/dist/ecoimpacthub/pages/carbonVisuals.js +1 -1
- package/dist/ecoimpacthub/pages/carbonVisuals.js.map +1 -1
- package/dist/ecoimpacthub/pages/circularity/CircularityPage.js +19 -19
- package/dist/ecoimpacthub/pages/circularity/CircularityPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/compliance/CompliancePage.js +8 -8
- package/dist/ecoimpacthub/pages/compliance/CompliancePage.js.map +1 -1
- package/dist/ecoimpacthub/pages/credits/CreditsPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/ehs/EhsPage.js +10 -10
- package/dist/ecoimpacthub/pages/ehs/EhsPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/energy/EnergyPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/grants/GrantDetailPage.js +5 -5
- package/dist/ecoimpacthub/pages/grants/GrantDetailPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/grants/GrantsPage.js +4 -4
- package/dist/ecoimpacthub/pages/grants/GrantsPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/habitat/HabitatProjectDetailPage.js +4 -4
- package/dist/ecoimpacthub/pages/habitat/HabitatProjectDetailPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/habitat/HabitatProjectsPage.js +2 -2
- package/dist/ecoimpacthub/pages/habitat/HabitatProjectsPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/habitat/StewardshipPage.js +1 -1
- package/dist/ecoimpacthub/pages/habitat/StewardshipPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/metrics/MetricsPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/mobile/FieldQueuePanel.js +29 -26
- package/dist/ecoimpacthub/pages/mobile/FieldQueuePanel.js.map +1 -1
- package/dist/ecoimpacthub/pages/mobile/MobileDashboardPage.js +3 -3
- package/dist/ecoimpacthub/pages/mobile/MobileDashboardPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/mobile/MobileRecordObservationPage.js +4 -4
- package/dist/ecoimpacthub/pages/mobile/MobileRecordObservationPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/mobile/MobileShell.js +1 -1
- package/dist/ecoimpacthub/pages/mobile/MobileShell.js.map +1 -1
- package/dist/ecoimpacthub/pages/monitoring/MonitoringPage.js +7 -7
- package/dist/ecoimpacthub/pages/monitoring/MonitoringPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/observations/ObservationsPage.js +3 -3
- package/dist/ecoimpacthub/pages/observations/ObservationsPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/products/ProductFootprintPage.js +127 -127
- package/dist/ecoimpacthub/pages/products/ProductFootprintPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js +10 -10
- package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/reports/ReportsPage.js +116 -113
- package/dist/ecoimpacthub/pages/reports/ReportsPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/satellite/SatellitePage.js +54 -54
- package/dist/ecoimpacthub/pages/satellite/SatellitePage.js.map +1 -1
- package/dist/ecoimpacthub/pages/sites/SiteDetailPage.js +8 -8
- package/dist/ecoimpacthub/pages/sites/SiteDetailPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/sites/SitesPage.js +105 -102
- package/dist/ecoimpacthub/pages/sites/SitesPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.js +5 -5
- package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/species/SpeciesPage.js +167 -164
- package/dist/ecoimpacthub/pages/species/SpeciesPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/suppliers/SuppliersPage.js +135 -135
- package/dist/ecoimpacthub/pages/suppliers/SuppliersPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/telemetry/TelemetryPage.js +58 -58
- package/dist/ecoimpacthub/pages/telemetry/TelemetryPage.js.map +1 -1
- package/package.json +6 -2
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { useEcoImpactHub as e } from "../../context/EcoImpactHubContext.js";
|
|
2
2
|
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
3
|
import { DataTable as ee } from "../../components/DataTable.js";
|
|
4
|
-
import { FilterTabs as
|
|
5
|
-
import { ErrorView as
|
|
6
|
-
import { EmptyState as
|
|
7
|
-
import { useEcoCreateSpecies as
|
|
8
|
-
import { useCursorPager as
|
|
9
|
-
import { Pagination as
|
|
10
|
-
import { ConservationBadge as
|
|
11
|
-
import { TaxonChip as
|
|
4
|
+
import { FilterTabs as te } from "../../components/FilterTabs.js";
|
|
5
|
+
import { ErrorView as ne, LoadingView as re } from "../../components/StateViews.js";
|
|
6
|
+
import { EmptyState as n } from "../../components/EmptyState.js";
|
|
7
|
+
import { useEcoCreateSpecies as r, useEcoSpecies as i } from "../../hooks/useEcoImpactHubApi.js";
|
|
8
|
+
import { useCursorPager as a } from "../../hooks/useCursorPager.js";
|
|
9
|
+
import { Pagination as o } from "../../components/Pagination.js";
|
|
10
|
+
import { ConservationBadge as s } from "../_shared/ConservationBadge.js";
|
|
11
|
+
import { TaxonChip as ie } from "../_shared/TaxonChip.js";
|
|
12
12
|
import "../../context/index.js";
|
|
13
13
|
import "../../hooks/index.js";
|
|
14
|
-
import { formatEnumLabel as
|
|
15
|
-
import { useMemo as
|
|
16
|
-
import { Plus as
|
|
17
|
-
import { Fragment as
|
|
18
|
-
import { Button as
|
|
14
|
+
import { formatEnumLabel as c, formatRelativeTime as ae } from "../../utils/formatters.js";
|
|
15
|
+
import { useMemo as l, useState as u } from "react";
|
|
16
|
+
import { Plus as d, Rabbit as oe, Search as f, Star as p } from "lucide-react";
|
|
17
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
18
|
+
import { Button as _, GlassCard as v, Input as y, Label as b, ResponsiveDialog as se, ResponsiveDialogContent as ce, ResponsiveDialogDescription as le, ResponsiveDialogFooter as ue, ResponsiveDialogHeader as de, ResponsiveDialogTitle as fe, Select as x, SelectContent as S, SelectItem as C, SelectTrigger as w, SelectValue as T, Textarea as pe } from "@burdenoff/fe-libs/ui";
|
|
19
|
+
import { useCreateParam as me } from "@burdenoff/fe-libs/shared/hooks";
|
|
19
20
|
// src/ecoimpacthub/pages/species/SpeciesPage.tsx
|
|
20
|
-
var
|
|
21
|
+
var E = [
|
|
21
22
|
"MAMMAL",
|
|
22
23
|
"BIRD",
|
|
23
24
|
"REPTILE",
|
|
@@ -27,7 +28,7 @@ var T = [
|
|
|
27
28
|
"PLANT",
|
|
28
29
|
"FUNGI",
|
|
29
30
|
"OTHER"
|
|
30
|
-
],
|
|
31
|
+
], D = [
|
|
31
32
|
"LEAST_CONCERN",
|
|
32
33
|
"NEAR_THREATENED",
|
|
33
34
|
"VULNERABLE",
|
|
@@ -36,7 +37,7 @@ var T = [
|
|
|
36
37
|
"EXTINCT_IN_WILD",
|
|
37
38
|
"DATA_DEFICIENT",
|
|
38
39
|
"NOT_EVALUATED"
|
|
39
|
-
],
|
|
40
|
+
], O = {
|
|
40
41
|
EXTINCT_IN_WILD: 0,
|
|
41
42
|
CRITICALLY_ENDANGERED: 1,
|
|
42
43
|
ENDANGERED: 2,
|
|
@@ -45,13 +46,13 @@ var T = [
|
|
|
45
46
|
LEAST_CONCERN: 5,
|
|
46
47
|
DATA_DEFICIENT: 6,
|
|
47
48
|
NOT_EVALUATED: 7
|
|
48
|
-
},
|
|
49
|
+
}, k = 99, A = [{
|
|
49
50
|
value: "ALL",
|
|
50
51
|
label: "All species"
|
|
51
52
|
}, {
|
|
52
53
|
value: "PRIORITY",
|
|
53
54
|
label: "Priority only"
|
|
54
|
-
}],
|
|
55
|
+
}], j = 25, M = {
|
|
55
56
|
commonName: "",
|
|
56
57
|
scientificName: "",
|
|
57
58
|
taxonGroup: "MAMMAL",
|
|
@@ -59,26 +60,28 @@ var T = [
|
|
|
59
60
|
isPriority: !1,
|
|
60
61
|
description: ""
|
|
61
62
|
};
|
|
62
|
-
function
|
|
63
|
-
let { navigateTo:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
function N() {
|
|
64
|
+
let { navigateTo: N } = e(), [P, F] = u("ALL"), [I, L] = u("ALL"), [R, z] = u("ALL"), [B, V] = u(""), H = a(), [he, U] = u(!1);
|
|
65
|
+
me(U);
|
|
66
|
+
let [W, G] = u(M), [K, q] = u(null), { data: J, isLoading: ge, isError: _e, refetch: ve } = i({
|
|
67
|
+
taxonGroup: P === "ALL" ? void 0 : P,
|
|
68
|
+
conservationStatus: I === "ALL" ? void 0 : I,
|
|
69
|
+
priorityOnly: R === "PRIORITY" || void 0,
|
|
67
70
|
pagination: {
|
|
68
|
-
limit:
|
|
69
|
-
cursor:
|
|
71
|
+
limit: j,
|
|
72
|
+
cursor: H.cursor
|
|
70
73
|
}
|
|
71
|
-
}), Y =
|
|
74
|
+
}), Y = r(), X = l(() => J?.items ?? [], [J]), Z = B.trim().toLowerCase(), Q = l(() => Z ? X.filter((e) => e.commonName.toLowerCase().includes(Z) || (e.scientificName?.toLowerCase().includes(Z) ?? !1)) : X, [X, Z]), ye = [
|
|
72
75
|
{
|
|
73
76
|
key: "name",
|
|
74
77
|
header: "Species",
|
|
75
78
|
sortValue: (e) => e.commonName.toLowerCase(),
|
|
76
|
-
render: (e) => /* @__PURE__ */
|
|
79
|
+
render: (e) => /* @__PURE__ */ g("div", {
|
|
77
80
|
className: "min-w-0",
|
|
78
|
-
children: [/* @__PURE__ */
|
|
81
|
+
children: [/* @__PURE__ */ h("p", {
|
|
79
82
|
className: "font-semibold text-text-primary",
|
|
80
83
|
children: e.commonName
|
|
81
|
-
}), e.scientificName && /* @__PURE__ */
|
|
84
|
+
}), e.scientificName && /* @__PURE__ */ h("p", {
|
|
82
85
|
className: "truncate text-xs italic text-text-tertiary",
|
|
83
86
|
children: e.scientificName
|
|
84
87
|
})]
|
|
@@ -89,24 +92,24 @@ function M() {
|
|
|
89
92
|
header: "Taxon",
|
|
90
93
|
hideOnMobile: !0,
|
|
91
94
|
sortValue: (e) => e.taxonGroup.toUpperCase(),
|
|
92
|
-
render: (e) => /* @__PURE__ */
|
|
95
|
+
render: (e) => /* @__PURE__ */ h(ie, { group: e.taxonGroup })
|
|
93
96
|
},
|
|
94
97
|
{
|
|
95
98
|
key: "conservationStatus",
|
|
96
99
|
header: "Conservation status",
|
|
97
|
-
sortValue: (e) =>
|
|
98
|
-
render: (e) => /* @__PURE__ */
|
|
100
|
+
sortValue: (e) => O[e.conservationStatus.toUpperCase()] ?? k,
|
|
101
|
+
render: (e) => /* @__PURE__ */ h(s, { status: e.conservationStatus })
|
|
99
102
|
},
|
|
100
103
|
{
|
|
101
104
|
key: "priority",
|
|
102
105
|
header: "Priority",
|
|
103
106
|
align: "center",
|
|
104
107
|
sortValue: (e) => +!e.isPriority,
|
|
105
|
-
render: (e) => e.isPriority ? /* @__PURE__ */
|
|
108
|
+
render: (e) => e.isPriority ? /* @__PURE__ */ h("span", {
|
|
106
109
|
className: "inline-flex items-center justify-center gap-1 rounded-full bg-status-warning-bg-subtle px-2 py-0.5 text-status-warning-text",
|
|
107
110
|
title: "Priority species",
|
|
108
|
-
children: /* @__PURE__ */ p
|
|
109
|
-
}) : /* @__PURE__ */
|
|
111
|
+
children: /* @__PURE__ */ h(p, { className: "h-3.5 w-3.5 fill-current" })
|
|
112
|
+
}) : /* @__PURE__ */ h("span", {
|
|
110
113
|
className: "text-text-tertiary",
|
|
111
114
|
title: "Not prioritised",
|
|
112
115
|
children: "—"
|
|
@@ -121,280 +124,280 @@ function M() {
|
|
|
121
124
|
let t = new Date(e.updatedAt).getTime();
|
|
122
125
|
return Number.isNaN(t) ? 0 : t;
|
|
123
126
|
},
|
|
124
|
-
render: (e) => /* @__PURE__ */
|
|
127
|
+
render: (e) => /* @__PURE__ */ h("span", {
|
|
125
128
|
className: "whitespace-nowrap text-text-tertiary",
|
|
126
|
-
children:
|
|
129
|
+
children: ae(e.updatedAt)
|
|
127
130
|
})
|
|
128
131
|
}
|
|
129
132
|
], $ = () => {
|
|
130
|
-
|
|
133
|
+
G(M), q(null);
|
|
131
134
|
};
|
|
132
|
-
return /* @__PURE__ */
|
|
135
|
+
return /* @__PURE__ */ g(t, {
|
|
133
136
|
title: "Species",
|
|
134
137
|
description: "Tracked taxa — conservation status, priority focus & field observations.",
|
|
135
|
-
actions: /* @__PURE__ */
|
|
136
|
-
onClick: () =>
|
|
137
|
-
children: [/* @__PURE__ */
|
|
138
|
+
actions: /* @__PURE__ */ g(_, {
|
|
139
|
+
onClick: () => U(!0),
|
|
140
|
+
children: [/* @__PURE__ */ h(d, { className: "me-1.5 h-4 w-4" }), " New species"]
|
|
138
141
|
}),
|
|
139
142
|
children: [
|
|
140
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ h(v, {
|
|
141
144
|
treatment: "plain",
|
|
142
145
|
className: "mb-5 p-4",
|
|
143
|
-
children: /* @__PURE__ */
|
|
146
|
+
children: /* @__PURE__ */ g("div", {
|
|
144
147
|
className: "flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
148
|
+
children: [/* @__PURE__ */ g("div", {
|
|
146
149
|
className: "flex flex-wrap items-end gap-3",
|
|
147
150
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ g("div", {
|
|
149
152
|
className: "grid gap-1.5",
|
|
150
|
-
children: [/* @__PURE__ */
|
|
153
|
+
children: [/* @__PURE__ */ h("span", {
|
|
151
154
|
className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
|
|
152
155
|
children: "Taxon group"
|
|
153
|
-
}), /* @__PURE__ */
|
|
154
|
-
value:
|
|
156
|
+
}), /* @__PURE__ */ g(x, {
|
|
157
|
+
value: P,
|
|
155
158
|
onValueChange: (e) => {
|
|
156
|
-
|
|
159
|
+
F(e), H.reset();
|
|
157
160
|
},
|
|
158
|
-
children: [/* @__PURE__ */
|
|
161
|
+
children: [/* @__PURE__ */ h(w, {
|
|
159
162
|
className: "w-44",
|
|
160
|
-
children: /* @__PURE__ */
|
|
161
|
-
}), /* @__PURE__ */
|
|
163
|
+
children: /* @__PURE__ */ h(T, { placeholder: "All groups" })
|
|
164
|
+
}), /* @__PURE__ */ g(S, { children: [/* @__PURE__ */ h(C, {
|
|
162
165
|
value: "ALL",
|
|
163
166
|
children: "All groups"
|
|
164
|
-
}),
|
|
167
|
+
}), E.map((e) => /* @__PURE__ */ h(C, {
|
|
165
168
|
value: e,
|
|
166
|
-
children:
|
|
169
|
+
children: c(e)
|
|
167
170
|
}, e))] })]
|
|
168
171
|
})]
|
|
169
172
|
}),
|
|
170
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ g("div", {
|
|
171
174
|
className: "grid gap-1.5",
|
|
172
|
-
children: [/* @__PURE__ */
|
|
175
|
+
children: [/* @__PURE__ */ h("span", {
|
|
173
176
|
className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
|
|
174
177
|
children: "Conservation status"
|
|
175
|
-
}), /* @__PURE__ */
|
|
176
|
-
value:
|
|
178
|
+
}), /* @__PURE__ */ g(x, {
|
|
179
|
+
value: I,
|
|
177
180
|
onValueChange: (e) => {
|
|
178
|
-
|
|
181
|
+
L(e), H.reset();
|
|
179
182
|
},
|
|
180
|
-
children: [/* @__PURE__ */
|
|
183
|
+
children: [/* @__PURE__ */ h(w, {
|
|
181
184
|
className: "w-52",
|
|
182
|
-
children: /* @__PURE__ */
|
|
183
|
-
}), /* @__PURE__ */
|
|
185
|
+
children: /* @__PURE__ */ h(T, { placeholder: "All conservation" })
|
|
186
|
+
}), /* @__PURE__ */ g(S, { children: [/* @__PURE__ */ h(C, {
|
|
184
187
|
value: "ALL",
|
|
185
188
|
children: "All conservation"
|
|
186
|
-
}),
|
|
189
|
+
}), D.map((e) => /* @__PURE__ */ h(C, {
|
|
187
190
|
value: e,
|
|
188
|
-
children:
|
|
191
|
+
children: c(e)
|
|
189
192
|
}, e))] })]
|
|
190
193
|
})]
|
|
191
194
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ g("div", {
|
|
193
196
|
className: "grid gap-1.5",
|
|
194
|
-
children: [/* @__PURE__ */
|
|
197
|
+
children: [/* @__PURE__ */ h("span", {
|
|
195
198
|
className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
|
|
196
199
|
children: "Search this page"
|
|
197
|
-
}), /* @__PURE__ */
|
|
200
|
+
}), /* @__PURE__ */ g("div", {
|
|
198
201
|
className: "relative",
|
|
199
|
-
children: [/* @__PURE__ */
|
|
200
|
-
value:
|
|
201
|
-
onChange: (e) =>
|
|
202
|
+
children: [/* @__PURE__ */ h(f, { className: "pointer-events-none absolute start-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-tertiary" }), /* @__PURE__ */ h(y, {
|
|
203
|
+
value: B,
|
|
204
|
+
onChange: (e) => V(e.target.value),
|
|
202
205
|
placeholder: "Common or scientific name…",
|
|
203
|
-
className: "w-full
|
|
206
|
+
className: "w-full ps-9 sm:w-64",
|
|
204
207
|
"aria-label": "Search loaded species by name"
|
|
205
208
|
})]
|
|
206
209
|
})]
|
|
207
210
|
})
|
|
208
211
|
]
|
|
209
|
-
}), /* @__PURE__ */
|
|
210
|
-
options:
|
|
211
|
-
value:
|
|
212
|
+
}), /* @__PURE__ */ h(te, {
|
|
213
|
+
options: A,
|
|
214
|
+
value: R,
|
|
212
215
|
onChange: (e) => {
|
|
213
|
-
|
|
216
|
+
z(e), H.reset();
|
|
214
217
|
}
|
|
215
218
|
})]
|
|
216
219
|
})
|
|
217
220
|
}),
|
|
218
|
-
ge ? /* @__PURE__ */
|
|
221
|
+
ge ? /* @__PURE__ */ h(re, { label: "Loading species…" }) : _e ? /* @__PURE__ */ h(ne, {
|
|
219
222
|
message: "Couldn't load species.",
|
|
220
|
-
onRetry: () =>
|
|
221
|
-
}) : X.length === 0 ? /* @__PURE__ */
|
|
223
|
+
onRetry: () => ve()
|
|
224
|
+
}) : X.length === 0 ? /* @__PURE__ */ h(n, {
|
|
222
225
|
illustration: "empty-data",
|
|
223
|
-
icon: /* @__PURE__ */
|
|
226
|
+
icon: /* @__PURE__ */ h(oe, { className: "h-10 w-10" }),
|
|
224
227
|
title: "No species yet",
|
|
225
|
-
description:
|
|
226
|
-
action: /* @__PURE__ */
|
|
227
|
-
onClick: () =>
|
|
228
|
-
children: [/* @__PURE__ */
|
|
228
|
+
description: P === "ALL" && I === "ALL" && R === "ALL" ? "Register your first species to start logging field observations." : "No species match these filters.",
|
|
229
|
+
action: /* @__PURE__ */ g(_, {
|
|
230
|
+
onClick: () => U(!0),
|
|
231
|
+
children: [/* @__PURE__ */ h(d, { className: "me-1.5 h-4 w-4" }), " New species"]
|
|
229
232
|
})
|
|
230
|
-
}) : Q.length === 0 ? /* @__PURE__ */
|
|
231
|
-
icon: /* @__PURE__ */
|
|
233
|
+
}) : Q.length === 0 ? /* @__PURE__ */ h(n, {
|
|
234
|
+
icon: /* @__PURE__ */ h(f, { className: "h-10 w-10" }),
|
|
232
235
|
title: "No matches on this page",
|
|
233
|
-
description: `No species on this page match “${
|
|
234
|
-
action: /* @__PURE__ */
|
|
236
|
+
description: `No species on this page match “${B.trim()}”. Clear the search or page through the catalog.`,
|
|
237
|
+
action: /* @__PURE__ */ h(_, {
|
|
235
238
|
variant: "outline",
|
|
236
|
-
onClick: () =>
|
|
239
|
+
onClick: () => V(""),
|
|
237
240
|
children: "Clear search"
|
|
238
241
|
})
|
|
239
|
-
}) : /* @__PURE__ */ m
|
|
240
|
-
columns:
|
|
242
|
+
}) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(ee, {
|
|
243
|
+
columns: ye,
|
|
241
244
|
rows: Q,
|
|
242
245
|
rowKey: (e) => e.id,
|
|
243
|
-
onRowClick: (e) =>
|
|
244
|
-
}), Z ? /* @__PURE__ */
|
|
246
|
+
onRowClick: (e) => N(`species/${e.id}`)
|
|
247
|
+
}), Z ? /* @__PURE__ */ g("p", {
|
|
245
248
|
className: "mt-4 text-sm text-text-secondary tabular-nums",
|
|
246
249
|
children: [
|
|
247
250
|
Q.length,
|
|
248
251
|
" of ",
|
|
249
252
|
X.length,
|
|
250
253
|
" on this page match “",
|
|
251
|
-
|
|
254
|
+
B.trim(),
|
|
252
255
|
"”"
|
|
253
256
|
]
|
|
254
|
-
}) : /* @__PURE__ */
|
|
255
|
-
page:
|
|
256
|
-
pageSize:
|
|
257
|
+
}) : /* @__PURE__ */ h(o, {
|
|
258
|
+
page: H.page,
|
|
259
|
+
pageSize: j,
|
|
257
260
|
itemCount: X.length,
|
|
258
|
-
hasMore:
|
|
259
|
-
onPageChange: (e) =>
|
|
261
|
+
hasMore: J?.pageInfo?.hasMore ?? !1,
|
|
262
|
+
onPageChange: (e) => H.onPageChange(e, J?.pageInfo?.cursor)
|
|
260
263
|
})] }),
|
|
261
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ h(se, {
|
|
262
265
|
open: he,
|
|
263
266
|
onOpenChange: (e) => {
|
|
264
|
-
|
|
267
|
+
U(e), e || $();
|
|
265
268
|
},
|
|
266
|
-
children: /* @__PURE__ */
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
+
children: /* @__PURE__ */ g(ce, { children: [
|
|
270
|
+
/* @__PURE__ */ g(de, { children: [/* @__PURE__ */ h(fe, { children: "New species" }), /* @__PURE__ */ h(le, { children: "Register a taxon to track its conservation status and field observations." })] }),
|
|
271
|
+
/* @__PURE__ */ g("div", {
|
|
269
272
|
className: "grid gap-4 py-2",
|
|
270
273
|
children: [
|
|
271
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ g("div", {
|
|
272
275
|
className: "grid gap-2 sm:grid-cols-2",
|
|
273
|
-
children: [/* @__PURE__ */
|
|
276
|
+
children: [/* @__PURE__ */ g("div", {
|
|
274
277
|
className: "grid gap-1.5",
|
|
275
|
-
children: [/* @__PURE__ */
|
|
278
|
+
children: [/* @__PURE__ */ h(b, {
|
|
276
279
|
htmlFor: "commonName",
|
|
277
280
|
children: "Common name *"
|
|
278
|
-
}), /* @__PURE__ */
|
|
281
|
+
}), /* @__PURE__ */ h(y, {
|
|
279
282
|
id: "commonName",
|
|
280
|
-
value:
|
|
281
|
-
onChange: (e) =>
|
|
282
|
-
...
|
|
283
|
+
value: W.commonName,
|
|
284
|
+
onChange: (e) => G({
|
|
285
|
+
...W,
|
|
283
286
|
commonName: e.target.value
|
|
284
287
|
}),
|
|
285
288
|
placeholder: "Indian Pangolin"
|
|
286
289
|
})]
|
|
287
|
-
}), /* @__PURE__ */
|
|
290
|
+
}), /* @__PURE__ */ g("div", {
|
|
288
291
|
className: "grid gap-1.5",
|
|
289
|
-
children: [/* @__PURE__ */
|
|
292
|
+
children: [/* @__PURE__ */ h(b, {
|
|
290
293
|
htmlFor: "scientificName",
|
|
291
294
|
children: "Scientific name"
|
|
292
|
-
}), /* @__PURE__ */
|
|
295
|
+
}), /* @__PURE__ */ h(y, {
|
|
293
296
|
id: "scientificName",
|
|
294
|
-
value:
|
|
295
|
-
onChange: (e) =>
|
|
296
|
-
...
|
|
297
|
+
value: W.scientificName,
|
|
298
|
+
onChange: (e) => G({
|
|
299
|
+
...W,
|
|
297
300
|
scientificName: e.target.value
|
|
298
301
|
}),
|
|
299
302
|
placeholder: "Manis crassicaudata"
|
|
300
303
|
})]
|
|
301
304
|
})]
|
|
302
305
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ g("div", {
|
|
304
307
|
className: "grid gap-2 sm:grid-cols-2",
|
|
305
|
-
children: [/* @__PURE__ */
|
|
308
|
+
children: [/* @__PURE__ */ g("div", {
|
|
306
309
|
className: "grid gap-1.5",
|
|
307
|
-
children: [/* @__PURE__ */
|
|
310
|
+
children: [/* @__PURE__ */ h(b, {
|
|
308
311
|
htmlFor: "taxonGroup",
|
|
309
312
|
children: "Taxon group"
|
|
310
|
-
}), /* @__PURE__ */
|
|
311
|
-
value:
|
|
312
|
-
onValueChange: (e) =>
|
|
313
|
-
...
|
|
313
|
+
}), /* @__PURE__ */ g(x, {
|
|
314
|
+
value: W.taxonGroup,
|
|
315
|
+
onValueChange: (e) => G({
|
|
316
|
+
...W,
|
|
314
317
|
taxonGroup: e
|
|
315
318
|
}),
|
|
316
|
-
children: [/* @__PURE__ */
|
|
319
|
+
children: [/* @__PURE__ */ h(w, {
|
|
317
320
|
id: "taxonGroup",
|
|
318
|
-
children: /* @__PURE__ */
|
|
319
|
-
}), /* @__PURE__ */
|
|
321
|
+
children: /* @__PURE__ */ h(T, {})
|
|
322
|
+
}), /* @__PURE__ */ h(S, { children: E.map((e) => /* @__PURE__ */ h(C, {
|
|
320
323
|
value: e,
|
|
321
|
-
children:
|
|
324
|
+
children: c(e)
|
|
322
325
|
}, e)) })]
|
|
323
326
|
})]
|
|
324
|
-
}), /* @__PURE__ */
|
|
327
|
+
}), /* @__PURE__ */ g("div", {
|
|
325
328
|
className: "grid gap-1.5",
|
|
326
|
-
children: [/* @__PURE__ */
|
|
329
|
+
children: [/* @__PURE__ */ h(b, {
|
|
327
330
|
htmlFor: "conservationStatus",
|
|
328
331
|
children: "Conservation status"
|
|
329
|
-
}), /* @__PURE__ */
|
|
330
|
-
value:
|
|
331
|
-
onValueChange: (e) =>
|
|
332
|
-
...
|
|
332
|
+
}), /* @__PURE__ */ g(x, {
|
|
333
|
+
value: W.conservationStatus,
|
|
334
|
+
onValueChange: (e) => G({
|
|
335
|
+
...W,
|
|
333
336
|
conservationStatus: e
|
|
334
337
|
}),
|
|
335
|
-
children: [/* @__PURE__ */
|
|
338
|
+
children: [/* @__PURE__ */ h(w, {
|
|
336
339
|
id: "conservationStatus",
|
|
337
|
-
children: /* @__PURE__ */
|
|
338
|
-
}), /* @__PURE__ */
|
|
340
|
+
children: /* @__PURE__ */ h(T, {})
|
|
341
|
+
}), /* @__PURE__ */ h(S, { children: D.map((e) => /* @__PURE__ */ h(C, {
|
|
339
342
|
value: e,
|
|
340
|
-
children:
|
|
343
|
+
children: c(e)
|
|
341
344
|
}, e)) })]
|
|
342
345
|
})]
|
|
343
346
|
})]
|
|
344
347
|
}),
|
|
345
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ g("label", {
|
|
346
349
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
347
|
-
children: [/* @__PURE__ */
|
|
350
|
+
children: [/* @__PURE__ */ h("input", {
|
|
348
351
|
type: "checkbox",
|
|
349
|
-
checked:
|
|
350
|
-
onChange: (e) =>
|
|
351
|
-
...
|
|
352
|
+
checked: W.isPriority,
|
|
353
|
+
onChange: (e) => G({
|
|
354
|
+
...W,
|
|
352
355
|
isPriority: e.target.checked
|
|
353
356
|
}),
|
|
354
357
|
className: "h-4 w-4 rounded border-border-seam accent-action-primary-bg"
|
|
355
358
|
}), "Mark as priority species"]
|
|
356
359
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
360
|
+
/* @__PURE__ */ g("div", {
|
|
358
361
|
className: "grid gap-1.5",
|
|
359
|
-
children: [/* @__PURE__ */
|
|
362
|
+
children: [/* @__PURE__ */ h(b, {
|
|
360
363
|
htmlFor: "description",
|
|
361
364
|
children: "Description"
|
|
362
|
-
}), /* @__PURE__ */
|
|
365
|
+
}), /* @__PURE__ */ h(pe, {
|
|
363
366
|
id: "description",
|
|
364
|
-
value:
|
|
365
|
-
onChange: (e) =>
|
|
366
|
-
...
|
|
367
|
+
value: W.description,
|
|
368
|
+
onChange: (e) => G({
|
|
369
|
+
...W,
|
|
367
370
|
description: e.target.value
|
|
368
371
|
}),
|
|
369
372
|
placeholder: "Optional notes on habitat, range or identification.",
|
|
370
373
|
rows: 2
|
|
371
374
|
})]
|
|
372
375
|
}),
|
|
373
|
-
|
|
376
|
+
K && /* @__PURE__ */ h("p", {
|
|
374
377
|
className: "text-sm text-status-error-text",
|
|
375
|
-
children:
|
|
378
|
+
children: K
|
|
376
379
|
})
|
|
377
380
|
]
|
|
378
381
|
}),
|
|
379
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ g(ue, { children: [/* @__PURE__ */ h(_, {
|
|
380
383
|
variant: "outline",
|
|
381
|
-
onClick: () =>
|
|
384
|
+
onClick: () => U(!1),
|
|
382
385
|
children: "Cancel"
|
|
383
|
-
}), /* @__PURE__ */
|
|
386
|
+
}), /* @__PURE__ */ h(_, {
|
|
384
387
|
onClick: async () => {
|
|
385
|
-
if (!
|
|
388
|
+
if (!W.commonName.trim()) q("Common name is required.");
|
|
386
389
|
else try {
|
|
387
390
|
let e = await Y.mutateAsync({
|
|
388
|
-
commonName:
|
|
389
|
-
scientificName:
|
|
390
|
-
taxonGroup:
|
|
391
|
-
conservationStatus:
|
|
392
|
-
isPriority:
|
|
393
|
-
description:
|
|
391
|
+
commonName: W.commonName.trim(),
|
|
392
|
+
scientificName: W.scientificName.trim() || null,
|
|
393
|
+
taxonGroup: W.taxonGroup,
|
|
394
|
+
conservationStatus: W.conservationStatus,
|
|
395
|
+
isPriority: W.isPriority,
|
|
396
|
+
description: W.description.trim() || null
|
|
394
397
|
});
|
|
395
|
-
|
|
398
|
+
U(!1), $(), N(`species/${e.id}`);
|
|
396
399
|
} catch (e) {
|
|
397
|
-
|
|
400
|
+
q(e instanceof Error ? e.message : "Failed to create species.");
|
|
398
401
|
}
|
|
399
402
|
},
|
|
400
403
|
disabled: Y.isPending,
|
|
@@ -405,6 +408,6 @@ function M() {
|
|
|
405
408
|
]
|
|
406
409
|
});
|
|
407
410
|
}
|
|
408
|
-
export {
|
|
411
|
+
export { N as SpeciesPage };
|
|
409
412
|
|
|
410
413
|
//# sourceMappingURL=SpeciesPage.js.map
|