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