@burdenoff/microfe-theglobalfuel 2026.704.1 → 2026.705.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/node_modules/{.bun/clsx@2.1.1/node_modules/clsx → clsx}/dist/clsx.js +1 -1
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/{.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge → tailwind-merge}/dist/bundle-mjs.js +212 -170
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/dist/theglobalfuel/components/DataTable.js +37 -27
- package/dist/theglobalfuel/components/DataTable.js.map +1 -1
- package/dist/theglobalfuel/hooks/index.js +1 -0
- package/dist/theglobalfuel/hooks/useNotify.js +19 -0
- package/dist/theglobalfuel/hooks/useNotify.js.map +1 -0
- package/dist/theglobalfuel/hooks/useTheFiles.js +4 -1
- package/dist/theglobalfuel/hooks/useTheFiles.js.map +1 -1
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js +59 -31
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js.map +1 -1
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.js +367 -321
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.js.map +1 -1
- package/dist/theglobalfuel/pages/assets/AssetsPage.js +66 -54
- package/dist/theglobalfuel/pages/assets/AssetsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/compliance/CompliancePage.js +346 -182
- package/dist/theglobalfuel/pages/compliance/CompliancePage.js.map +1 -1
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js +418 -390
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js.map +1 -1
- package/dist/theglobalfuel/pages/contracts/ContractsPage.js +238 -230
- package/dist/theglobalfuel/pages/contracts/ContractsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.js +5 -3
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.js.map +1 -1
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.js +201 -177
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/inventory/InventoryPage.js +271 -238
- package/dist/theglobalfuel/pages/inventory/InventoryPage.js.map +1 -1
- package/dist/theglobalfuel/pages/production/ProductionPage.js +185 -177
- package/dist/theglobalfuel/pages/production/ProductionPage.js.map +1 -1
- package/dist/theglobalfuel/pages/reserves/ReservesPage.js +160 -138
- package/dist/theglobalfuel/pages/reserves/ReservesPage.js.map +1 -1
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js +250 -198
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js.map +1 -1
- package/dist/theglobalfuel/utils/cn.js +2 -2
- package/dist/theglobalfuel/utils/formatters.js +6 -1
- package/dist/theglobalfuel/utils/formatters.js.map +1 -1
- package/dist/theglobalfuel/utils/transitions.js +70 -0
- package/dist/theglobalfuel/utils/transitions.js.map +1 -0
- package/package.json +1 -1
- package/dist/dev/main.d.ts +0 -2
- package/dist/dev/main.d.ts.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js.map +0 -1
- package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js.map +0 -1
- package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts +0 -5
- package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts.map +0 -1
- package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts +0 -4
- package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts.map +0 -1
- package/dist/theglobalfuel/components/DataTable.d.ts +0 -28
- package/dist/theglobalfuel/components/DataTable.d.ts.map +0 -1
- package/dist/theglobalfuel/components/EmptyState.d.ts +0 -18
- package/dist/theglobalfuel/components/EmptyState.d.ts.map +0 -1
- package/dist/theglobalfuel/components/EvidenceUpload.d.ts +0 -14
- package/dist/theglobalfuel/components/EvidenceUpload.d.ts.map +0 -1
- package/dist/theglobalfuel/components/FileLink.d.ts +0 -15
- package/dist/theglobalfuel/components/FileLink.d.ts.map +0 -1
- package/dist/theglobalfuel/components/FilterTabs.d.ts +0 -18
- package/dist/theglobalfuel/components/FilterTabs.d.ts.map +0 -1
- package/dist/theglobalfuel/components/MetricsCard.d.ts +0 -23
- package/dist/theglobalfuel/components/MetricsCard.d.ts.map +0 -1
- package/dist/theglobalfuel/components/MiniBar.d.ts +0 -16
- package/dist/theglobalfuel/components/MiniBar.d.ts.map +0 -1
- package/dist/theglobalfuel/components/PageLayout.d.ts +0 -16
- package/dist/theglobalfuel/components/PageLayout.d.ts.map +0 -1
- package/dist/theglobalfuel/components/Pagination.d.ts +0 -22
- package/dist/theglobalfuel/components/Pagination.d.ts.map +0 -1
- package/dist/theglobalfuel/components/StateViews.d.ts +0 -24
- package/dist/theglobalfuel/components/StateViews.d.ts.map +0 -1
- package/dist/theglobalfuel/components/StatusBadge.d.ts +0 -9
- package/dist/theglobalfuel/components/StatusBadge.d.ts.map +0 -1
- package/dist/theglobalfuel/components/Tabs.d.ts +0 -17
- package/dist/theglobalfuel/components/Tabs.d.ts.map +0 -1
- package/dist/theglobalfuel/components/TheDiscussion.d.ts +0 -18
- package/dist/theglobalfuel/components/TheDiscussion.d.ts.map +0 -1
- package/dist/theglobalfuel/components/TheTags.d.ts +0 -17
- package/dist/theglobalfuel/components/TheTags.d.ts.map +0 -1
- package/dist/theglobalfuel/components/index.d.ts +0 -19
- package/dist/theglobalfuel/components/index.d.ts.map +0 -1
- package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts +0 -16
- package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts.map +0 -1
- package/dist/theglobalfuel/context/index.d.ts +0 -6
- package/dist/theglobalfuel/context/index.d.ts.map +0 -1
- package/dist/theglobalfuel/hooks/index.d.ts +0 -10
- package/dist/theglobalfuel/hooks/index.d.ts.map +0 -1
- package/dist/theglobalfuel/hooks/useCursorPager.d.ts +0 -33
- package/dist/theglobalfuel/hooks/useCursorPager.d.ts.map +0 -1
- package/dist/theglobalfuel/hooks/useTheComments.d.ts +0 -36
- package/dist/theglobalfuel/hooks/useTheComments.d.ts.map +0 -1
- package/dist/theglobalfuel/hooks/useTheFiles.d.ts +0 -47
- package/dist/theglobalfuel/hooks/useTheFiles.d.ts.map +0 -1
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts +0 -75
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts.map +0 -1
- package/dist/theglobalfuel/hooks/useTheTags.d.ts +0 -44
- package/dist/theglobalfuel/hooks/useTheTags.d.ts.map +0 -1
- package/dist/theglobalfuel/index.d.ts +0 -9
- package/dist/theglobalfuel/index.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts +0 -13
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts +0 -10
- package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts +0 -11
- package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts +0 -9
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts +0 -8
- package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts +0 -13
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts +0 -12
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts +0 -11
- package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/production/ProductionPage.d.ts +0 -11
- package/dist/theglobalfuel/pages/production/ProductionPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts +0 -10
- package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts +0 -10
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts.map +0 -1
- package/dist/theglobalfuel/types/index.d.ts +0 -376
- package/dist/theglobalfuel/types/index.d.ts.map +0 -1
- package/dist/theglobalfuel/utils/cn.d.ts +0 -4
- package/dist/theglobalfuel/utils/cn.d.ts.map +0 -1
- package/dist/theglobalfuel/utils/formatters.d.ts +0 -36
- package/dist/theglobalfuel/utils/formatters.d.ts.map +0 -1
- package/dist/theglobalfuel/utils/i18n.d.ts +0 -6
- package/dist/theglobalfuel/utils/i18n.d.ts.map +0 -1
- package/dist/theglobalfuel/utils/index.d.ts +0 -9
- package/dist/theglobalfuel/utils/index.d.ts.map +0 -1
- package/dist/theglobalfuel/utils/navigation.d.ts +0 -14
- package/dist/theglobalfuel/utils/navigation.d.ts.map +0 -1
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { useTheGlobalFuel as e } from "../../context/TheGlobalFuelContext.js";
|
|
2
2
|
import { PageLayout as ee } from "../../components/PageLayout.js";
|
|
3
|
-
import { formatEnumLabel as t, formatMoney as n, formatUnit as r, formatVolume as i } from "../../utils/formatters.js";
|
|
4
|
-
import { StatusBadge as
|
|
5
|
-
import { MiniBar as
|
|
6
|
-
import { DataTable as
|
|
7
|
-
import { ErrorView as
|
|
8
|
-
import { EmptyState as
|
|
3
|
+
import { formatEnumLabel as t, formatMoney as n, formatUnit as r, formatVolume as i, toBackendDate as a } from "../../utils/formatters.js";
|
|
4
|
+
import { StatusBadge as o } from "../../components/StatusBadge.js";
|
|
5
|
+
import { MiniBar as s } from "../../components/MiniBar.js";
|
|
6
|
+
import { DataTable as c } from "../../components/DataTable.js";
|
|
7
|
+
import { ErrorView as l, LoadingView as u } from "../../components/StateViews.js";
|
|
8
|
+
import { EmptyState as d } from "../../components/EmptyState.js";
|
|
9
9
|
import "../../context/index.js";
|
|
10
|
-
import { useTheContracts as
|
|
11
|
-
import { useCursorPager as
|
|
10
|
+
import { useTheContracts as f, useTheCreateContract as p } from "../../hooks/useTheGlobalFuelApi.js";
|
|
11
|
+
import { useCursorPager as te } from "../../hooks/useCursorPager.js";
|
|
12
|
+
import { useNotify as ne } from "../../hooks/useNotify.js";
|
|
12
13
|
import "../../hooks/index.js";
|
|
13
|
-
import { FilterTabs as
|
|
14
|
-
import { Pagination as
|
|
15
|
-
import { useMemo as
|
|
16
|
-
import { FileSignature as
|
|
17
|
-
import { Fragment as
|
|
18
|
-
import { Button as
|
|
14
|
+
import { FilterTabs as re } from "../../components/FilterTabs.js";
|
|
15
|
+
import { Pagination as ie } from "../../components/Pagination.js";
|
|
16
|
+
import { useMemo as ae, useState as m } from "react";
|
|
17
|
+
import { FileSignature as h, Plus as g } from "lucide-react";
|
|
18
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
19
|
+
import { Button as b, Input as x, Label as S, ResponsiveDialog as oe, ResponsiveDialogContent as se, ResponsiveDialogDescription as ce, ResponsiveDialogFooter as le, ResponsiveDialogHeader as ue, ResponsiveDialogTitle as de, Select as C, SelectContent as w, SelectItem as T, SelectTrigger as E, SelectValue as D, Textarea as fe } from "@burdenoff/fe-libs/ui";
|
|
19
20
|
//#region src/theglobalfuel/pages/contracts/ContractsPage.tsx
|
|
20
|
-
var
|
|
21
|
+
var O = [
|
|
21
22
|
{
|
|
22
23
|
value: "ALL",
|
|
23
24
|
label: "All"
|
|
@@ -50,12 +51,12 @@ var k = [
|
|
|
50
51
|
value: "TERMINATED",
|
|
51
52
|
label: "Terminated"
|
|
52
53
|
}
|
|
53
|
-
],
|
|
54
|
+
], k = ["BUY", "SELL"], A = [
|
|
54
55
|
"FIXED",
|
|
55
56
|
"INDEX_LINKED",
|
|
56
57
|
"FORMULA",
|
|
57
58
|
"SPOT"
|
|
58
|
-
],
|
|
59
|
+
], j = [
|
|
59
60
|
"CRUDE_OIL",
|
|
60
61
|
"NATURAL_GAS",
|
|
61
62
|
"LNG",
|
|
@@ -69,7 +70,7 @@ var k = [
|
|
|
69
70
|
"GOLD",
|
|
70
71
|
"LITHIUM",
|
|
71
72
|
"RARE_EARTH"
|
|
72
|
-
],
|
|
73
|
+
], M = [
|
|
73
74
|
"BARRELS",
|
|
74
75
|
"CUBIC_METERS",
|
|
75
76
|
"TONNES",
|
|
@@ -77,7 +78,7 @@ var k = [
|
|
|
77
78
|
"MWH",
|
|
78
79
|
"GJ",
|
|
79
80
|
"MCF"
|
|
80
|
-
],
|
|
81
|
+
], N = 25, P = (e) => Math.max(0, Math.min(100, e)), F = (e) => e.contractedVolume > 0 ? P(e.deliveredVolume / e.contractedVolume * 100) : 0, I = {
|
|
81
82
|
reference: "",
|
|
82
83
|
counterparty: "",
|
|
83
84
|
commodity: "CRUDE_OIL",
|
|
@@ -93,30 +94,30 @@ var k = [
|
|
|
93
94
|
endDate: "",
|
|
94
95
|
notes: ""
|
|
95
96
|
};
|
|
96
|
-
function
|
|
97
|
-
let { navigateTo:
|
|
97
|
+
function L() {
|
|
98
|
+
let { navigateTo: P } = e(), L = ne(), [R, z] = m("ALL"), [B, V] = m("ALL"), [H, pe] = m("ALL"), U = te(), [me, W] = m(!1), [G, K] = m(I), [q, J] = m(null), { data: Y, isLoading: he, isError: ge, refetch: _e } = f({
|
|
98
99
|
status: R === "ALL" ? void 0 : R,
|
|
99
100
|
side: B === "ALL" ? void 0 : B,
|
|
100
101
|
commodity: H === "ALL" ? void 0 : H,
|
|
101
102
|
pagination: {
|
|
102
|
-
limit:
|
|
103
|
-
cursor:
|
|
103
|
+
limit: N,
|
|
104
|
+
cursor: U.cursor
|
|
104
105
|
}
|
|
105
|
-
}),
|
|
106
|
+
}), X = p(), Z = ae(() => Y?.items ?? [], [Y]), Q = [
|
|
106
107
|
{
|
|
107
108
|
key: "reference",
|
|
108
109
|
header: "Contract",
|
|
109
|
-
render: (e) => /* @__PURE__ */
|
|
110
|
+
render: (e) => /* @__PURE__ */ y("div", {
|
|
110
111
|
className: "flex items-center gap-3",
|
|
111
|
-
children: [/* @__PURE__ */
|
|
112
|
+
children: [/* @__PURE__ */ v("div", {
|
|
112
113
|
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-accent",
|
|
113
|
-
children: /* @__PURE__ */
|
|
114
|
-
}), /* @__PURE__ */
|
|
114
|
+
children: /* @__PURE__ */ v(h, { className: "h-4 w-4" })
|
|
115
|
+
}), /* @__PURE__ */ y("div", {
|
|
115
116
|
className: "min-w-0",
|
|
116
|
-
children: [/* @__PURE__ */
|
|
117
|
+
children: [/* @__PURE__ */ v("p", {
|
|
117
118
|
className: "truncate font-semibold text-text-primary",
|
|
118
119
|
children: e.reference
|
|
119
|
-
}), /* @__PURE__ */
|
|
120
|
+
}), /* @__PURE__ */ v("p", {
|
|
120
121
|
className: "truncate text-xs text-text-tertiary",
|
|
121
122
|
children: e.counterparty
|
|
122
123
|
})]
|
|
@@ -126,13 +127,13 @@ function R() {
|
|
|
126
127
|
{
|
|
127
128
|
key: "side",
|
|
128
129
|
header: "Side",
|
|
129
|
-
render: (e) => /* @__PURE__ */
|
|
130
|
+
render: (e) => /* @__PURE__ */ v(o, { status: e.side })
|
|
130
131
|
},
|
|
131
132
|
{
|
|
132
133
|
key: "commodity",
|
|
133
134
|
header: "Commodity",
|
|
134
135
|
hideOnMobile: !0,
|
|
135
|
-
render: (e) => /* @__PURE__ */
|
|
136
|
+
render: (e) => /* @__PURE__ */ v("span", {
|
|
136
137
|
className: "text-text-secondary",
|
|
137
138
|
children: t(e.commodity)
|
|
138
139
|
})
|
|
@@ -140,7 +141,7 @@ function R() {
|
|
|
140
141
|
{
|
|
141
142
|
key: "status",
|
|
142
143
|
header: "Status",
|
|
143
|
-
render: (e) => /* @__PURE__ */
|
|
144
|
+
render: (e) => /* @__PURE__ */ v(o, { status: e.status })
|
|
144
145
|
},
|
|
145
146
|
{
|
|
146
147
|
key: "price",
|
|
@@ -148,9 +149,9 @@ function R() {
|
|
|
148
149
|
align: "right",
|
|
149
150
|
hideOnMobile: !0,
|
|
150
151
|
sortValue: (e) => e.pricePerUnit,
|
|
151
|
-
render: (e) => /* @__PURE__ */
|
|
152
|
+
render: (e) => /* @__PURE__ */ y("span", {
|
|
152
153
|
className: "tabular-nums text-text-secondary",
|
|
153
|
-
children: [n(e.pricePerUnit, e.currency), /* @__PURE__ */
|
|
154
|
+
children: [n(e.pricePerUnit, e.currency), /* @__PURE__ */ y("span", {
|
|
154
155
|
className: "text-text-tertiary",
|
|
155
156
|
children: ["/", r(e.unit)]
|
|
156
157
|
})]
|
|
@@ -159,14 +160,14 @@ function R() {
|
|
|
159
160
|
{
|
|
160
161
|
key: "delivery",
|
|
161
162
|
header: "Delivered",
|
|
162
|
-
sortValue: (e) =>
|
|
163
|
-
render: (e) => /* @__PURE__ */
|
|
163
|
+
sortValue: (e) => F(e),
|
|
164
|
+
render: (e) => /* @__PURE__ */ y("div", {
|
|
164
165
|
className: "min-w-[9rem]",
|
|
165
|
-
children: [/* @__PURE__ */
|
|
166
|
-
value:
|
|
166
|
+
children: [/* @__PURE__ */ v(s, {
|
|
167
|
+
value: F(e),
|
|
167
168
|
barClassName: "bg-[var(--color-status-success-text)]",
|
|
168
169
|
className: "mb-1"
|
|
169
|
-
}), /* @__PURE__ */
|
|
170
|
+
}), /* @__PURE__ */ y("p", {
|
|
170
171
|
className: "text-xs tabular-nums text-text-tertiary",
|
|
171
172
|
children: [
|
|
172
173
|
i(e.deliveredVolume, e.unit),
|
|
@@ -181,7 +182,7 @@ function R() {
|
|
|
181
182
|
header: "Updated",
|
|
182
183
|
align: "right",
|
|
183
184
|
hideOnMobile: !0,
|
|
184
|
-
render: (e) => /* @__PURE__ */
|
|
185
|
+
render: (e) => /* @__PURE__ */ v("span", {
|
|
185
186
|
className: "text-text-tertiary",
|
|
186
187
|
children: new Date(e.updatedAt).toLocaleDateString(void 0, {
|
|
187
188
|
day: "numeric",
|
|
@@ -191,256 +192,292 @@ function R() {
|
|
|
191
192
|
})
|
|
192
193
|
}
|
|
193
194
|
], $ = () => {
|
|
194
|
-
|
|
195
|
+
K(I), J(null);
|
|
196
|
+
}, ve = async () => {
|
|
197
|
+
if (!G.reference.trim()) {
|
|
198
|
+
J("Contract reference is required.");
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if (!G.counterparty.trim()) {
|
|
202
|
+
J("Counterparty is required.");
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
J(null);
|
|
206
|
+
try {
|
|
207
|
+
let e = await X.mutateAsync({
|
|
208
|
+
reference: G.reference.trim(),
|
|
209
|
+
counterparty: G.counterparty.trim(),
|
|
210
|
+
commodity: G.commodity,
|
|
211
|
+
side: G.side,
|
|
212
|
+
pricingBasis: G.pricingBasis,
|
|
213
|
+
pricePerUnit: G.pricePerUnit ? Number(G.pricePerUnit) : null,
|
|
214
|
+
priceIndex: G.priceIndex.trim() || null,
|
|
215
|
+
currency: G.currency.trim().toUpperCase() || "USD",
|
|
216
|
+
contractedVolume: G.contractedVolume ? Number(G.contractedVolume) : null,
|
|
217
|
+
unit: G.unit,
|
|
218
|
+
deliveryLocation: G.deliveryLocation.trim() || null,
|
|
219
|
+
startDate: a(G.startDate) ?? null,
|
|
220
|
+
endDate: a(G.endDate) ?? null,
|
|
221
|
+
notes: G.notes.trim() || null
|
|
222
|
+
});
|
|
223
|
+
L.success("Contract created"), W(!1), $(), P(`contracts/${e.id}`);
|
|
224
|
+
} catch (e) {
|
|
225
|
+
J(e instanceof Error ? e.message : "Failed to create contract."), L.fromError(e);
|
|
226
|
+
}
|
|
195
227
|
};
|
|
196
|
-
return /* @__PURE__ */
|
|
228
|
+
return /* @__PURE__ */ y(ee, {
|
|
197
229
|
title: "Offtake Contracts",
|
|
198
230
|
description: "Commodity purchase & sale agreements — pricing, contracted volume and delivery progress.",
|
|
199
|
-
actions: /* @__PURE__ */
|
|
200
|
-
onClick: () =>
|
|
201
|
-
children: [/* @__PURE__ */
|
|
231
|
+
actions: /* @__PURE__ */ y(b, {
|
|
232
|
+
onClick: () => W(!0),
|
|
233
|
+
children: [/* @__PURE__ */ v(g, { className: "mr-1.5 h-4 w-4" }), " New contract"]
|
|
202
234
|
}),
|
|
203
235
|
children: [
|
|
204
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ y("div", {
|
|
205
237
|
className: "mb-5 flex flex-wrap items-center gap-3",
|
|
206
238
|
children: [
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
-
options:
|
|
239
|
+
/* @__PURE__ */ v(re, {
|
|
240
|
+
options: O,
|
|
209
241
|
value: R,
|
|
210
242
|
onChange: (e) => {
|
|
211
|
-
z(e),
|
|
243
|
+
z(e), U.reset();
|
|
212
244
|
}
|
|
213
245
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ y(C, {
|
|
215
247
|
value: B,
|
|
216
248
|
onValueChange: (e) => {
|
|
217
|
-
V(e),
|
|
249
|
+
V(e), U.reset();
|
|
218
250
|
},
|
|
219
|
-
children: [/* @__PURE__ */
|
|
251
|
+
children: [/* @__PURE__ */ v(E, {
|
|
220
252
|
className: "w-40",
|
|
221
|
-
|
|
222
|
-
|
|
253
|
+
"aria-label": "Filter by side",
|
|
254
|
+
children: /* @__PURE__ */ v(D, { placeholder: "All sides" })
|
|
255
|
+
}), /* @__PURE__ */ y(w, { children: [/* @__PURE__ */ v(T, {
|
|
223
256
|
value: "ALL",
|
|
224
257
|
children: "All sides"
|
|
225
|
-
}),
|
|
258
|
+
}), k.map((e) => /* @__PURE__ */ v(T, {
|
|
226
259
|
value: e,
|
|
227
260
|
children: t(e)
|
|
228
261
|
}, e))] })]
|
|
229
262
|
}),
|
|
230
|
-
/* @__PURE__ */
|
|
263
|
+
/* @__PURE__ */ y(C, {
|
|
231
264
|
value: H,
|
|
232
265
|
onValueChange: (e) => {
|
|
233
|
-
|
|
266
|
+
pe(e), U.reset();
|
|
234
267
|
},
|
|
235
|
-
children: [/* @__PURE__ */
|
|
268
|
+
children: [/* @__PURE__ */ v(E, {
|
|
236
269
|
className: "w-48",
|
|
237
|
-
|
|
238
|
-
|
|
270
|
+
"aria-label": "Filter by commodity",
|
|
271
|
+
children: /* @__PURE__ */ v(D, { placeholder: "All commodities" })
|
|
272
|
+
}), /* @__PURE__ */ y(w, { children: [/* @__PURE__ */ v(T, {
|
|
239
273
|
value: "ALL",
|
|
240
274
|
children: "All commodities"
|
|
241
|
-
}),
|
|
275
|
+
}), j.map((e) => /* @__PURE__ */ v(T, {
|
|
242
276
|
value: e,
|
|
243
277
|
children: t(e)
|
|
244
278
|
}, e))] })]
|
|
245
279
|
})
|
|
246
280
|
]
|
|
247
281
|
}),
|
|
248
|
-
|
|
282
|
+
he ? /* @__PURE__ */ v(u, { label: "Loading contracts…" }) : ge ? /* @__PURE__ */ v(l, {
|
|
249
283
|
message: "Couldn't load contracts.",
|
|
250
|
-
onRetry: () =>
|
|
251
|
-
}) :
|
|
284
|
+
onRetry: () => _e()
|
|
285
|
+
}) : Z.length === 0 ? /* @__PURE__ */ v(d, {
|
|
252
286
|
illustration: "empty-data",
|
|
253
|
-
icon: /* @__PURE__ */
|
|
287
|
+
icon: /* @__PURE__ */ v(h, { className: "h-10 w-10" }),
|
|
254
288
|
title: "No contracts yet",
|
|
255
289
|
description: R === "ALL" && B === "ALL" && H === "ALL" ? "Create your first offtake contract to track pricing, volume and delivery." : "No contracts match these filters.",
|
|
256
|
-
action: /* @__PURE__ */
|
|
257
|
-
onClick: () =>
|
|
258
|
-
children: [/* @__PURE__ */
|
|
290
|
+
action: /* @__PURE__ */ y(b, {
|
|
291
|
+
onClick: () => W(!0),
|
|
292
|
+
children: [/* @__PURE__ */ v(g, { className: "mr-1.5 h-4 w-4" }), " New contract"]
|
|
259
293
|
})
|
|
260
|
-
}) : /* @__PURE__ */
|
|
261
|
-
columns:
|
|
262
|
-
rows:
|
|
294
|
+
}) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(c, {
|
|
295
|
+
columns: Q,
|
|
296
|
+
rows: Z,
|
|
263
297
|
rowKey: (e) => e.id,
|
|
264
|
-
onRowClick: (e) =>
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
298
|
+
onRowClick: (e) => P(`contracts/${e.id}`),
|
|
299
|
+
rowLabel: (e) => `Open ${e.reference}`
|
|
300
|
+
}), /* @__PURE__ */ v(ie, {
|
|
301
|
+
page: U.page,
|
|
302
|
+
pageSize: N,
|
|
303
|
+
itemCount: Z.length,
|
|
304
|
+
hasMore: Y?.pageInfo?.hasMore ?? !1,
|
|
305
|
+
onPageChange: (e) => U.onPageChange(e, Y?.pageInfo?.cursor)
|
|
271
306
|
})] }),
|
|
272
|
-
/* @__PURE__ */
|
|
273
|
-
open:
|
|
307
|
+
/* @__PURE__ */ v(oe, {
|
|
308
|
+
open: me,
|
|
274
309
|
onOpenChange: (e) => {
|
|
275
|
-
|
|
310
|
+
W(e), e || $();
|
|
276
311
|
},
|
|
277
|
-
children: /* @__PURE__ */
|
|
278
|
-
|
|
279
|
-
|
|
312
|
+
children: /* @__PURE__ */ y(se, { children: [/* @__PURE__ */ y(ue, { children: [/* @__PURE__ */ v(de, { children: "New offtake contract" }), /* @__PURE__ */ v(ce, { children: "Register a commodity purchase or sale agreement with a counterparty." })] }), /* @__PURE__ */ y("form", {
|
|
313
|
+
onSubmit: (e) => {
|
|
314
|
+
e.preventDefault(), ve();
|
|
315
|
+
},
|
|
316
|
+
children: [/* @__PURE__ */ y("div", {
|
|
280
317
|
className: "grid gap-4 py-2",
|
|
281
318
|
children: [
|
|
282
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ y("div", {
|
|
283
320
|
className: "grid gap-2 sm:grid-cols-2",
|
|
284
|
-
children: [/* @__PURE__ */
|
|
321
|
+
children: [/* @__PURE__ */ y("div", {
|
|
285
322
|
className: "grid gap-1.5",
|
|
286
|
-
children: [/* @__PURE__ */
|
|
323
|
+
children: [/* @__PURE__ */ v(S, {
|
|
287
324
|
htmlFor: "reference",
|
|
288
325
|
children: "Reference *"
|
|
289
|
-
}), /* @__PURE__ */
|
|
326
|
+
}), /* @__PURE__ */ v(x, {
|
|
290
327
|
id: "reference",
|
|
291
|
-
value:
|
|
292
|
-
onChange: (e) =>
|
|
293
|
-
...
|
|
328
|
+
value: G.reference,
|
|
329
|
+
onChange: (e) => K({
|
|
330
|
+
...G,
|
|
294
331
|
reference: e.target.value
|
|
295
332
|
}),
|
|
296
333
|
placeholder: "OFT-2026-0142"
|
|
297
334
|
})]
|
|
298
|
-
}), /* @__PURE__ */
|
|
335
|
+
}), /* @__PURE__ */ y("div", {
|
|
299
336
|
className: "grid gap-1.5",
|
|
300
|
-
children: [/* @__PURE__ */
|
|
337
|
+
children: [/* @__PURE__ */ v(S, {
|
|
301
338
|
htmlFor: "counterparty",
|
|
302
339
|
children: "Counterparty *"
|
|
303
|
-
}), /* @__PURE__ */
|
|
340
|
+
}), /* @__PURE__ */ v(x, {
|
|
304
341
|
id: "counterparty",
|
|
305
|
-
value:
|
|
306
|
-
onChange: (e) =>
|
|
307
|
-
...
|
|
342
|
+
value: G.counterparty,
|
|
343
|
+
onChange: (e) => K({
|
|
344
|
+
...G,
|
|
308
345
|
counterparty: e.target.value
|
|
309
346
|
}),
|
|
310
347
|
placeholder: "Vitol S.A."
|
|
311
348
|
})]
|
|
312
349
|
})]
|
|
313
350
|
}),
|
|
314
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ y("div", {
|
|
315
352
|
className: "grid gap-2 sm:grid-cols-2",
|
|
316
|
-
children: [/* @__PURE__ */
|
|
353
|
+
children: [/* @__PURE__ */ y("div", {
|
|
317
354
|
className: "grid gap-1.5",
|
|
318
|
-
children: [/* @__PURE__ */
|
|
355
|
+
children: [/* @__PURE__ */ v(S, {
|
|
319
356
|
htmlFor: "commodity",
|
|
320
357
|
children: "Commodity *"
|
|
321
|
-
}), /* @__PURE__ */
|
|
322
|
-
value:
|
|
323
|
-
onValueChange: (e) =>
|
|
324
|
-
...
|
|
358
|
+
}), /* @__PURE__ */ y(C, {
|
|
359
|
+
value: G.commodity,
|
|
360
|
+
onValueChange: (e) => K({
|
|
361
|
+
...G,
|
|
325
362
|
commodity: e
|
|
326
363
|
}),
|
|
327
|
-
children: [/* @__PURE__ */
|
|
364
|
+
children: [/* @__PURE__ */ v(E, {
|
|
328
365
|
id: "commodity",
|
|
329
|
-
children: /* @__PURE__ */
|
|
330
|
-
}), /* @__PURE__ */
|
|
366
|
+
children: /* @__PURE__ */ v(D, {})
|
|
367
|
+
}), /* @__PURE__ */ v(w, { children: j.map((e) => /* @__PURE__ */ v(T, {
|
|
331
368
|
value: e,
|
|
332
369
|
children: t(e)
|
|
333
370
|
}, e)) })]
|
|
334
371
|
})]
|
|
335
|
-
}), /* @__PURE__ */
|
|
372
|
+
}), /* @__PURE__ */ y("div", {
|
|
336
373
|
className: "grid gap-1.5",
|
|
337
|
-
children: [/* @__PURE__ */
|
|
374
|
+
children: [/* @__PURE__ */ v(S, {
|
|
338
375
|
htmlFor: "side",
|
|
339
376
|
children: "Side"
|
|
340
|
-
}), /* @__PURE__ */
|
|
341
|
-
value:
|
|
342
|
-
onValueChange: (e) =>
|
|
343
|
-
...
|
|
377
|
+
}), /* @__PURE__ */ y(C, {
|
|
378
|
+
value: G.side,
|
|
379
|
+
onValueChange: (e) => K({
|
|
380
|
+
...G,
|
|
344
381
|
side: e
|
|
345
382
|
}),
|
|
346
|
-
children: [/* @__PURE__ */
|
|
383
|
+
children: [/* @__PURE__ */ v(E, {
|
|
347
384
|
id: "side",
|
|
348
|
-
children: /* @__PURE__ */
|
|
349
|
-
}), /* @__PURE__ */
|
|
385
|
+
children: /* @__PURE__ */ v(D, {})
|
|
386
|
+
}), /* @__PURE__ */ v(w, { children: k.map((e) => /* @__PURE__ */ v(T, {
|
|
350
387
|
value: e,
|
|
351
388
|
children: t(e)
|
|
352
389
|
}, e)) })]
|
|
353
390
|
})]
|
|
354
391
|
})]
|
|
355
392
|
}),
|
|
356
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ y("div", {
|
|
357
394
|
className: "grid gap-2 sm:grid-cols-2",
|
|
358
|
-
children: [/* @__PURE__ */
|
|
395
|
+
children: [/* @__PURE__ */ y("div", {
|
|
359
396
|
className: "grid gap-1.5",
|
|
360
|
-
children: [/* @__PURE__ */
|
|
397
|
+
children: [/* @__PURE__ */ v(S, {
|
|
361
398
|
htmlFor: "pricingBasis",
|
|
362
399
|
children: "Pricing basis"
|
|
363
|
-
}), /* @__PURE__ */
|
|
364
|
-
value:
|
|
365
|
-
onValueChange: (e) =>
|
|
366
|
-
...
|
|
400
|
+
}), /* @__PURE__ */ y(C, {
|
|
401
|
+
value: G.pricingBasis,
|
|
402
|
+
onValueChange: (e) => K({
|
|
403
|
+
...G,
|
|
367
404
|
pricingBasis: e
|
|
368
405
|
}),
|
|
369
|
-
children: [/* @__PURE__ */
|
|
406
|
+
children: [/* @__PURE__ */ v(E, {
|
|
370
407
|
id: "pricingBasis",
|
|
371
|
-
children: /* @__PURE__ */
|
|
372
|
-
}), /* @__PURE__ */
|
|
408
|
+
children: /* @__PURE__ */ v(D, {})
|
|
409
|
+
}), /* @__PURE__ */ v(w, { children: A.map((e) => /* @__PURE__ */ v(T, {
|
|
373
410
|
value: e,
|
|
374
411
|
children: t(e)
|
|
375
412
|
}, e)) })]
|
|
376
413
|
})]
|
|
377
|
-
}), /* @__PURE__ */
|
|
414
|
+
}), /* @__PURE__ */ y("div", {
|
|
378
415
|
className: "grid gap-1.5",
|
|
379
|
-
children: [/* @__PURE__ */
|
|
416
|
+
children: [/* @__PURE__ */ v(S, {
|
|
380
417
|
htmlFor: "priceIndex",
|
|
381
418
|
children: "Price index"
|
|
382
|
-
}), /* @__PURE__ */
|
|
419
|
+
}), /* @__PURE__ */ v(x, {
|
|
383
420
|
id: "priceIndex",
|
|
384
|
-
value:
|
|
385
|
-
onChange: (e) =>
|
|
386
|
-
...
|
|
421
|
+
value: G.priceIndex,
|
|
422
|
+
onChange: (e) => K({
|
|
423
|
+
...G,
|
|
387
424
|
priceIndex: e.target.value
|
|
388
425
|
}),
|
|
389
426
|
placeholder: "Brent, TTF, Henry Hub"
|
|
390
427
|
})]
|
|
391
428
|
})]
|
|
392
429
|
}),
|
|
393
|
-
/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */ y("div", {
|
|
394
431
|
className: "grid gap-2 sm:grid-cols-3",
|
|
395
432
|
children: [
|
|
396
|
-
/* @__PURE__ */
|
|
433
|
+
/* @__PURE__ */ y("div", {
|
|
397
434
|
className: "grid gap-1.5",
|
|
398
|
-
children: [/* @__PURE__ */
|
|
435
|
+
children: [/* @__PURE__ */ v(S, {
|
|
399
436
|
htmlFor: "pricePerUnit",
|
|
400
437
|
children: "Price / unit"
|
|
401
|
-
}), /* @__PURE__ */
|
|
438
|
+
}), /* @__PURE__ */ v(x, {
|
|
402
439
|
id: "pricePerUnit",
|
|
403
440
|
type: "number",
|
|
404
441
|
min: "0",
|
|
405
442
|
step: "any",
|
|
406
|
-
value:
|
|
407
|
-
onChange: (e) =>
|
|
408
|
-
...
|
|
443
|
+
value: G.pricePerUnit,
|
|
444
|
+
onChange: (e) => K({
|
|
445
|
+
...G,
|
|
409
446
|
pricePerUnit: e.target.value
|
|
410
447
|
}),
|
|
411
448
|
placeholder: "82.50"
|
|
412
449
|
})]
|
|
413
450
|
}),
|
|
414
|
-
/* @__PURE__ */
|
|
451
|
+
/* @__PURE__ */ y("div", {
|
|
415
452
|
className: "grid gap-1.5",
|
|
416
|
-
children: [/* @__PURE__ */
|
|
453
|
+
children: [/* @__PURE__ */ v(S, {
|
|
417
454
|
htmlFor: "currency",
|
|
418
455
|
children: "Currency"
|
|
419
|
-
}), /* @__PURE__ */
|
|
456
|
+
}), /* @__PURE__ */ v(x, {
|
|
420
457
|
id: "currency",
|
|
421
|
-
value:
|
|
422
|
-
onChange: (e) =>
|
|
423
|
-
...
|
|
458
|
+
value: G.currency,
|
|
459
|
+
onChange: (e) => K({
|
|
460
|
+
...G,
|
|
424
461
|
currency: e.target.value
|
|
425
462
|
}),
|
|
426
463
|
placeholder: "USD"
|
|
427
464
|
})]
|
|
428
465
|
}),
|
|
429
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ y("div", {
|
|
430
467
|
className: "grid gap-1.5",
|
|
431
|
-
children: [/* @__PURE__ */
|
|
468
|
+
children: [/* @__PURE__ */ v(S, {
|
|
432
469
|
htmlFor: "unit",
|
|
433
470
|
children: "Unit"
|
|
434
|
-
}), /* @__PURE__ */
|
|
435
|
-
value:
|
|
436
|
-
onValueChange: (e) =>
|
|
437
|
-
...
|
|
471
|
+
}), /* @__PURE__ */ y(C, {
|
|
472
|
+
value: G.unit,
|
|
473
|
+
onValueChange: (e) => K({
|
|
474
|
+
...G,
|
|
438
475
|
unit: e
|
|
439
476
|
}),
|
|
440
|
-
children: [/* @__PURE__ */
|
|
477
|
+
children: [/* @__PURE__ */ v(E, {
|
|
441
478
|
id: "unit",
|
|
442
|
-
children: /* @__PURE__ */
|
|
443
|
-
}), /* @__PURE__ */
|
|
479
|
+
children: /* @__PURE__ */ v(D, {})
|
|
480
|
+
}), /* @__PURE__ */ v(w, { children: M.map((e) => /* @__PURE__ */ v(T, {
|
|
444
481
|
value: e,
|
|
445
482
|
children: r(e)
|
|
446
483
|
}, e)) })]
|
|
@@ -448,141 +485,112 @@ function R() {
|
|
|
448
485
|
})
|
|
449
486
|
]
|
|
450
487
|
}),
|
|
451
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ y("div", {
|
|
452
489
|
className: "grid gap-2 sm:grid-cols-2",
|
|
453
|
-
children: [/* @__PURE__ */
|
|
490
|
+
children: [/* @__PURE__ */ y("div", {
|
|
454
491
|
className: "grid gap-1.5",
|
|
455
|
-
children: [/* @__PURE__ */
|
|
492
|
+
children: [/* @__PURE__ */ v(S, {
|
|
456
493
|
htmlFor: "contractedVolume",
|
|
457
494
|
children: "Contracted volume"
|
|
458
|
-
}), /* @__PURE__ */
|
|
495
|
+
}), /* @__PURE__ */ v(x, {
|
|
459
496
|
id: "contractedVolume",
|
|
460
497
|
type: "number",
|
|
461
498
|
min: "0",
|
|
462
499
|
step: "any",
|
|
463
|
-
value:
|
|
464
|
-
onChange: (e) =>
|
|
465
|
-
...
|
|
500
|
+
value: G.contractedVolume,
|
|
501
|
+
onChange: (e) => K({
|
|
502
|
+
...G,
|
|
466
503
|
contractedVolume: e.target.value
|
|
467
504
|
}),
|
|
468
505
|
placeholder: "500000"
|
|
469
506
|
})]
|
|
470
|
-
}), /* @__PURE__ */
|
|
507
|
+
}), /* @__PURE__ */ y("div", {
|
|
471
508
|
className: "grid gap-1.5",
|
|
472
|
-
children: [/* @__PURE__ */
|
|
509
|
+
children: [/* @__PURE__ */ v(S, {
|
|
473
510
|
htmlFor: "deliveryLocation",
|
|
474
511
|
children: "Delivery location"
|
|
475
|
-
}), /* @__PURE__ */
|
|
512
|
+
}), /* @__PURE__ */ v(x, {
|
|
476
513
|
id: "deliveryLocation",
|
|
477
|
-
value:
|
|
478
|
-
onChange: (e) =>
|
|
479
|
-
...
|
|
514
|
+
value: G.deliveryLocation,
|
|
515
|
+
onChange: (e) => K({
|
|
516
|
+
...G,
|
|
480
517
|
deliveryLocation: e.target.value
|
|
481
518
|
}),
|
|
482
519
|
placeholder: "Rotterdam"
|
|
483
520
|
})]
|
|
484
521
|
})]
|
|
485
522
|
}),
|
|
486
|
-
/* @__PURE__ */
|
|
523
|
+
/* @__PURE__ */ y("div", {
|
|
487
524
|
className: "grid gap-2 sm:grid-cols-2",
|
|
488
|
-
children: [/* @__PURE__ */
|
|
525
|
+
children: [/* @__PURE__ */ y("div", {
|
|
489
526
|
className: "grid gap-1.5",
|
|
490
|
-
children: [/* @__PURE__ */
|
|
527
|
+
children: [/* @__PURE__ */ v(S, {
|
|
491
528
|
htmlFor: "startDate",
|
|
492
529
|
children: "Start date"
|
|
493
|
-
}), /* @__PURE__ */
|
|
530
|
+
}), /* @__PURE__ */ v(x, {
|
|
494
531
|
id: "startDate",
|
|
495
532
|
type: "date",
|
|
496
|
-
value:
|
|
497
|
-
onChange: (e) =>
|
|
498
|
-
...
|
|
533
|
+
value: G.startDate,
|
|
534
|
+
onChange: (e) => K({
|
|
535
|
+
...G,
|
|
499
536
|
startDate: e.target.value
|
|
500
537
|
})
|
|
501
538
|
})]
|
|
502
|
-
}), /* @__PURE__ */
|
|
539
|
+
}), /* @__PURE__ */ y("div", {
|
|
503
540
|
className: "grid gap-1.5",
|
|
504
|
-
children: [/* @__PURE__ */
|
|
541
|
+
children: [/* @__PURE__ */ v(S, {
|
|
505
542
|
htmlFor: "endDate",
|
|
506
543
|
children: "End date"
|
|
507
|
-
}), /* @__PURE__ */
|
|
544
|
+
}), /* @__PURE__ */ v(x, {
|
|
508
545
|
id: "endDate",
|
|
509
546
|
type: "date",
|
|
510
|
-
value:
|
|
511
|
-
onChange: (e) =>
|
|
512
|
-
...
|
|
547
|
+
value: G.endDate,
|
|
548
|
+
onChange: (e) => K({
|
|
549
|
+
...G,
|
|
513
550
|
endDate: e.target.value
|
|
514
551
|
})
|
|
515
552
|
})]
|
|
516
553
|
})]
|
|
517
554
|
}),
|
|
518
|
-
/* @__PURE__ */
|
|
555
|
+
/* @__PURE__ */ y("div", {
|
|
519
556
|
className: "grid gap-1.5",
|
|
520
|
-
children: [/* @__PURE__ */
|
|
557
|
+
children: [/* @__PURE__ */ v(S, {
|
|
521
558
|
htmlFor: "notes",
|
|
522
559
|
children: "Notes"
|
|
523
|
-
}), /* @__PURE__ */
|
|
560
|
+
}), /* @__PURE__ */ v(fe, {
|
|
524
561
|
id: "notes",
|
|
525
562
|
rows: 2,
|
|
526
|
-
value:
|
|
527
|
-
onChange: (e) =>
|
|
528
|
-
...
|
|
563
|
+
value: G.notes,
|
|
564
|
+
onChange: (e) => K({
|
|
565
|
+
...G,
|
|
529
566
|
notes: e.target.value
|
|
530
567
|
}),
|
|
531
568
|
placeholder: "Optional context about this contract."
|
|
532
569
|
})]
|
|
533
570
|
}),
|
|
534
|
-
|
|
571
|
+
q && /* @__PURE__ */ v("p", {
|
|
535
572
|
className: "text-sm text-status-error-text",
|
|
536
|
-
children:
|
|
573
|
+
children: q
|
|
537
574
|
})
|
|
538
575
|
]
|
|
539
|
-
}),
|
|
540
|
-
|
|
576
|
+
}), /* @__PURE__ */ y(le, { children: [/* @__PURE__ */ v(b, {
|
|
577
|
+
type: "button",
|
|
541
578
|
variant: "outline",
|
|
542
|
-
onClick: () =>
|
|
543
|
-
|
|
544
|
-
}), /* @__PURE__ */ p(h, {
|
|
545
|
-
onClick: async () => {
|
|
546
|
-
if (!K.reference.trim()) {
|
|
547
|
-
Y("Contract reference is required.");
|
|
548
|
-
return;
|
|
549
|
-
}
|
|
550
|
-
if (!K.counterparty.trim()) {
|
|
551
|
-
Y("Counterparty is required.");
|
|
552
|
-
return;
|
|
553
|
-
}
|
|
554
|
-
Y(null);
|
|
555
|
-
try {
|
|
556
|
-
let e = await Z.mutateAsync({
|
|
557
|
-
reference: K.reference.trim(),
|
|
558
|
-
counterparty: K.counterparty.trim(),
|
|
559
|
-
commodity: K.commodity,
|
|
560
|
-
side: K.side,
|
|
561
|
-
pricingBasis: K.pricingBasis,
|
|
562
|
-
pricePerUnit: K.pricePerUnit ? Number(K.pricePerUnit) : null,
|
|
563
|
-
priceIndex: K.priceIndex.trim() || null,
|
|
564
|
-
currency: K.currency.trim() || "USD",
|
|
565
|
-
contractedVolume: K.contractedVolume ? Number(K.contractedVolume) : null,
|
|
566
|
-
unit: K.unit,
|
|
567
|
-
deliveryLocation: K.deliveryLocation.trim() || null,
|
|
568
|
-
startDate: K.startDate ? new Date(K.startDate).toISOString() : null,
|
|
569
|
-
endDate: K.endDate ? new Date(K.endDate).toISOString() : null,
|
|
570
|
-
notes: K.notes.trim() || null
|
|
571
|
-
});
|
|
572
|
-
G(!1), $(), F(`contracts/${e.id}`);
|
|
573
|
-
} catch (e) {
|
|
574
|
-
Y(e instanceof Error ? e.message : "Failed to create contract.");
|
|
575
|
-
}
|
|
579
|
+
onClick: () => {
|
|
580
|
+
W(!1), $();
|
|
576
581
|
},
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
582
|
+
children: "Cancel"
|
|
583
|
+
}), /* @__PURE__ */ v(b, {
|
|
584
|
+
type: "submit",
|
|
585
|
+
disabled: X.isPending,
|
|
586
|
+
children: X.isPending ? "Creating…" : "Create contract"
|
|
587
|
+
})] })]
|
|
588
|
+
})] })
|
|
581
589
|
})
|
|
582
590
|
]
|
|
583
591
|
});
|
|
584
592
|
}
|
|
585
593
|
//#endregion
|
|
586
|
-
export {
|
|
594
|
+
export { L as ContractsPage };
|
|
587
595
|
|
|
588
596
|
//# sourceMappingURL=ContractsPage.js.map
|