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