@burdenoff/microfe-ecoimpacthub 2026.1202.1 → 2026.1203.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ecoimpacthub/components/DataTable.d.ts +14 -0
- package/dist/ecoimpacthub/components/DataTable.js +51 -30
- package/dist/ecoimpacthub/components/DataTable.js.map +1 -1
- package/dist/ecoimpacthub/hooks/useEcoImpactHubApi.js +1 -1
- package/dist/ecoimpacthub/hooks/useEcoImpactHubApi.js.map +1 -1
- package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js +303 -228
- package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js.map +1 -1
- package/dist/ecoimpacthub/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -5,67 +5,67 @@ import { ErrorView as ee, LoadingView as te, Section as ne } from "../../compone
|
|
|
5
5
|
import { EmptyState as re } from "../../components/EmptyState.js";
|
|
6
6
|
import { EvidenceUpload as ie } from "../../components/EvidenceUpload.js";
|
|
7
7
|
import { FileLink as ae } from "../../components/FileLink.js";
|
|
8
|
-
import { useEcoAddReportLineItem as oe, useEcoPublishReport as
|
|
9
|
-
import { useActiveEcoEntity as
|
|
10
|
-
import { useEcoAiDraftReportLineItems as
|
|
11
|
-
import { EcoDiscussion as
|
|
8
|
+
import { useEcoAddReportLineItem as oe, useEcoPublishReport as se, useEcoRejectReport as ce, useEcoReport as le, useEcoSubmitReportForApproval as ue } from "../../hooks/useEcoImpactHubApi.js";
|
|
9
|
+
import { useActiveEcoEntity as de } from "../../hooks/useActiveEcoEntity.js";
|
|
10
|
+
import { useEcoAiDraftReportLineItems as fe, useEcoAiReportReadiness as pe } from "../../hooks/useEcoAiOperations.js";
|
|
11
|
+
import { EcoDiscussion as me } from "../../components/EcoDiscussion.js";
|
|
12
12
|
import "../../context/index.js";
|
|
13
13
|
import "../../hooks/index.js";
|
|
14
|
-
import { formatDate as
|
|
15
|
-
import { FrameworkBadge as
|
|
16
|
-
import { useMemo as
|
|
17
|
-
import { AlertTriangle as
|
|
18
|
-
import { useParams as
|
|
19
|
-
import { Fragment as
|
|
20
|
-
import { Button as
|
|
14
|
+
import { formatDate as r, formatNumber as he } from "../../utils/formatters.js";
|
|
15
|
+
import { FrameworkBadge as i } from "../badges.js";
|
|
16
|
+
import { useMemo as a, useState as o } from "react";
|
|
17
|
+
import { AlertTriangle as ge, ArrowLeft as _e, CheckCircle2 as ve, ExternalLink as s, ListPlus as c, Send as l, ShieldAlert as ye, Sparkles as u } from "lucide-react";
|
|
18
|
+
import { useParams as be } from "react-router";
|
|
19
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
20
|
+
import { Button as m, GlassCard as h, Input as g, Label as _, ResponsiveDialog as v, ResponsiveDialogContent as y, ResponsiveDialogDescription as b, ResponsiveDialogFooter as x, ResponsiveDialogHeader as S, ResponsiveDialogTitle as C } from "@burdenoff/fe-libs/ui";
|
|
21
21
|
// src/ecoimpacthub/pages/reports/ReportDetailPage.tsx
|
|
22
|
-
function
|
|
23
|
-
return /* @__PURE__ */
|
|
22
|
+
function w({ label: e, children: t }) {
|
|
23
|
+
return /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("dt", {
|
|
24
24
|
className: "text-xs text-text-tertiary",
|
|
25
25
|
children: e
|
|
26
|
-
}), /* @__PURE__ */
|
|
26
|
+
}), /* @__PURE__ */ f("dd", {
|
|
27
27
|
className: "mt-1 text-sm text-text-primary",
|
|
28
28
|
children: t
|
|
29
29
|
})] });
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
let { id:
|
|
33
|
-
|
|
34
|
-
let
|
|
31
|
+
function T() {
|
|
32
|
+
let { id: T } = be(), { navigateTo: E } = e(), { data: D, isLoading: xe, isError: Se, refetch: O } = le(T);
|
|
33
|
+
de(D?.id, D?.title);
|
|
34
|
+
let k = oe(), A = ue(), j = se(), M = ce(), N = fe(), P = pe(T), [Ce, F] = o(!1), [we, I] = o(!1), [Te, L] = o(!1), [R, z] = o(""), [B, V] = o(null), [H, U] = o({
|
|
35
35
|
label: "",
|
|
36
36
|
value: "",
|
|
37
37
|
unit: "",
|
|
38
38
|
category: "",
|
|
39
39
|
carbonEntryId: ""
|
|
40
|
-
}), [
|
|
41
|
-
let e = new Set(
|
|
40
|
+
}), [W, G] = o(null), [K, q] = o(null), J = a(() => D?.lineItems ?? [], [D]), Ee = a(() => J.reduce((e, t) => e + t.value, 0), [J]), Y = a(() => {
|
|
41
|
+
let e = new Set(J.map((e) => e.unit));
|
|
42
42
|
return e.size === 1 ? [...e][0] : null;
|
|
43
|
-
}, [
|
|
44
|
-
if (
|
|
43
|
+
}, [J]);
|
|
44
|
+
if (xe) return /* @__PURE__ */ f(t, {
|
|
45
45
|
title: "Report",
|
|
46
|
-
children: /* @__PURE__ */
|
|
46
|
+
children: /* @__PURE__ */ f(te, {})
|
|
47
47
|
});
|
|
48
|
-
if (
|
|
48
|
+
if (Se || !D) return /* @__PURE__ */ f(t, {
|
|
49
49
|
title: "Report",
|
|
50
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ f(ee, {
|
|
51
51
|
message: "This report could not be loaded.",
|
|
52
|
-
onRetry: () =>
|
|
52
|
+
onRetry: () => O()
|
|
53
53
|
})
|
|
54
54
|
});
|
|
55
|
-
let
|
|
56
|
-
if (
|
|
57
|
-
if (!
|
|
55
|
+
let De = D.status === "PUBLISHED", X = D.status === "DRAFT", Oe = D.status === "IN_REVIEW", Z = !!D.submissionPending, Q = X && !Z, ke = async () => {
|
|
56
|
+
if (T) {
|
|
57
|
+
if (!H.label.trim() || !H.value || !H.unit.trim()) G("Label, value and unit are required.");
|
|
58
58
|
else {
|
|
59
|
-
|
|
59
|
+
G(null);
|
|
60
60
|
try {
|
|
61
|
-
await
|
|
62
|
-
reportId:
|
|
63
|
-
label:
|
|
64
|
-
value: Number(
|
|
65
|
-
unit:
|
|
66
|
-
category:
|
|
67
|
-
carbonEntryId:
|
|
68
|
-
}),
|
|
61
|
+
await k.mutateAsync({
|
|
62
|
+
reportId: T,
|
|
63
|
+
label: H.label.trim(),
|
|
64
|
+
value: Number(H.value),
|
|
65
|
+
unit: H.unit.trim(),
|
|
66
|
+
category: H.category.trim() || null,
|
|
67
|
+
carbonEntryId: H.carbonEntryId.trim() || null
|
|
68
|
+
}), F(!1), U({
|
|
69
69
|
label: "",
|
|
70
70
|
value: "",
|
|
71
71
|
unit: "",
|
|
@@ -73,164 +73,207 @@ function A() {
|
|
|
73
73
|
carbonEntryId: ""
|
|
74
74
|
});
|
|
75
75
|
} catch (e) {
|
|
76
|
-
|
|
76
|
+
G(e instanceof Error ? e.message : "Failed to add line item.");
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
},
|
|
81
|
-
if (
|
|
82
|
-
|
|
80
|
+
}, Ae = async () => {
|
|
81
|
+
if (T) {
|
|
82
|
+
G(null);
|
|
83
83
|
try {
|
|
84
|
-
await
|
|
85
|
-
id: A,
|
|
86
|
-
fileId: q?.fileId ?? null
|
|
87
|
-
}), J(null), B(!1);
|
|
84
|
+
await A.mutateAsync(T);
|
|
88
85
|
} catch (e) {
|
|
89
|
-
|
|
86
|
+
G(e instanceof Error ? e.message : "Failed to submit report for approval.");
|
|
90
87
|
}
|
|
91
88
|
}
|
|
92
|
-
},
|
|
93
|
-
if (
|
|
94
|
-
|
|
89
|
+
}, je = async () => {
|
|
90
|
+
if (T) {
|
|
91
|
+
G(null);
|
|
95
92
|
try {
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
await j.mutateAsync({
|
|
94
|
+
id: T,
|
|
95
|
+
fileId: K?.fileId ?? null
|
|
96
|
+
}), q(null), I(!1);
|
|
98
97
|
} catch (e) {
|
|
99
|
-
|
|
98
|
+
G(e instanceof Error ? e.message : "Failed to publish report.");
|
|
100
99
|
}
|
|
101
100
|
}
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
}, Me = async () => {
|
|
102
|
+
if (!T || !R.trim()) G("A rejection reason is required.");
|
|
103
|
+
else {
|
|
104
|
+
G(null);
|
|
105
|
+
try {
|
|
106
|
+
await M.mutateAsync({
|
|
107
|
+
reportId: T,
|
|
108
|
+
reason: R.trim()
|
|
109
|
+
}), z(""), L(!1);
|
|
110
|
+
} catch (e) {
|
|
111
|
+
G(e instanceof Error ? e.message : "Failed to reject report.");
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}, Ne = async () => {
|
|
115
|
+
if (T) {
|
|
116
|
+
G(null), V(null);
|
|
117
|
+
try {
|
|
118
|
+
let e = await N.mutateAsync(T);
|
|
119
|
+
V(e.draftedCount > 0 ? `Drafted ${e.draftedCount} cited ${e.framework} line item(s) (AgentRun ${e.agentRunId}). Verify source links before publishing.` : `No new line items drafted (${e.skippedDisclosures.length} disclosure(s) already covered or missing workspace source data).`), await O(), await P.refetch();
|
|
120
|
+
} catch (e) {
|
|
121
|
+
G(e instanceof Error ? e.message : "Failed to draft line items with AI.");
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}, $ = P.data, Pe = J.some((e) => e.aiDrafted);
|
|
125
|
+
return /* @__PURE__ */ p(t, {
|
|
126
|
+
title: /* @__PURE__ */ p("span", {
|
|
105
127
|
className: "flex flex-wrap items-center gap-x-3 gap-y-2",
|
|
106
|
-
children: [/* @__PURE__ */
|
|
128
|
+
children: [/* @__PURE__ */ f("span", {
|
|
107
129
|
className: "text-text-primary",
|
|
108
|
-
children:
|
|
109
|
-
}), /* @__PURE__ */
|
|
130
|
+
children: D.title
|
|
131
|
+
}), /* @__PURE__ */ f(i, { framework: D.framework })]
|
|
110
132
|
}),
|
|
111
|
-
description: `Reporting period ${
|
|
112
|
-
actions: /* @__PURE__ */
|
|
133
|
+
description: `Reporting period ${r(D.periodStart)} – ${r(D.periodEnd)}`,
|
|
134
|
+
actions: /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(n, { status: D.status }), /* @__PURE__ */ p(m, {
|
|
113
135
|
variant: "ghost",
|
|
114
|
-
onClick: () =>
|
|
115
|
-
children: [/* @__PURE__ */
|
|
136
|
+
onClick: () => E("reports"),
|
|
137
|
+
children: [/* @__PURE__ */ f(_e, { className: "me-1.5 h-4 w-4" }), " Back"]
|
|
116
138
|
})] }),
|
|
117
139
|
children: [
|
|
118
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ p("div", {
|
|
119
141
|
className: "grid grid-cols-1 gap-4 lg:grid-cols-3",
|
|
120
|
-
children: [/* @__PURE__ */
|
|
142
|
+
children: [/* @__PURE__ */ p(h, {
|
|
121
143
|
treatment: "glass",
|
|
122
144
|
className: "p-6 lg:col-span-2",
|
|
123
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ p("dl", {
|
|
124
146
|
className: "grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3",
|
|
125
147
|
children: [
|
|
126
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ f(w, {
|
|
127
149
|
label: "Framework",
|
|
128
|
-
children: /* @__PURE__ */
|
|
150
|
+
children: /* @__PURE__ */ f(i, { framework: D.framework })
|
|
129
151
|
}),
|
|
130
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ f(w, {
|
|
131
153
|
label: "Status",
|
|
132
|
-
children: /* @__PURE__ */
|
|
154
|
+
children: /* @__PURE__ */ f(n, { status: D.status })
|
|
133
155
|
}),
|
|
134
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ f(w, {
|
|
135
157
|
label: "Period",
|
|
136
|
-
children: /* @__PURE__ */
|
|
158
|
+
children: /* @__PURE__ */ p("span", {
|
|
137
159
|
className: "tabular-nums",
|
|
138
160
|
children: [
|
|
139
|
-
|
|
161
|
+
r(D.periodStart),
|
|
140
162
|
" – ",
|
|
141
|
-
|
|
163
|
+
r(D.periodEnd)
|
|
142
164
|
]
|
|
143
165
|
})
|
|
144
166
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ f(w, {
|
|
146
168
|
label: "Published",
|
|
147
|
-
children:
|
|
169
|
+
children: r(D.publishedAt)
|
|
148
170
|
}),
|
|
149
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ f(w, {
|
|
150
172
|
label: "Line items",
|
|
151
|
-
children: /* @__PURE__ */
|
|
173
|
+
children: /* @__PURE__ */ f("span", {
|
|
152
174
|
className: "tabular-nums",
|
|
153
|
-
children:
|
|
175
|
+
children: J.length
|
|
154
176
|
})
|
|
155
177
|
}),
|
|
156
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ f(w, {
|
|
157
179
|
label: "Attachment",
|
|
158
|
-
children:
|
|
180
|
+
children: D.file?.id ? /* @__PURE__ */ f(ae, { fileId: D.file.id }) : /* @__PURE__ */ f("span", {
|
|
159
181
|
className: "text-text-tertiary",
|
|
160
182
|
children: "—"
|
|
161
183
|
})
|
|
162
184
|
})
|
|
163
185
|
]
|
|
164
|
-
}),
|
|
186
|
+
}), D.summary && /* @__PURE__ */ f("p", {
|
|
165
187
|
className: "mt-5 rounded-lg bg-bg-sunken/60 p-3 text-sm text-text-secondary",
|
|
166
|
-
children:
|
|
188
|
+
children: D.summary
|
|
167
189
|
})]
|
|
168
|
-
}), /* @__PURE__ */
|
|
190
|
+
}), /* @__PURE__ */ p(h, {
|
|
169
191
|
treatment: "glass",
|
|
170
192
|
className: "flex flex-col gap-3 p-6",
|
|
171
193
|
children: [
|
|
172
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ f("p", {
|
|
173
195
|
className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
|
|
174
196
|
children: "Actions"
|
|
175
197
|
}),
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
onClick: () =>
|
|
178
|
-
|
|
198
|
+
/* @__PURE__ */ p(m, {
|
|
199
|
+
onClick: () => F(!0),
|
|
200
|
+
disabled: !Q,
|
|
201
|
+
children: [/* @__PURE__ */ f(c, { className: "me-1.5 h-4 w-4" }), " Add line item"]
|
|
179
202
|
}),
|
|
180
|
-
|
|
203
|
+
Q && /* @__PURE__ */ p(m, {
|
|
181
204
|
variant: "outline",
|
|
182
205
|
"data-testid": "eco-report-draft-ai",
|
|
183
|
-
onClick:
|
|
184
|
-
disabled:
|
|
185
|
-
children: [/* @__PURE__ */
|
|
206
|
+
onClick: Ne,
|
|
207
|
+
disabled: N.isPending,
|
|
208
|
+
children: [/* @__PURE__ */ f(u, { className: "me-1.5 h-4 w-4" }), N.isPending ? "Drafting with AI…" : "Draft line items with AI"]
|
|
186
209
|
}),
|
|
187
|
-
|
|
210
|
+
De ? /* @__PURE__ */ p("p", {
|
|
188
211
|
className: "mt-1 text-sm text-text-secondary",
|
|
189
212
|
children: [
|
|
190
213
|
"Published ",
|
|
191
|
-
|
|
214
|
+
r(D.publishedAt),
|
|
192
215
|
". This disclosure is finalised."
|
|
193
216
|
]
|
|
194
|
-
}) :
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
onChange: J,
|
|
199
|
-
hint: "Attach the signed report PDF or supporting document, then publish."
|
|
200
|
-
}), /* @__PURE__ */ v(y, {
|
|
217
|
+
}) : Z ? /* @__PURE__ */ f("p", {
|
|
218
|
+
className: "mt-1 text-sm text-status-warning-text",
|
|
219
|
+
children: "Sign-off submission is being confirmed. Editing and repeat submission are locked until workflow reconciliation finishes."
|
|
220
|
+
}) : X ? /* @__PURE__ */ p(m, {
|
|
201
221
|
variant: "outline",
|
|
202
|
-
onClick:
|
|
203
|
-
disabled:
|
|
204
|
-
children: [/* @__PURE__ */
|
|
205
|
-
})
|
|
222
|
+
onClick: Ae,
|
|
223
|
+
disabled: A.isPending,
|
|
224
|
+
children: [/* @__PURE__ */ f(l, { className: "me-1.5 h-4 w-4" }), A.isPending ? "Submitting…" : "Submit for approval"]
|
|
225
|
+
}) : Oe ? /* @__PURE__ */ p(d, { children: [
|
|
226
|
+
/* @__PURE__ */ f(ie, {
|
|
227
|
+
id: "reportAttachment",
|
|
228
|
+
label: "Attach file (optional)",
|
|
229
|
+
value: K,
|
|
230
|
+
onChange: q,
|
|
231
|
+
hint: "Attach the signed report PDF or supporting document, then approve and publish."
|
|
232
|
+
}),
|
|
233
|
+
/* @__PURE__ */ p(m, {
|
|
234
|
+
variant: "outline",
|
|
235
|
+
onClick: () => I(!0),
|
|
236
|
+
disabled: j.isPending,
|
|
237
|
+
children: [/* @__PURE__ */ f(l, { className: "me-1.5 h-4 w-4" }), j.isPending ? "Publishing…" : "Approve & publish"]
|
|
238
|
+
}),
|
|
239
|
+
/* @__PURE__ */ f(m, {
|
|
240
|
+
variant: "ghost",
|
|
241
|
+
onClick: () => L(!0),
|
|
242
|
+
disabled: M.isPending,
|
|
243
|
+
children: "Return to draft"
|
|
244
|
+
})
|
|
245
|
+
] }) : /* @__PURE__ */ f("p", {
|
|
246
|
+
className: "mt-1 text-sm text-text-secondary",
|
|
247
|
+
children: "This report is archived and cannot be edited or published."
|
|
248
|
+
})
|
|
206
249
|
]
|
|
207
250
|
})]
|
|
208
251
|
}),
|
|
209
|
-
|
|
252
|
+
W && /* @__PURE__ */ f("p", {
|
|
210
253
|
className: "mt-4 text-sm text-status-error-text",
|
|
211
|
-
children:
|
|
254
|
+
children: W
|
|
212
255
|
}),
|
|
213
|
-
|
|
256
|
+
B && /* @__PURE__ */ f("p", {
|
|
214
257
|
role: "status",
|
|
215
258
|
className: "mt-4 text-sm text-status-success-text",
|
|
216
|
-
children:
|
|
259
|
+
children: B
|
|
217
260
|
}),
|
|
218
|
-
$ && /* @__PURE__ */
|
|
261
|
+
$ && /* @__PURE__ */ p(h, {
|
|
219
262
|
treatment: "glass",
|
|
220
263
|
className: "mt-6 space-y-3 p-5",
|
|
221
264
|
"data-testid": "eco-report-readiness-card",
|
|
222
265
|
children: [
|
|
223
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ p("div", {
|
|
224
267
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
225
|
-
children: [/* @__PURE__ */
|
|
268
|
+
children: [/* @__PURE__ */ p("div", {
|
|
226
269
|
className: "flex items-center gap-2",
|
|
227
|
-
children: [$.readyToPublish ? /* @__PURE__ */
|
|
270
|
+
children: [$.readyToPublish ? /* @__PURE__ */ f(ve, {
|
|
228
271
|
className: "h-4 w-4 text-status-success-text",
|
|
229
272
|
"aria-hidden": "true"
|
|
230
|
-
}) : /* @__PURE__ */
|
|
273
|
+
}) : /* @__PURE__ */ f(ge, {
|
|
231
274
|
className: "h-4 w-4 text-status-warning-text",
|
|
232
275
|
"aria-hidden": "true"
|
|
233
|
-
}), /* @__PURE__ */
|
|
276
|
+
}), /* @__PURE__ */ p("h2", {
|
|
234
277
|
className: "text-sm font-semibold text-text-primary",
|
|
235
278
|
children: [
|
|
236
279
|
$.framework,
|
|
@@ -243,169 +286,169 @@ function A() {
|
|
|
243
286
|
")"
|
|
244
287
|
]
|
|
245
288
|
})]
|
|
246
|
-
}), /* @__PURE__ */
|
|
289
|
+
}), /* @__PURE__ */ f(n, { status: $.readyToPublish ? "READY" : "IN_REVIEW" })]
|
|
247
290
|
}),
|
|
248
|
-
$.draftCarbonWarnings.length > 0 && /* @__PURE__ */
|
|
291
|
+
$.draftCarbonWarnings.length > 0 && /* @__PURE__ */ f("div", {
|
|
249
292
|
className: "rounded-lg border border-border-seam bg-status-warning-bg-subtle px-3 py-2 text-xs text-status-warning-text",
|
|
250
|
-
children: $.draftCarbonWarnings.map((e, t) => /* @__PURE__ */
|
|
293
|
+
children: $.draftCarbonWarnings.map((e, t) => /* @__PURE__ */ f("p", { children: e }, t))
|
|
251
294
|
}),
|
|
252
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ f("div", {
|
|
253
296
|
className: "grid gap-2 sm:grid-cols-2",
|
|
254
|
-
children: $.disclosures.map((e) => /* @__PURE__ */
|
|
297
|
+
children: $.disclosures.map((e) => /* @__PURE__ */ p("div", {
|
|
255
298
|
className: "flex items-start justify-between gap-2 rounded-md border border-border-seam bg-bg-sunken/40 px-3 py-2 text-xs",
|
|
256
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ p("div", {
|
|
257
300
|
className: "min-w-0",
|
|
258
|
-
children: [/* @__PURE__ */
|
|
301
|
+
children: [/* @__PURE__ */ p("p", {
|
|
259
302
|
className: "font-medium text-text-primary",
|
|
260
303
|
children: [
|
|
261
304
|
e.disclosureCode,
|
|
262
305
|
" · ",
|
|
263
306
|
e.label
|
|
264
307
|
]
|
|
265
|
-
}), e.gapReason && /* @__PURE__ */
|
|
308
|
+
}), e.gapReason && /* @__PURE__ */ f("p", {
|
|
266
309
|
className: "text-text-tertiary",
|
|
267
310
|
children: e.gapReason
|
|
268
311
|
})]
|
|
269
|
-
}), /* @__PURE__ */
|
|
312
|
+
}), /* @__PURE__ */ f(n, { status: e.covered ? "VERIFIED" : "DRAFT" })]
|
|
270
313
|
}, e.disclosureCode))
|
|
271
314
|
})
|
|
272
315
|
]
|
|
273
316
|
}),
|
|
274
|
-
|
|
317
|
+
Pe && /* @__PURE__ */ p("div", {
|
|
275
318
|
role: "note",
|
|
276
319
|
"data-testid": "eco-report-ai-disclaimer",
|
|
277
320
|
className: "mt-4 flex items-start gap-2 rounded-lg border border-border-seam bg-status-warning-bg-subtle px-4 py-3 text-xs text-status-warning-text",
|
|
278
|
-
children: [/* @__PURE__ */
|
|
321
|
+
children: [/* @__PURE__ */ f(ye, {
|
|
279
322
|
className: "mt-0.5 h-4 w-4 shrink-0",
|
|
280
323
|
"aria-hidden": "true"
|
|
281
|
-
}), /* @__PURE__ */
|
|
324
|
+
}), /* @__PURE__ */ f("p", { children: "AI-drafted disclosures are assembled from workspace records and carry mandatory source citations. Review every cited record before human publication." })]
|
|
282
325
|
}),
|
|
283
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ f(ne, {
|
|
284
327
|
title: "Line items",
|
|
285
328
|
description: "Quantified disclosures that make up this report.",
|
|
286
|
-
action: /* @__PURE__ */
|
|
329
|
+
action: /* @__PURE__ */ p(m, {
|
|
287
330
|
size: "sm",
|
|
288
|
-
onClick: () =>
|
|
289
|
-
children: [/* @__PURE__ */
|
|
331
|
+
onClick: () => F(!0),
|
|
332
|
+
children: [/* @__PURE__ */ f(c, { className: "me-1.5 h-4 w-4" }), " Add line item"]
|
|
290
333
|
}),
|
|
291
|
-
children:
|
|
334
|
+
children: J.length === 0 ? /* @__PURE__ */ f(re, {
|
|
292
335
|
illustration: "empty-data",
|
|
293
336
|
title: "No line items",
|
|
294
337
|
description: "Add a line item to record a quantified disclosure for this report.",
|
|
295
|
-
action: /* @__PURE__ */
|
|
338
|
+
action: /* @__PURE__ */ p(m, {
|
|
296
339
|
size: "sm",
|
|
297
|
-
onClick: () =>
|
|
298
|
-
children: [/* @__PURE__ */
|
|
340
|
+
onClick: () => F(!0),
|
|
341
|
+
children: [/* @__PURE__ */ f(c, { className: "me-1.5 h-4 w-4" }), " Add line item"]
|
|
299
342
|
})
|
|
300
|
-
}) : /* @__PURE__ */
|
|
343
|
+
}) : /* @__PURE__ */ f(h, {
|
|
301
344
|
treatment: "plain",
|
|
302
345
|
className: "overflow-hidden",
|
|
303
|
-
children: /* @__PURE__ */
|
|
346
|
+
children: /* @__PURE__ */ f("div", {
|
|
304
347
|
className: "overflow-x-auto",
|
|
305
|
-
children: /* @__PURE__ */
|
|
348
|
+
children: /* @__PURE__ */ p("table", {
|
|
306
349
|
className: "w-full border-collapse text-sm",
|
|
307
350
|
children: [
|
|
308
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ f("thead", { children: /* @__PURE__ */ p("tr", {
|
|
309
352
|
className: "border-b border-border-seam text-start",
|
|
310
353
|
children: [
|
|
311
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ f("th", {
|
|
312
355
|
className: "px-4 py-3 font-medium text-text-secondary",
|
|
313
356
|
children: "Line item"
|
|
314
357
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ f("th", {
|
|
316
359
|
className: "hidden px-4 py-3 font-medium text-text-secondary md:table-cell",
|
|
317
360
|
children: "Category"
|
|
318
361
|
}),
|
|
319
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ f("th", {
|
|
320
363
|
className: "px-4 py-3 font-medium text-text-secondary",
|
|
321
364
|
children: "Source citation"
|
|
322
365
|
}),
|
|
323
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ f("th", {
|
|
324
367
|
className: "px-4 py-3 text-end font-medium text-text-secondary",
|
|
325
368
|
children: "Value"
|
|
326
369
|
})
|
|
327
370
|
]
|
|
328
371
|
}) }),
|
|
329
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ f("tbody", { children: J.map((e) => /* @__PURE__ */ p("tr", {
|
|
330
373
|
className: "border-b border-border-seam/60",
|
|
331
374
|
children: [
|
|
332
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ p("td", {
|
|
333
376
|
className: "px-4 py-3 font-medium text-text-primary",
|
|
334
|
-
children: [/* @__PURE__ */
|
|
377
|
+
children: [/* @__PURE__ */ p("div", {
|
|
335
378
|
className: "flex flex-wrap items-center gap-2",
|
|
336
379
|
children: [
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
-
e.disclosureCode && /* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ f("span", { children: e.label }),
|
|
381
|
+
e.disclosureCode && /* @__PURE__ */ f("span", {
|
|
339
382
|
className: "rounded bg-bg-sunken px-1.5 py-0.5 font-mono text-xs text-text-secondary",
|
|
340
383
|
children: e.disclosureCode
|
|
341
384
|
}),
|
|
342
|
-
e.aiDrafted && /* @__PURE__ */
|
|
385
|
+
e.aiDrafted && /* @__PURE__ */ p("span", {
|
|
343
386
|
className: "inline-flex items-center gap-1 rounded bg-status-warning-bg-subtle px-1.5 py-0.5 text-xs font-medium text-status-warning-text",
|
|
344
|
-
children: [/* @__PURE__ */
|
|
387
|
+
children: [/* @__PURE__ */ f(u, {
|
|
345
388
|
className: "h-3 w-3",
|
|
346
389
|
"aria-hidden": "true"
|
|
347
390
|
}), " AI-drafted"]
|
|
348
391
|
})
|
|
349
392
|
]
|
|
350
|
-
}), e.aiRationale && /* @__PURE__ */
|
|
393
|
+
}), e.aiRationale && /* @__PURE__ */ f("p", {
|
|
351
394
|
className: "mt-1 text-xs font-normal text-text-tertiary",
|
|
352
395
|
children: e.aiRationale
|
|
353
396
|
})]
|
|
354
397
|
}),
|
|
355
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ f("td", {
|
|
356
399
|
className: "hidden px-4 py-3 text-text-secondary md:table-cell",
|
|
357
400
|
children: e.category ?? "—"
|
|
358
401
|
}),
|
|
359
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ f("td", {
|
|
360
403
|
className: "px-4 py-3 text-xs",
|
|
361
|
-
children: e.carbonEntryId ? /* @__PURE__ */
|
|
404
|
+
children: e.carbonEntryId ? /* @__PURE__ */ p("button", {
|
|
362
405
|
type: "button",
|
|
363
|
-
onClick: () =>
|
|
406
|
+
onClick: () => E(`carbon?highlight=${e.carbonEntryId}`),
|
|
364
407
|
className: "inline-flex items-center gap-1 font-medium text-text-primary underline underline-offset-2",
|
|
365
|
-
children: [/* @__PURE__ */
|
|
408
|
+
children: [/* @__PURE__ */ f(s, {
|
|
366
409
|
className: "h-3 w-3",
|
|
367
410
|
"aria-hidden": "true"
|
|
368
411
|
}), " Carbon entry"]
|
|
369
|
-
}) : e.sourceMeasurementId ? /* @__PURE__ */
|
|
412
|
+
}) : e.sourceMeasurementId ? /* @__PURE__ */ p("button", {
|
|
370
413
|
type: "button",
|
|
371
|
-
onClick: () =>
|
|
414
|
+
onClick: () => E("monitoring"),
|
|
372
415
|
className: "inline-flex items-center gap-1 font-medium text-text-primary underline underline-offset-2",
|
|
373
|
-
children: [/* @__PURE__ */
|
|
416
|
+
children: [/* @__PURE__ */ f(s, {
|
|
374
417
|
className: "h-3 w-3",
|
|
375
418
|
"aria-hidden": "true"
|
|
376
419
|
}), " Monitoring"]
|
|
377
|
-
}) : e.sourceMetricId ? /* @__PURE__ */
|
|
420
|
+
}) : e.sourceMetricId ? /* @__PURE__ */ p("button", {
|
|
378
421
|
type: "button",
|
|
379
|
-
onClick: () =>
|
|
422
|
+
onClick: () => E("metrics"),
|
|
380
423
|
className: "inline-flex items-center gap-1 font-medium text-text-primary underline underline-offset-2",
|
|
381
|
-
children: [/* @__PURE__ */
|
|
424
|
+
children: [/* @__PURE__ */ f(s, {
|
|
382
425
|
className: "h-3 w-3",
|
|
383
426
|
"aria-hidden": "true"
|
|
384
427
|
}), " ESG metric"]
|
|
385
|
-
}) : /* @__PURE__ */
|
|
428
|
+
}) : /* @__PURE__ */ f("span", {
|
|
386
429
|
className: "text-text-tertiary",
|
|
387
430
|
children: "Manual entry"
|
|
388
431
|
})
|
|
389
432
|
}),
|
|
390
|
-
/* @__PURE__ */
|
|
433
|
+
/* @__PURE__ */ p("td", {
|
|
391
434
|
className: "px-4 py-3 text-end text-text-primary tabular-nums",
|
|
392
435
|
children: [
|
|
393
|
-
|
|
436
|
+
he(e.value),
|
|
394
437
|
" ",
|
|
395
438
|
e.unit
|
|
396
439
|
]
|
|
397
440
|
})
|
|
398
441
|
]
|
|
399
442
|
}, e.id)) }),
|
|
400
|
-
/* @__PURE__ */
|
|
443
|
+
/* @__PURE__ */ f("tfoot", { children: /* @__PURE__ */ p("tr", {
|
|
401
444
|
className: "border-t-2 border-border-seam bg-bg-sunken/40",
|
|
402
|
-
children: [/* @__PURE__ */
|
|
445
|
+
children: [/* @__PURE__ */ f("td", {
|
|
403
446
|
className: "px-4 py-3 text-sm font-semibold text-text-primary",
|
|
404
447
|
colSpan: 3,
|
|
405
448
|
children: "Total"
|
|
406
|
-
}), /* @__PURE__ */
|
|
449
|
+
}), /* @__PURE__ */ p("td", {
|
|
407
450
|
className: "px-4 py-3 text-end text-base font-bold text-text-primary tabular-nums",
|
|
408
|
-
children: [
|
|
451
|
+
children: [he(Ee), Y ? ` ${Y}` : ""]
|
|
409
452
|
})]
|
|
410
453
|
}) })
|
|
411
454
|
]
|
|
@@ -413,116 +456,148 @@ function A() {
|
|
|
413
456
|
})
|
|
414
457
|
})
|
|
415
458
|
}),
|
|
416
|
-
/* @__PURE__ */
|
|
417
|
-
open:
|
|
418
|
-
onOpenChange:
|
|
419
|
-
children: /* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ f(v, {
|
|
460
|
+
open: we,
|
|
461
|
+
onOpenChange: I,
|
|
462
|
+
children: /* @__PURE__ */ p(y, { children: [/* @__PURE__ */ p(S, { children: [/* @__PURE__ */ f(C, { children: "Confirm publishing ESG report" }), /* @__PURE__ */ p(b, { children: [
|
|
420
463
|
"Publishing finalises ",
|
|
421
|
-
|
|
464
|
+
D.title,
|
|
422
465
|
" (",
|
|
423
|
-
|
|
466
|
+
D.framework,
|
|
424
467
|
") and prevents further AI drafting. Confirm you have reviewed all cited disclosures."
|
|
425
|
-
] })] }), /* @__PURE__ */
|
|
468
|
+
] })] }), /* @__PURE__ */ p(x, { children: [/* @__PURE__ */ f(m, {
|
|
426
469
|
variant: "ghost",
|
|
427
|
-
onClick: () =>
|
|
470
|
+
onClick: () => I(!1),
|
|
428
471
|
children: "Cancel"
|
|
429
|
-
}), /* @__PURE__ */
|
|
430
|
-
onClick:
|
|
431
|
-
disabled:
|
|
432
|
-
children:
|
|
472
|
+
}), /* @__PURE__ */ f(m, {
|
|
473
|
+
onClick: je,
|
|
474
|
+
disabled: j.isPending,
|
|
475
|
+
children: j.isPending ? "Publishing…" : "Confirm publish"
|
|
433
476
|
})] })] })
|
|
434
477
|
}),
|
|
435
|
-
/* @__PURE__ */
|
|
478
|
+
/* @__PURE__ */ f(v, {
|
|
479
|
+
open: Te,
|
|
480
|
+
onOpenChange: L,
|
|
481
|
+
children: /* @__PURE__ */ p(y, { children: [
|
|
482
|
+
/* @__PURE__ */ p(S, { children: [/* @__PURE__ */ f(C, { children: "Return report to draft" }), /* @__PURE__ */ p(b, { children: [
|
|
483
|
+
"Provide review feedback explaining what needs revision before ",
|
|
484
|
+
D.title,
|
|
485
|
+
" can be re-submitted."
|
|
486
|
+
] })] }),
|
|
487
|
+
/* @__PURE__ */ p("div", {
|
|
488
|
+
className: "grid gap-1.5 py-2",
|
|
489
|
+
children: [/* @__PURE__ */ f(_, {
|
|
490
|
+
htmlFor: "rejectReason",
|
|
491
|
+
children: "Reason *"
|
|
492
|
+
}), /* @__PURE__ */ f(g, {
|
|
493
|
+
id: "rejectReason",
|
|
494
|
+
value: R,
|
|
495
|
+
onChange: (e) => z(e.target.value),
|
|
496
|
+
placeholder: "Explain missing evidence or corrections required"
|
|
497
|
+
})]
|
|
498
|
+
}),
|
|
499
|
+
/* @__PURE__ */ p(x, { children: [/* @__PURE__ */ f(m, {
|
|
500
|
+
variant: "ghost",
|
|
501
|
+
onClick: () => L(!1),
|
|
502
|
+
children: "Cancel"
|
|
503
|
+
}), /* @__PURE__ */ f(m, {
|
|
504
|
+
onClick: Me,
|
|
505
|
+
disabled: M.isPending,
|
|
506
|
+
children: M.isPending ? "Returning…" : "Return to draft"
|
|
507
|
+
})] })
|
|
508
|
+
] })
|
|
509
|
+
}),
|
|
510
|
+
/* @__PURE__ */ f(me, {
|
|
436
511
|
entityType: "ecoimpacthub-report",
|
|
437
|
-
entityId:
|
|
512
|
+
entityId: D.id,
|
|
438
513
|
description: "Coordinate review and sign-off on this disclosure with your team."
|
|
439
514
|
}),
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
open:
|
|
442
|
-
onOpenChange:
|
|
443
|
-
children: /* @__PURE__ */
|
|
444
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ f(v, {
|
|
516
|
+
open: Ce,
|
|
517
|
+
onOpenChange: F,
|
|
518
|
+
children: /* @__PURE__ */ p(y, { children: [
|
|
519
|
+
/* @__PURE__ */ p(S, { children: [/* @__PURE__ */ f(C, { children: "Add line item" }), /* @__PURE__ */ p(b, { children: [
|
|
445
520
|
"Record a quantified disclosure for ",
|
|
446
|
-
|
|
521
|
+
D.title,
|
|
447
522
|
"."
|
|
448
523
|
] })] }),
|
|
449
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ p("div", {
|
|
450
525
|
className: "grid gap-4 py-2",
|
|
451
526
|
children: [
|
|
452
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ p("div", {
|
|
453
528
|
className: "grid gap-1.5",
|
|
454
|
-
children: [/* @__PURE__ */ _
|
|
529
|
+
children: [/* @__PURE__ */ f(_, {
|
|
455
530
|
htmlFor: "liLabel",
|
|
456
531
|
children: "Label *"
|
|
457
|
-
}), /* @__PURE__ */
|
|
532
|
+
}), /* @__PURE__ */ f(g, {
|
|
458
533
|
id: "liLabel",
|
|
459
|
-
value:
|
|
460
|
-
onChange: (e) =>
|
|
461
|
-
...
|
|
534
|
+
value: H.label,
|
|
535
|
+
onChange: (e) => U({
|
|
536
|
+
...H,
|
|
462
537
|
label: e.target.value
|
|
463
538
|
}),
|
|
464
539
|
placeholder: "Scope 1 emissions"
|
|
465
540
|
})]
|
|
466
541
|
}),
|
|
467
|
-
/* @__PURE__ */
|
|
542
|
+
/* @__PURE__ */ p("div", {
|
|
468
543
|
className: "grid gap-2 sm:grid-cols-2",
|
|
469
|
-
children: [/* @__PURE__ */
|
|
544
|
+
children: [/* @__PURE__ */ p("div", {
|
|
470
545
|
className: "grid gap-1.5",
|
|
471
|
-
children: [/* @__PURE__ */ _
|
|
546
|
+
children: [/* @__PURE__ */ f(_, {
|
|
472
547
|
htmlFor: "liValue",
|
|
473
548
|
children: "Value *"
|
|
474
|
-
}), /* @__PURE__ */
|
|
549
|
+
}), /* @__PURE__ */ f(g, {
|
|
475
550
|
id: "liValue",
|
|
476
551
|
type: "number",
|
|
477
552
|
step: "any",
|
|
478
|
-
value:
|
|
479
|
-
onChange: (e) =>
|
|
480
|
-
...
|
|
553
|
+
value: H.value,
|
|
554
|
+
onChange: (e) => U({
|
|
555
|
+
...H,
|
|
481
556
|
value: e.target.value
|
|
482
557
|
}),
|
|
483
558
|
placeholder: "1250"
|
|
484
559
|
})]
|
|
485
|
-
}), /* @__PURE__ */
|
|
560
|
+
}), /* @__PURE__ */ p("div", {
|
|
486
561
|
className: "grid gap-1.5",
|
|
487
|
-
children: [/* @__PURE__ */ _
|
|
562
|
+
children: [/* @__PURE__ */ f(_, {
|
|
488
563
|
htmlFor: "liUnit",
|
|
489
564
|
children: "Unit *"
|
|
490
|
-
}), /* @__PURE__ */
|
|
565
|
+
}), /* @__PURE__ */ f(g, {
|
|
491
566
|
id: "liUnit",
|
|
492
|
-
value:
|
|
493
|
-
onChange: (e) =>
|
|
494
|
-
...
|
|
567
|
+
value: H.unit,
|
|
568
|
+
onChange: (e) => U({
|
|
569
|
+
...H,
|
|
495
570
|
unit: e.target.value
|
|
496
571
|
}),
|
|
497
572
|
placeholder: "t CO₂e"
|
|
498
573
|
})]
|
|
499
574
|
})]
|
|
500
575
|
}),
|
|
501
|
-
/* @__PURE__ */
|
|
576
|
+
/* @__PURE__ */ p("div", {
|
|
502
577
|
className: "grid gap-1.5",
|
|
503
|
-
children: [/* @__PURE__ */ _
|
|
578
|
+
children: [/* @__PURE__ */ f(_, {
|
|
504
579
|
htmlFor: "liCategory",
|
|
505
580
|
children: "Category"
|
|
506
|
-
}), /* @__PURE__ */
|
|
581
|
+
}), /* @__PURE__ */ f(g, {
|
|
507
582
|
id: "liCategory",
|
|
508
|
-
value:
|
|
509
|
-
onChange: (e) =>
|
|
510
|
-
...
|
|
583
|
+
value: H.category,
|
|
584
|
+
onChange: (e) => U({
|
|
585
|
+
...H,
|
|
511
586
|
category: e.target.value
|
|
512
587
|
}),
|
|
513
588
|
placeholder: "Optional grouping, e.g. Energy"
|
|
514
589
|
})]
|
|
515
590
|
}),
|
|
516
|
-
/* @__PURE__ */
|
|
591
|
+
/* @__PURE__ */ p("div", {
|
|
517
592
|
className: "grid gap-1.5",
|
|
518
|
-
children: [/* @__PURE__ */ _
|
|
593
|
+
children: [/* @__PURE__ */ f(_, {
|
|
519
594
|
htmlFor: "liCarbonEntry",
|
|
520
595
|
children: "Carbon entry ID"
|
|
521
|
-
}), /* @__PURE__ */
|
|
596
|
+
}), /* @__PURE__ */ f(g, {
|
|
522
597
|
id: "liCarbonEntry",
|
|
523
|
-
value:
|
|
524
|
-
onChange: (e) =>
|
|
525
|
-
...
|
|
598
|
+
value: H.carbonEntryId,
|
|
599
|
+
onChange: (e) => U({
|
|
600
|
+
...H,
|
|
526
601
|
carbonEntryId: e.target.value
|
|
527
602
|
}),
|
|
528
603
|
placeholder: "Optional linked carbon-ledger entry"
|
|
@@ -530,20 +605,20 @@ function A() {
|
|
|
530
605
|
})
|
|
531
606
|
]
|
|
532
607
|
}),
|
|
533
|
-
/* @__PURE__ */
|
|
608
|
+
/* @__PURE__ */ p(x, { children: [/* @__PURE__ */ f(m, {
|
|
534
609
|
variant: "outline",
|
|
535
|
-
onClick: () =>
|
|
610
|
+
onClick: () => F(!1),
|
|
536
611
|
children: "Cancel"
|
|
537
|
-
}), /* @__PURE__ */
|
|
538
|
-
onClick:
|
|
539
|
-
disabled:
|
|
540
|
-
children:
|
|
612
|
+
}), /* @__PURE__ */ f(m, {
|
|
613
|
+
onClick: ke,
|
|
614
|
+
disabled: k.isPending,
|
|
615
|
+
children: k.isPending ? "Adding…" : "Add line item"
|
|
541
616
|
})] })
|
|
542
617
|
] })
|
|
543
618
|
})
|
|
544
619
|
]
|
|
545
620
|
});
|
|
546
621
|
}
|
|
547
|
-
export {
|
|
622
|
+
export { T as ReportDetailPage };
|
|
548
623
|
|
|
549
624
|
//# sourceMappingURL=ReportDetailPage.js.map
|