@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,303 +1,339 @@
|
|
|
1
1
|
import { useEcoImpactHub as e } from "../../context/EcoImpactHubContext.js";
|
|
2
2
|
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
|
-
import { formatDate as n,
|
|
4
|
-
import { StatusBadge as
|
|
5
|
-
import { ErrorView as
|
|
6
|
-
import { EmptyState as
|
|
3
|
+
import { formatDate as n, formatNumber as r } from "../../utils/formatters.js";
|
|
4
|
+
import { StatusBadge as i } from "../../components/StatusBadge.js";
|
|
5
|
+
import { ErrorView as a, LoadingView as o, Section as s } from "../../components/StateViews.js";
|
|
6
|
+
import { EmptyState as c } from "../../components/EmptyState.js";
|
|
7
7
|
import "../../context/index.js";
|
|
8
|
-
import { useEcoAddReportLineItem as
|
|
8
|
+
import { useEcoAddReportLineItem as l, useEcoPublishReport as u, useEcoReport as d } from "../../hooks/useEcoImpactHubApi.js";
|
|
9
9
|
import "../../hooks/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import { EvidenceUpload as
|
|
12
|
-
import { FileLink as
|
|
13
|
-
import { EcoDiscussion as
|
|
14
|
-
import { useMemo as
|
|
15
|
-
import { ArrowLeft as
|
|
16
|
-
import { useParams as
|
|
17
|
-
import { Fragment as
|
|
18
|
-
import { Button as
|
|
10
|
+
import { FrameworkBadge as f } from "../badges.js";
|
|
11
|
+
import { EvidenceUpload as p } from "../../components/EvidenceUpload.js";
|
|
12
|
+
import { FileLink as m } from "../../components/FileLink.js";
|
|
13
|
+
import { EcoDiscussion as h } from "../../components/EcoDiscussion.js";
|
|
14
|
+
import { useMemo as g, useState as _ } from "react";
|
|
15
|
+
import { ArrowLeft as v, ListPlus as y, Send as b } from "lucide-react";
|
|
16
|
+
import { useParams as x } from "react-router-dom";
|
|
17
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
18
|
+
import { Button as T, GlassCard as E, Input as D, Label as O, ResponsiveDialog as k, ResponsiveDialogContent as ee, ResponsiveDialogDescription as A, ResponsiveDialogFooter as j, ResponsiveDialogHeader as M, ResponsiveDialogTitle as N } from "@burdenoff/fe-libs/ui";
|
|
19
19
|
//#region src/ecoimpacthub/pages/reports/ReportDetailPage.tsx
|
|
20
|
-
function
|
|
21
|
-
|
|
20
|
+
function P({ label: e, children: t }) {
|
|
21
|
+
return /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("dt", {
|
|
22
|
+
className: "text-xs text-text-tertiary",
|
|
23
|
+
children: e
|
|
24
|
+
}), /* @__PURE__ */ C("dd", {
|
|
25
|
+
className: "mt-1 text-sm text-text-primary",
|
|
26
|
+
children: t
|
|
27
|
+
})] });
|
|
28
|
+
}
|
|
29
|
+
function F() {
|
|
30
|
+
let { id: F } = x(), { navigateTo: I } = e(), { data: L, isLoading: R, isError: z, refetch: B } = d(F), V = l(), H = u(), [U, W] = _(!1), [G, K] = _({
|
|
22
31
|
label: "",
|
|
23
32
|
value: "",
|
|
24
33
|
unit: "",
|
|
25
34
|
category: "",
|
|
26
35
|
carbonEntryId: ""
|
|
27
|
-
}), [
|
|
28
|
-
|
|
36
|
+
}), [q, J] = _(null), [Y, X] = _(null), Z = g(() => L?.lineItems ?? [], [L]), Q = g(() => Z.reduce((e, t) => e + t.value, 0), [Z]), $ = g(() => {
|
|
37
|
+
let e = new Set(Z.map((e) => e.unit));
|
|
38
|
+
return e.size === 1 ? [...e][0] : null;
|
|
39
|
+
}, [Z]);
|
|
40
|
+
if (R) return /* @__PURE__ */ C(t, {
|
|
29
41
|
title: "Report",
|
|
30
|
-
children: /* @__PURE__ */
|
|
31
|
-
})
|
|
42
|
+
children: /* @__PURE__ */ C(o, {})
|
|
43
|
+
});
|
|
44
|
+
if (z || !L) return /* @__PURE__ */ C(t, {
|
|
32
45
|
title: "Report",
|
|
33
|
-
children: /* @__PURE__ */
|
|
46
|
+
children: /* @__PURE__ */ C(a, {
|
|
34
47
|
message: "This report could not be loaded.",
|
|
35
|
-
onRetry: () =>
|
|
48
|
+
onRetry: () => B()
|
|
36
49
|
})
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
50
|
+
});
|
|
51
|
+
let te = L.status === "PUBLISHED";
|
|
52
|
+
return /* @__PURE__ */ w(t, {
|
|
53
|
+
title: /* @__PURE__ */ w("span", {
|
|
54
|
+
className: "flex flex-wrap items-center gap-x-3 gap-y-2",
|
|
55
|
+
children: [/* @__PURE__ */ C("span", {
|
|
56
|
+
className: "text-text-primary",
|
|
57
|
+
children: L.title
|
|
58
|
+
}), /* @__PURE__ */ C(f, { framework: L.framework })]
|
|
59
|
+
}),
|
|
60
|
+
description: `Reporting period ${n(L.periodStart)} – ${n(L.periodEnd)}`,
|
|
61
|
+
actions: /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(i, { status: L.status }), /* @__PURE__ */ w(T, {
|
|
41
62
|
variant: "ghost",
|
|
42
|
-
onClick: () =>
|
|
43
|
-
children: [/* @__PURE__ */
|
|
63
|
+
onClick: () => I("reports"),
|
|
64
|
+
children: [/* @__PURE__ */ C(v, { className: "mr-1.5 h-4 w-4" }), " Back"]
|
|
44
65
|
})] }),
|
|
45
66
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ w("div", {
|
|
47
68
|
className: "grid grid-cols-1 gap-4 lg:grid-cols-3",
|
|
48
|
-
children: [/* @__PURE__ */ E
|
|
69
|
+
children: [/* @__PURE__ */ w(E, {
|
|
49
70
|
treatment: "glass",
|
|
50
71
|
className: "p-6 lg:col-span-2",
|
|
51
|
-
children: [/* @__PURE__ */
|
|
72
|
+
children: [/* @__PURE__ */ w("dl", {
|
|
52
73
|
className: "grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3",
|
|
53
74
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
|
|
56
|
-
children:
|
|
57
|
-
}),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
className: "text-xs text-text-tertiary",
|
|
88
|
-
children: "Line items"
|
|
89
|
-
}), /* @__PURE__ */ T("dd", {
|
|
90
|
-
className: "mt-0.5 text-sm text-text-primary tabular-nums",
|
|
91
|
-
children: $.length
|
|
92
|
-
})] }),
|
|
93
|
-
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
|
|
94
|
-
className: "text-xs text-text-tertiary",
|
|
95
|
-
children: "Attachment"
|
|
96
|
-
}), /* @__PURE__ */ T("dd", {
|
|
97
|
-
className: "mt-0.5 text-sm",
|
|
98
|
-
children: z.file?.id ? /* @__PURE__ */ T(h, { fileId: z.file.id }) : /* @__PURE__ */ T("span", {
|
|
75
|
+
/* @__PURE__ */ C(P, {
|
|
76
|
+
label: "Framework",
|
|
77
|
+
children: /* @__PURE__ */ C(f, { framework: L.framework })
|
|
78
|
+
}),
|
|
79
|
+
/* @__PURE__ */ C(P, {
|
|
80
|
+
label: "Status",
|
|
81
|
+
children: /* @__PURE__ */ C(i, { status: L.status })
|
|
82
|
+
}),
|
|
83
|
+
/* @__PURE__ */ C(P, {
|
|
84
|
+
label: "Period",
|
|
85
|
+
children: /* @__PURE__ */ w("span", {
|
|
86
|
+
className: "tabular-nums",
|
|
87
|
+
children: [
|
|
88
|
+
n(L.periodStart),
|
|
89
|
+
" – ",
|
|
90
|
+
n(L.periodEnd)
|
|
91
|
+
]
|
|
92
|
+
})
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ C(P, {
|
|
95
|
+
label: "Published",
|
|
96
|
+
children: n(L.publishedAt)
|
|
97
|
+
}),
|
|
98
|
+
/* @__PURE__ */ C(P, {
|
|
99
|
+
label: "Line items",
|
|
100
|
+
children: /* @__PURE__ */ C("span", {
|
|
101
|
+
className: "tabular-nums",
|
|
102
|
+
children: Z.length
|
|
103
|
+
})
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ C(P, {
|
|
106
|
+
label: "Attachment",
|
|
107
|
+
children: L.file?.id ? /* @__PURE__ */ C(m, { fileId: L.file.id }) : /* @__PURE__ */ C("span", {
|
|
99
108
|
className: "text-text-tertiary",
|
|
100
109
|
children: "—"
|
|
101
110
|
})
|
|
102
|
-
})
|
|
111
|
+
})
|
|
103
112
|
]
|
|
104
|
-
}),
|
|
113
|
+
}), L.summary && /* @__PURE__ */ C("p", {
|
|
105
114
|
className: "mt-5 rounded-lg bg-bg-sunken/60 p-3 text-sm text-text-secondary",
|
|
106
|
-
children:
|
|
115
|
+
children: L.summary
|
|
107
116
|
})]
|
|
108
|
-
}), /* @__PURE__ */ E
|
|
117
|
+
}), /* @__PURE__ */ w(E, {
|
|
109
118
|
treatment: "glass",
|
|
110
119
|
className: "flex flex-col gap-3 p-6",
|
|
111
120
|
children: [
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
className: "text-xs text-text-tertiary",
|
|
114
|
-
children: "
|
|
121
|
+
/* @__PURE__ */ C("p", {
|
|
122
|
+
className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
|
|
123
|
+
children: "Actions"
|
|
115
124
|
}),
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
onClick: () =>
|
|
118
|
-
children: [/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ w(T, {
|
|
126
|
+
onClick: () => W(!0),
|
|
127
|
+
children: [/* @__PURE__ */ C(y, { className: "mr-1.5 h-4 w-4" }), " Add line item"]
|
|
119
128
|
}),
|
|
120
|
-
|
|
129
|
+
te ? /* @__PURE__ */ w("p", {
|
|
130
|
+
className: "mt-1 text-sm text-text-secondary",
|
|
131
|
+
children: [
|
|
132
|
+
"Published ",
|
|
133
|
+
n(L.publishedAt),
|
|
134
|
+
". This disclosure is finalised."
|
|
135
|
+
]
|
|
136
|
+
}) : /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(p, {
|
|
121
137
|
id: "reportAttachment",
|
|
122
138
|
label: "Attach file (optional)",
|
|
123
|
-
value:
|
|
124
|
-
onChange:
|
|
139
|
+
value: Y,
|
|
140
|
+
onChange: X,
|
|
125
141
|
hint: "Attach the signed report PDF or supporting document, then publish."
|
|
126
|
-
}), /* @__PURE__ */
|
|
142
|
+
}), /* @__PURE__ */ w(T, {
|
|
127
143
|
variant: "outline",
|
|
128
144
|
onClick: async () => {
|
|
129
|
-
if (
|
|
130
|
-
|
|
145
|
+
if (F) {
|
|
146
|
+
J(null);
|
|
131
147
|
try {
|
|
132
|
-
await
|
|
133
|
-
id:
|
|
134
|
-
fileId:
|
|
135
|
-
}),
|
|
148
|
+
await H.mutateAsync({
|
|
149
|
+
id: F,
|
|
150
|
+
fileId: Y?.fileId ?? null
|
|
151
|
+
}), X(null);
|
|
136
152
|
} catch (e) {
|
|
137
|
-
|
|
153
|
+
J(e instanceof Error ? e.message : "Failed to publish report.");
|
|
138
154
|
}
|
|
139
155
|
}
|
|
140
156
|
},
|
|
141
|
-
disabled:
|
|
142
|
-
children: [/* @__PURE__ */
|
|
157
|
+
disabled: H.isPending,
|
|
158
|
+
children: [/* @__PURE__ */ C(b, { className: "mr-1.5 h-4 w-4" }), H.isPending ? "Publishing…" : "Publish report"]
|
|
143
159
|
})] })
|
|
144
160
|
]
|
|
145
161
|
})]
|
|
146
162
|
}),
|
|
147
|
-
|
|
163
|
+
q && /* @__PURE__ */ C("p", {
|
|
148
164
|
className: "mt-4 text-sm text-status-error-text",
|
|
149
|
-
children:
|
|
165
|
+
children: q
|
|
150
166
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ C(s, {
|
|
152
168
|
title: "Line items",
|
|
153
169
|
description: "Quantified disclosures that make up this report.",
|
|
154
|
-
action: /* @__PURE__ */
|
|
170
|
+
action: /* @__PURE__ */ w(T, {
|
|
155
171
|
size: "sm",
|
|
156
|
-
onClick: () =>
|
|
157
|
-
children: [/* @__PURE__ */
|
|
172
|
+
onClick: () => W(!0),
|
|
173
|
+
children: [/* @__PURE__ */ C(y, { className: "mr-1.5 h-4 w-4" }), " Add line item"]
|
|
158
174
|
}),
|
|
159
|
-
children:
|
|
175
|
+
children: Z.length === 0 ? /* @__PURE__ */ C(c, {
|
|
160
176
|
illustration: "empty-data",
|
|
161
177
|
title: "No line items",
|
|
162
|
-
description: "Add a line item to record a quantified disclosure for this report."
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
className: "
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
178
|
+
description: "Add a line item to record a quantified disclosure for this report.",
|
|
179
|
+
action: /* @__PURE__ */ w(T, {
|
|
180
|
+
size: "sm",
|
|
181
|
+
onClick: () => W(!0),
|
|
182
|
+
children: [/* @__PURE__ */ C(y, { className: "mr-1.5 h-4 w-4" }), " Add line item"]
|
|
183
|
+
})
|
|
184
|
+
}) : /* @__PURE__ */ C(E, {
|
|
185
|
+
treatment: "plain",
|
|
186
|
+
className: "overflow-hidden",
|
|
187
|
+
children: /* @__PURE__ */ C("div", {
|
|
188
|
+
className: "overflow-x-auto",
|
|
189
|
+
children: /* @__PURE__ */ w("table", {
|
|
190
|
+
className: "w-full border-collapse text-sm",
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ C("thead", { children: /* @__PURE__ */ w("tr", {
|
|
193
|
+
className: "border-b border-border-seam text-left",
|
|
194
|
+
children: [
|
|
195
|
+
/* @__PURE__ */ C("th", {
|
|
196
|
+
className: "px-4 py-3 font-medium text-text-secondary",
|
|
197
|
+
children: "Line item"
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ C("th", {
|
|
200
|
+
className: "hidden px-4 py-3 font-medium text-text-secondary md:table-cell",
|
|
201
|
+
children: "Category"
|
|
202
|
+
}),
|
|
203
|
+
/* @__PURE__ */ C("th", {
|
|
204
|
+
className: "px-4 py-3 text-right font-medium text-text-secondary",
|
|
205
|
+
children: "Value"
|
|
206
|
+
})
|
|
207
|
+
]
|
|
208
|
+
}) }),
|
|
209
|
+
/* @__PURE__ */ C("tbody", { children: Z.map((e) => /* @__PURE__ */ w("tr", {
|
|
210
|
+
className: "border-b border-border-seam/60",
|
|
211
|
+
children: [
|
|
212
|
+
/* @__PURE__ */ C("td", {
|
|
213
|
+
className: "px-4 py-3 font-medium text-text-primary",
|
|
214
|
+
children: e.label
|
|
215
|
+
}),
|
|
216
|
+
/* @__PURE__ */ C("td", {
|
|
217
|
+
className: "hidden px-4 py-3 text-text-secondary md:table-cell",
|
|
218
|
+
children: e.category ?? "—"
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ w("td", {
|
|
221
|
+
className: "px-4 py-3 text-right text-text-primary tabular-nums",
|
|
222
|
+
children: [
|
|
223
|
+
r(e.value),
|
|
224
|
+
" ",
|
|
225
|
+
e.unit
|
|
226
|
+
]
|
|
227
|
+
})
|
|
228
|
+
]
|
|
229
|
+
}, e.id)) }),
|
|
230
|
+
/* @__PURE__ */ C("tfoot", { children: /* @__PURE__ */ w("tr", {
|
|
231
|
+
className: "border-t-2 border-border-seam bg-bg-sunken/40",
|
|
232
|
+
children: [/* @__PURE__ */ C("td", {
|
|
233
|
+
className: "px-4 py-3 text-sm font-semibold text-text-primary",
|
|
234
|
+
colSpan: 2,
|
|
235
|
+
children: "Total"
|
|
236
|
+
}), /* @__PURE__ */ w("td", {
|
|
237
|
+
className: "px-4 py-3 text-right text-base font-bold text-text-primary tabular-nums",
|
|
238
|
+
children: [r(Q), $ ? ` ${$}` : ""]
|
|
239
|
+
})]
|
|
240
|
+
}) })
|
|
241
|
+
]
|
|
242
|
+
})
|
|
243
|
+
})
|
|
244
|
+
})
|
|
209
245
|
}),
|
|
210
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ C(h, {
|
|
211
247
|
entityType: "ecoimpacthub-report",
|
|
212
|
-
entityId:
|
|
248
|
+
entityId: L.id,
|
|
213
249
|
description: "Coordinate review and sign-off on this disclosure with your team."
|
|
214
250
|
}),
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
-
open:
|
|
217
|
-
onOpenChange:
|
|
218
|
-
children: /* @__PURE__ */
|
|
219
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ C(k, {
|
|
252
|
+
open: U,
|
|
253
|
+
onOpenChange: W,
|
|
254
|
+
children: /* @__PURE__ */ w(ee, { children: [
|
|
255
|
+
/* @__PURE__ */ w(M, { children: [/* @__PURE__ */ C(N, { children: "Add line item" }), /* @__PURE__ */ w(A, { children: [
|
|
220
256
|
"Record a quantified disclosure for ",
|
|
221
|
-
|
|
257
|
+
L.title,
|
|
222
258
|
"."
|
|
223
259
|
] })] }),
|
|
224
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ w("div", {
|
|
225
261
|
className: "grid gap-4 py-2",
|
|
226
262
|
children: [
|
|
227
|
-
/* @__PURE__ */
|
|
263
|
+
/* @__PURE__ */ w("div", {
|
|
228
264
|
className: "grid gap-1.5",
|
|
229
|
-
children: [/* @__PURE__ */
|
|
265
|
+
children: [/* @__PURE__ */ C(O, {
|
|
230
266
|
htmlFor: "liLabel",
|
|
231
267
|
children: "Label *"
|
|
232
|
-
}), /* @__PURE__ */
|
|
268
|
+
}), /* @__PURE__ */ C(D, {
|
|
233
269
|
id: "liLabel",
|
|
234
|
-
value:
|
|
235
|
-
onChange: (e) =>
|
|
236
|
-
...
|
|
270
|
+
value: G.label,
|
|
271
|
+
onChange: (e) => K({
|
|
272
|
+
...G,
|
|
237
273
|
label: e.target.value
|
|
238
274
|
}),
|
|
239
275
|
placeholder: "Scope 1 emissions"
|
|
240
276
|
})]
|
|
241
277
|
}),
|
|
242
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ w("div", {
|
|
243
279
|
className: "grid gap-2 sm:grid-cols-2",
|
|
244
|
-
children: [/* @__PURE__ */
|
|
280
|
+
children: [/* @__PURE__ */ w("div", {
|
|
245
281
|
className: "grid gap-1.5",
|
|
246
|
-
children: [/* @__PURE__ */
|
|
282
|
+
children: [/* @__PURE__ */ C(O, {
|
|
247
283
|
htmlFor: "liValue",
|
|
248
284
|
children: "Value *"
|
|
249
|
-
}), /* @__PURE__ */
|
|
285
|
+
}), /* @__PURE__ */ C(D, {
|
|
250
286
|
id: "liValue",
|
|
251
287
|
type: "number",
|
|
252
288
|
step: "any",
|
|
253
|
-
value:
|
|
254
|
-
onChange: (e) =>
|
|
255
|
-
...
|
|
289
|
+
value: G.value,
|
|
290
|
+
onChange: (e) => K({
|
|
291
|
+
...G,
|
|
256
292
|
value: e.target.value
|
|
257
293
|
}),
|
|
258
294
|
placeholder: "1250"
|
|
259
295
|
})]
|
|
260
|
-
}), /* @__PURE__ */
|
|
296
|
+
}), /* @__PURE__ */ w("div", {
|
|
261
297
|
className: "grid gap-1.5",
|
|
262
|
-
children: [/* @__PURE__ */
|
|
298
|
+
children: [/* @__PURE__ */ C(O, {
|
|
263
299
|
htmlFor: "liUnit",
|
|
264
300
|
children: "Unit *"
|
|
265
|
-
}), /* @__PURE__ */
|
|
301
|
+
}), /* @__PURE__ */ C(D, {
|
|
266
302
|
id: "liUnit",
|
|
267
|
-
value:
|
|
268
|
-
onChange: (e) =>
|
|
269
|
-
...
|
|
303
|
+
value: G.unit,
|
|
304
|
+
onChange: (e) => K({
|
|
305
|
+
...G,
|
|
270
306
|
unit: e.target.value
|
|
271
307
|
}),
|
|
272
308
|
placeholder: "t CO₂e"
|
|
273
309
|
})]
|
|
274
310
|
})]
|
|
275
311
|
}),
|
|
276
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ w("div", {
|
|
277
313
|
className: "grid gap-1.5",
|
|
278
|
-
children: [/* @__PURE__ */
|
|
314
|
+
children: [/* @__PURE__ */ C(O, {
|
|
279
315
|
htmlFor: "liCategory",
|
|
280
316
|
children: "Category"
|
|
281
|
-
}), /* @__PURE__ */
|
|
317
|
+
}), /* @__PURE__ */ C(D, {
|
|
282
318
|
id: "liCategory",
|
|
283
|
-
value:
|
|
284
|
-
onChange: (e) =>
|
|
285
|
-
...
|
|
319
|
+
value: G.category,
|
|
320
|
+
onChange: (e) => K({
|
|
321
|
+
...G,
|
|
286
322
|
category: e.target.value
|
|
287
323
|
}),
|
|
288
324
|
placeholder: "Optional grouping, e.g. Energy"
|
|
289
325
|
})]
|
|
290
326
|
}),
|
|
291
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ w("div", {
|
|
292
328
|
className: "grid gap-1.5",
|
|
293
|
-
children: [/* @__PURE__ */
|
|
329
|
+
children: [/* @__PURE__ */ C(O, {
|
|
294
330
|
htmlFor: "liCarbonEntry",
|
|
295
331
|
children: "Carbon entry ID"
|
|
296
|
-
}), /* @__PURE__ */
|
|
332
|
+
}), /* @__PURE__ */ C(D, {
|
|
297
333
|
id: "liCarbonEntry",
|
|
298
|
-
value:
|
|
299
|
-
onChange: (e) =>
|
|
300
|
-
...
|
|
334
|
+
value: G.carbonEntryId,
|
|
335
|
+
onChange: (e) => K({
|
|
336
|
+
...G,
|
|
301
337
|
carbonEntryId: e.target.value
|
|
302
338
|
}),
|
|
303
339
|
placeholder: "Optional linked carbon-ledger entry"
|
|
@@ -305,27 +341,27 @@ function L() {
|
|
|
305
341
|
})
|
|
306
342
|
]
|
|
307
343
|
}),
|
|
308
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ w(j, { children: [/* @__PURE__ */ C(T, {
|
|
309
345
|
variant: "outline",
|
|
310
|
-
onClick: () =>
|
|
346
|
+
onClick: () => W(!1),
|
|
311
347
|
children: "Cancel"
|
|
312
|
-
}), /* @__PURE__ */ T
|
|
348
|
+
}), /* @__PURE__ */ C(T, {
|
|
313
349
|
onClick: async () => {
|
|
314
|
-
if (
|
|
315
|
-
if (!
|
|
316
|
-
|
|
350
|
+
if (F) {
|
|
351
|
+
if (!G.label.trim() || !G.value || !G.unit.trim()) {
|
|
352
|
+
J("Label, value and unit are required.");
|
|
317
353
|
return;
|
|
318
354
|
}
|
|
319
|
-
|
|
355
|
+
J(null);
|
|
320
356
|
try {
|
|
321
|
-
await
|
|
322
|
-
reportId:
|
|
323
|
-
label:
|
|
324
|
-
value: Number(
|
|
325
|
-
unit:
|
|
326
|
-
category:
|
|
327
|
-
carbonEntryId:
|
|
328
|
-
}),
|
|
357
|
+
await V.mutateAsync({
|
|
358
|
+
reportId: F,
|
|
359
|
+
label: G.label.trim(),
|
|
360
|
+
value: Number(G.value),
|
|
361
|
+
unit: G.unit.trim(),
|
|
362
|
+
category: G.category.trim() || null,
|
|
363
|
+
carbonEntryId: G.carbonEntryId.trim() || null
|
|
364
|
+
}), W(!1), K({
|
|
329
365
|
label: "",
|
|
330
366
|
value: "",
|
|
331
367
|
unit: "",
|
|
@@ -333,12 +369,12 @@ function L() {
|
|
|
333
369
|
carbonEntryId: ""
|
|
334
370
|
});
|
|
335
371
|
} catch (e) {
|
|
336
|
-
|
|
372
|
+
J(e instanceof Error ? e.message : "Failed to add line item.");
|
|
337
373
|
}
|
|
338
374
|
}
|
|
339
375
|
},
|
|
340
|
-
disabled:
|
|
341
|
-
children:
|
|
376
|
+
disabled: V.isPending,
|
|
377
|
+
children: V.isPending ? "Adding…" : "Add line item"
|
|
342
378
|
})] })
|
|
343
379
|
] })
|
|
344
380
|
})
|
|
@@ -346,6 +382,6 @@ function L() {
|
|
|
346
382
|
});
|
|
347
383
|
}
|
|
348
384
|
//#endregion
|
|
349
|
-
export {
|
|
385
|
+
export { F as ReportDetailPage };
|
|
350
386
|
|
|
351
387
|
//# sourceMappingURL=ReportDetailPage.js.map
|