@burdenoff/microfe-healthybowl 2026.813.16 → 2026.813.17
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/healthybowl/components/PlanExecutionPanel.js +161 -154
- package/dist/healthybowl/components/PlanExecutionPanel.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlData.js.map +1 -1
- package/dist/healthybowl/hooks/usePlanExecution.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropHarvestPage.js +252 -238
- package/dist/healthybowl/pages/crops/CropHarvestPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,11 +4,11 @@ import { useToast as r } from "../hooks/useToast.js";
|
|
|
4
4
|
import "./index.js";
|
|
5
5
|
import { usePlanExecution as ee } from "../hooks/usePlanExecution.js";
|
|
6
6
|
import { useMemo as i, useState as a } from "react";
|
|
7
|
-
import { Activity as
|
|
8
|
-
import { jsx as
|
|
9
|
-
import { Button as
|
|
7
|
+
import { Activity as te, CalendarClock as ne, PackageCheck as re, Sprout as o, Target as ie, Trash2 as ae } from "lucide-react";
|
|
8
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
|
+
import { Button as l, GlassCard as u, Input as d, Select as f, SelectContent as p, SelectItem as m, SelectTrigger as h, SelectValue as g, Textarea as oe } from "@burdenoff/fe-libs/ui";
|
|
10
10
|
//#region src/healthybowl/components/PlanExecutionPanel.tsx
|
|
11
|
-
var
|
|
11
|
+
var _ = [
|
|
12
12
|
{
|
|
13
13
|
value: "WATERING",
|
|
14
14
|
label: "Watering"
|
|
@@ -49,18 +49,22 @@ var v = [
|
|
|
49
49
|
value: "OTHER",
|
|
50
50
|
label: "Other"
|
|
51
51
|
}
|
|
52
|
-
],
|
|
52
|
+
], se = (e) => _.find((t) => t.value === e)?.label ?? e, v = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), ce = (e) => {
|
|
53
53
|
let t = Number(e);
|
|
54
54
|
return Number.isFinite(t) && t > 0 ? t : null;
|
|
55
|
-
}
|
|
56
|
-
|
|
55
|
+
};
|
|
56
|
+
function y() {
|
|
57
|
+
return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : `hb-harvest-${Date.now()}-${Math.round(Math.random() * 1e9)}`;
|
|
58
|
+
}
|
|
59
|
+
var b = ({ plan: b, crops: C }) => {
|
|
60
|
+
let { toast: w } = r(), { execution: T, loading: E, setTransplantDate: le, addActivity: ue, deleteActivity: de, recordHarvest: fe } = ee(b.id), D = i(() => {
|
|
57
61
|
let e = C.filter((e) => !b.fieldId || e.field === b.fieldId);
|
|
58
62
|
return e.length > 0 ? e : C;
|
|
59
|
-
}, [C, b.fieldId]),
|
|
63
|
+
}, [C, b.fieldId]), pe = i(() => D.find((e) => e.name === b.cropName)?.id ?? D[0]?.id ?? "", [D, b.cropName]), [O, k] = a(""), [me, A] = a(!1), he = async () => {
|
|
60
64
|
if (O) {
|
|
61
65
|
A(!0);
|
|
62
66
|
try {
|
|
63
|
-
await
|
|
67
|
+
await le(O), w({
|
|
64
68
|
title: "Transplant date set",
|
|
65
69
|
variant: "success"
|
|
66
70
|
}), k("");
|
|
@@ -73,7 +77,7 @@ var v = [
|
|
|
73
77
|
A(!1);
|
|
74
78
|
}
|
|
75
79
|
}
|
|
76
|
-
}, [j,
|
|
80
|
+
}, [j, ge] = a("WATERING"), [M, _e] = a(v()), [N, P] = a(""), [F, I] = a(""), [L, ve] = a(""), [R, z] = a(""), [B, V] = a(!1), ye = async () => {
|
|
77
81
|
if (!M) {
|
|
78
82
|
w({
|
|
79
83
|
title: "Pick an activity date",
|
|
@@ -83,7 +87,7 @@ var v = [
|
|
|
83
87
|
}
|
|
84
88
|
V(!0);
|
|
85
89
|
try {
|
|
86
|
-
await
|
|
90
|
+
await ue({
|
|
87
91
|
type: j,
|
|
88
92
|
activityDate: M,
|
|
89
93
|
quantity: N ? Number(N) : null,
|
|
@@ -93,7 +97,7 @@ var v = [
|
|
|
93
97
|
}), w({
|
|
94
98
|
title: "Activity logged",
|
|
95
99
|
variant: "success"
|
|
96
|
-
}), P(""), I(""),
|
|
100
|
+
}), P(""), I(""), ve(""), z("");
|
|
97
101
|
} catch {
|
|
98
102
|
w({
|
|
99
103
|
title: "Could not log activity",
|
|
@@ -102,9 +106,9 @@ var v = [
|
|
|
102
106
|
} finally {
|
|
103
107
|
V(!1);
|
|
104
108
|
}
|
|
105
|
-
},
|
|
109
|
+
}, be = async (e) => {
|
|
106
110
|
try {
|
|
107
|
-
await
|
|
111
|
+
await de(e), w({
|
|
108
112
|
title: "Activity removed",
|
|
109
113
|
variant: "success"
|
|
110
114
|
});
|
|
@@ -114,8 +118,8 @@ var v = [
|
|
|
114
118
|
variant: "error"
|
|
115
119
|
});
|
|
116
120
|
}
|
|
117
|
-
}, [
|
|
118
|
-
let e =
|
|
121
|
+
}, [xe, Se] = a(""), [H, U] = a(""), [W, Ce] = a("kg"), [G, we] = a("A"), [K, Te] = a(v()), [q, J] = a(""), [Y, Ee] = a(!0), [X, Z] = a(!1), [De, Oe] = a(() => y()), Q = xe || pe, ke = async () => {
|
|
122
|
+
let e = ce(H);
|
|
119
123
|
if (!Q) {
|
|
120
124
|
w({
|
|
121
125
|
title: "Add a crop on this field first",
|
|
@@ -137,133 +141,136 @@ var v = [
|
|
|
137
141
|
});
|
|
138
142
|
return;
|
|
139
143
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
144
|
+
if (!X) {
|
|
145
|
+
Z(!0);
|
|
146
|
+
try {
|
|
147
|
+
await fe({
|
|
148
|
+
cropId: Q,
|
|
149
|
+
fieldId: b.fieldId,
|
|
150
|
+
quantity: e,
|
|
151
|
+
unit: W.trim() || "kg",
|
|
152
|
+
quality: G,
|
|
153
|
+
harvestDate: K,
|
|
154
|
+
pricePerUnit: q ? Number(q) : null,
|
|
155
|
+
addToInventory: Y,
|
|
156
|
+
clientMutationId: De
|
|
157
|
+
}), w({
|
|
158
|
+
title: Y ? "Harvest recorded & added to inventory" : "Harvest recorded",
|
|
159
|
+
variant: "success"
|
|
160
|
+
}), U(""), J(""), Oe(y());
|
|
161
|
+
} catch {
|
|
162
|
+
w({
|
|
163
|
+
title: "Could not record harvest",
|
|
164
|
+
variant: "error"
|
|
165
|
+
});
|
|
166
|
+
} finally {
|
|
167
|
+
Z(!1);
|
|
168
|
+
}
|
|
162
169
|
}
|
|
163
|
-
}, $ = T?.yieldVariancePct,
|
|
164
|
-
return /* @__PURE__ */
|
|
170
|
+
}, $ = T?.yieldVariancePct, Ae = $ == null ? "—" : `${$ > 0 ? "+" : ""}${t(Math.round($))}%`, je = $ == null ? "muted" : $ >= 0 ? "success" : "warning";
|
|
171
|
+
return /* @__PURE__ */ c("div", {
|
|
165
172
|
className: "space-y-6",
|
|
166
173
|
"data-testid": "plan-execution-panel",
|
|
167
174
|
children: [
|
|
168
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ c(u, {
|
|
169
176
|
treatment: "glass",
|
|
170
177
|
glow: !0,
|
|
171
178
|
className: "border-border-seam p-6",
|
|
172
179
|
children: [
|
|
173
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ c("h3", {
|
|
174
181
|
className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
175
|
-
children: [/* @__PURE__ */
|
|
182
|
+
children: [/* @__PURE__ */ s(ie, { className: "h-4 w-4 text-info" }), " Execution & yield"]
|
|
176
183
|
}),
|
|
177
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ c("div", {
|
|
178
185
|
className: "grid grid-cols-2 gap-4 md:grid-cols-4",
|
|
179
186
|
children: [
|
|
180
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ s(x, {
|
|
181
188
|
label: "Planned yield",
|
|
182
189
|
value: t(T?.plannedYield ?? b.expectedYield ?? 0),
|
|
183
190
|
unit: "kg"
|
|
184
191
|
}),
|
|
185
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ s(x, {
|
|
186
193
|
label: "Actual yield",
|
|
187
194
|
value: t(T?.actualYield ?? 0),
|
|
188
195
|
unit: "kg"
|
|
189
196
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("div", {
|
|
191
198
|
className: "text-xs text-text-secondary",
|
|
192
199
|
children: "Variance"
|
|
193
|
-
}), /* @__PURE__ */
|
|
200
|
+
}), /* @__PURE__ */ s("div", {
|
|
194
201
|
className: "mt-1",
|
|
195
|
-
children: /* @__PURE__ */
|
|
196
|
-
label:
|
|
197
|
-
variant:
|
|
202
|
+
children: /* @__PURE__ */ s(n, {
|
|
203
|
+
label: Ae,
|
|
204
|
+
variant: je
|
|
198
205
|
})
|
|
199
206
|
})] }),
|
|
200
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ s(x, {
|
|
201
208
|
label: "Harvests",
|
|
202
209
|
value: t(T?.harvestCount ?? 0)
|
|
203
210
|
})
|
|
204
211
|
]
|
|
205
212
|
}),
|
|
206
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ c("div", {
|
|
207
214
|
className: "mt-5 grid grid-cols-1 gap-4 border-t border-border-subtle pt-4 sm:grid-cols-2",
|
|
208
|
-
children: [/* @__PURE__ */
|
|
209
|
-
/* @__PURE__ */
|
|
215
|
+
children: [/* @__PURE__ */ c("div", { children: [
|
|
216
|
+
/* @__PURE__ */ c("div", {
|
|
210
217
|
className: "flex items-center gap-1 text-xs text-text-secondary",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
218
|
+
children: [/* @__PURE__ */ s(ne, { className: "h-3.5 w-3.5" }), " Transplant date"]
|
|
212
219
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ s("div", {
|
|
214
221
|
className: "mt-1 text-sm font-medium text-text-primary",
|
|
215
222
|
children: T?.transplantDate ? e(T.transplantDate) : "Not set"
|
|
216
223
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ c("div", {
|
|
218
225
|
className: "mt-2 flex items-center gap-2",
|
|
219
|
-
children: [/* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ s(d, {
|
|
220
227
|
type: "date",
|
|
221
228
|
value: O,
|
|
222
229
|
onChange: (e) => k(e.target.value),
|
|
223
230
|
className: "h-9 w-44",
|
|
224
231
|
"aria-label": "Transplant date"
|
|
225
|
-
}), /* @__PURE__ */
|
|
232
|
+
}), /* @__PURE__ */ s(l, {
|
|
226
233
|
size: "sm",
|
|
227
234
|
variant: "outline",
|
|
228
|
-
onClick:
|
|
229
|
-
disabled: !O ||
|
|
235
|
+
onClick: he,
|
|
236
|
+
disabled: !O || me,
|
|
230
237
|
children: T?.transplantDate ? "Update" : "Set"
|
|
231
238
|
})]
|
|
232
239
|
})
|
|
233
|
-
] }), /* @__PURE__ */
|
|
240
|
+
] }), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("div", {
|
|
234
241
|
className: "text-xs text-text-secondary",
|
|
235
242
|
children: "Sow / nursery date"
|
|
236
|
-
}), /* @__PURE__ */
|
|
243
|
+
}), /* @__PURE__ */ s("div", {
|
|
237
244
|
className: "mt-1 text-sm font-medium text-text-primary",
|
|
238
245
|
children: T?.sowDate ? e(T.sowDate) : "—"
|
|
239
246
|
})] })]
|
|
240
247
|
})
|
|
241
248
|
]
|
|
242
249
|
}),
|
|
243
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ c(u, {
|
|
244
251
|
treatment: "glass",
|
|
245
252
|
className: "border-border-seam p-6",
|
|
246
253
|
children: [
|
|
247
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ c("h3", {
|
|
248
255
|
className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
249
|
-
children: [/* @__PURE__ */
|
|
256
|
+
children: [/* @__PURE__ */ s(te, { className: "h-4 w-4 text-info" }), " Activity log"]
|
|
250
257
|
}),
|
|
251
|
-
T && T.activities.length > 0 ? /* @__PURE__ */
|
|
258
|
+
T && T.activities.length > 0 ? /* @__PURE__ */ s("ul", {
|
|
252
259
|
className: "mb-5 space-y-2",
|
|
253
|
-
children: T.activities.map((r) => /* @__PURE__ */
|
|
260
|
+
children: T.activities.map((r) => /* @__PURE__ */ c("li", {
|
|
254
261
|
className: "flex items-center justify-between gap-3 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2",
|
|
255
|
-
children: [/* @__PURE__ */
|
|
262
|
+
children: [/* @__PURE__ */ c("div", {
|
|
256
263
|
className: "min-w-0",
|
|
257
|
-
children: [/* @__PURE__ */
|
|
264
|
+
children: [/* @__PURE__ */ c("div", {
|
|
258
265
|
className: "flex items-center gap-2",
|
|
259
|
-
children: [/* @__PURE__ */
|
|
260
|
-
label:
|
|
266
|
+
children: [/* @__PURE__ */ s(n, {
|
|
267
|
+
label: se(r.type),
|
|
261
268
|
variant: "info"
|
|
262
|
-
}), /* @__PURE__ */
|
|
269
|
+
}), /* @__PURE__ */ s("span", {
|
|
263
270
|
className: "text-xs text-text-secondary",
|
|
264
271
|
children: e(r.activityDate)
|
|
265
272
|
})]
|
|
266
|
-
}), /* @__PURE__ */
|
|
273
|
+
}), /* @__PURE__ */ s("div", {
|
|
267
274
|
className: "mt-1 truncate text-xs text-text-secondary",
|
|
268
275
|
children: [
|
|
269
276
|
r.quantity == null ? null : `${t(r.quantity)}${r.unit ? ` ${r.unit}` : ""}`,
|
|
@@ -271,46 +278,46 @@ var v = [
|
|
|
271
278
|
r.notes
|
|
272
279
|
].filter(Boolean).join(" · ") || "—"
|
|
273
280
|
})]
|
|
274
|
-
}), /* @__PURE__ */
|
|
281
|
+
}), /* @__PURE__ */ s(l, {
|
|
275
282
|
size: "sm",
|
|
276
283
|
variant: "ghost",
|
|
277
|
-
onClick: () =>
|
|
284
|
+
onClick: () => be(r.id),
|
|
278
285
|
"aria-label": "Remove activity",
|
|
279
|
-
children: /* @__PURE__ */
|
|
286
|
+
children: /* @__PURE__ */ s(ae, { className: "h-4 w-4 text-text-secondary" })
|
|
280
287
|
})]
|
|
281
288
|
}, r.id))
|
|
282
|
-
}) : /* @__PURE__ */
|
|
289
|
+
}) : /* @__PURE__ */ s("p", {
|
|
283
290
|
className: "mb-5 text-sm text-text-secondary",
|
|
284
291
|
children: E ? "Loading activities…" : "No activities logged yet. Record watering, tilling and field work below."
|
|
285
292
|
}),
|
|
286
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ c("div", {
|
|
287
294
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
288
295
|
children: [
|
|
289
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ s(S, {
|
|
290
297
|
label: "Type",
|
|
291
|
-
children: /* @__PURE__ */
|
|
298
|
+
children: /* @__PURE__ */ c(f, {
|
|
292
299
|
value: j,
|
|
293
|
-
onValueChange:
|
|
294
|
-
children: [/* @__PURE__ */
|
|
300
|
+
onValueChange: ge,
|
|
301
|
+
children: [/* @__PURE__ */ s(h, {
|
|
295
302
|
className: "w-full",
|
|
296
|
-
children: /* @__PURE__ */
|
|
297
|
-
}), /* @__PURE__ */
|
|
303
|
+
children: /* @__PURE__ */ s(g, {})
|
|
304
|
+
}), /* @__PURE__ */ s(p, { children: _.map((e) => /* @__PURE__ */ s(m, {
|
|
298
305
|
value: e.value,
|
|
299
306
|
children: e.label
|
|
300
307
|
}, e.value)) })]
|
|
301
308
|
})
|
|
302
309
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ s(S, {
|
|
304
311
|
label: "Date",
|
|
305
|
-
children: /* @__PURE__ */
|
|
312
|
+
children: /* @__PURE__ */ s(d, {
|
|
306
313
|
type: "date",
|
|
307
314
|
value: M,
|
|
308
|
-
onChange: (e) =>
|
|
315
|
+
onChange: (e) => _e(e.target.value)
|
|
309
316
|
})
|
|
310
317
|
}),
|
|
311
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ s(S, {
|
|
312
319
|
label: "Quantity",
|
|
313
|
-
children: /* @__PURE__ */
|
|
320
|
+
children: /* @__PURE__ */ s(d, {
|
|
314
321
|
type: "number",
|
|
315
322
|
min: "0",
|
|
316
323
|
step: "any",
|
|
@@ -319,28 +326,28 @@ var v = [
|
|
|
319
326
|
placeholder: "e.g. 20"
|
|
320
327
|
})
|
|
321
328
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ s(S, {
|
|
323
330
|
label: "Unit",
|
|
324
|
-
children: /* @__PURE__ */
|
|
331
|
+
children: /* @__PURE__ */ s(d, {
|
|
325
332
|
value: F,
|
|
326
333
|
onChange: (e) => I(e.target.value),
|
|
327
334
|
placeholder: "L, kg…"
|
|
328
335
|
})
|
|
329
336
|
}),
|
|
330
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ s(S, {
|
|
331
338
|
label: "Labor (hrs)",
|
|
332
|
-
children: /* @__PURE__ */
|
|
339
|
+
children: /* @__PURE__ */ s(d, {
|
|
333
340
|
type: "number",
|
|
334
341
|
min: "0",
|
|
335
342
|
step: "any",
|
|
336
343
|
value: L,
|
|
337
|
-
onChange: (e) =>
|
|
344
|
+
onChange: (e) => ve(e.target.value),
|
|
338
345
|
placeholder: "e.g. 1.5"
|
|
339
346
|
})
|
|
340
347
|
}),
|
|
341
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ s(S, {
|
|
342
349
|
label: "Notes",
|
|
343
|
-
children: /* @__PURE__ */
|
|
350
|
+
children: /* @__PURE__ */ s(oe, {
|
|
344
351
|
value: R,
|
|
345
352
|
onChange: (e) => z(e.target.value),
|
|
346
353
|
rows: 1,
|
|
@@ -349,13 +356,13 @@ var v = [
|
|
|
349
356
|
})
|
|
350
357
|
]
|
|
351
358
|
}),
|
|
352
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ s("div", {
|
|
353
360
|
className: "mt-4",
|
|
354
|
-
children: /* @__PURE__ */ l
|
|
355
|
-
onClick:
|
|
361
|
+
children: /* @__PURE__ */ c(l, {
|
|
362
|
+
onClick: ye,
|
|
356
363
|
disabled: B,
|
|
357
364
|
children: [
|
|
358
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ s(te, { className: "h-4 w-4" }),
|
|
359
366
|
" ",
|
|
360
367
|
B ? "Logging…" : "Log activity"
|
|
361
368
|
]
|
|
@@ -363,30 +370,30 @@ var v = [
|
|
|
363
370
|
})
|
|
364
371
|
]
|
|
365
372
|
}),
|
|
366
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ c(u, {
|
|
367
374
|
treatment: "glass",
|
|
368
375
|
className: "border-border-seam p-6",
|
|
369
376
|
children: [
|
|
370
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ c("h3", {
|
|
371
378
|
className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
372
|
-
children: [/* @__PURE__ */
|
|
379
|
+
children: [/* @__PURE__ */ s(o, { className: "h-4 w-4 text-info" }), " Harvest & inventory"]
|
|
373
380
|
}),
|
|
374
|
-
T && T.harvests.length > 0 ? /* @__PURE__ */
|
|
381
|
+
T && T.harvests.length > 0 ? /* @__PURE__ */ s("ul", {
|
|
375
382
|
className: "mb-5 space-y-2",
|
|
376
|
-
children: T.harvests.map((r) => /* @__PURE__ */
|
|
383
|
+
children: T.harvests.map((r) => /* @__PURE__ */ c("li", {
|
|
377
384
|
className: "flex items-center justify-between gap-3 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2",
|
|
378
|
-
children: [/* @__PURE__ */
|
|
385
|
+
children: [/* @__PURE__ */ c("div", {
|
|
379
386
|
className: "min-w-0",
|
|
380
|
-
children: [/* @__PURE__ */
|
|
387
|
+
children: [/* @__PURE__ */ c("div", {
|
|
381
388
|
className: "flex items-center gap-2",
|
|
382
|
-
children: [/* @__PURE__ */
|
|
389
|
+
children: [/* @__PURE__ */ s("span", {
|
|
383
390
|
className: "truncate text-sm font-medium text-text-primary",
|
|
384
391
|
children: r.cropName || b.cropName
|
|
385
|
-
}), /* @__PURE__ */
|
|
392
|
+
}), /* @__PURE__ */ s(n, {
|
|
386
393
|
label: `Grade ${r.qualityGrade}`,
|
|
387
394
|
variant: "muted"
|
|
388
395
|
})]
|
|
389
|
-
}), /* @__PURE__ */
|
|
396
|
+
}), /* @__PURE__ */ c("div", {
|
|
390
397
|
className: "mt-1 text-xs text-text-secondary",
|
|
391
398
|
children: [
|
|
392
399
|
t(r.quantity),
|
|
@@ -396,38 +403,38 @@ var v = [
|
|
|
396
403
|
e(r.harvestDate)
|
|
397
404
|
]
|
|
398
405
|
})]
|
|
399
|
-
}), r.productId ? /* @__PURE__ */
|
|
406
|
+
}), r.productId ? /* @__PURE__ */ c("span", {
|
|
400
407
|
className: "inline-flex items-center gap-1 whitespace-nowrap text-xs font-medium text-status-success-text",
|
|
401
|
-
children: [/* @__PURE__ */
|
|
402
|
-
}) : /* @__PURE__ */
|
|
408
|
+
children: [/* @__PURE__ */ s(re, { className: "h-4 w-4" }), " In inventory"]
|
|
409
|
+
}) : /* @__PURE__ */ s(n, {
|
|
403
410
|
label: r.status,
|
|
404
411
|
variant: "muted"
|
|
405
412
|
})]
|
|
406
413
|
}, r.id))
|
|
407
|
-
}) : /* @__PURE__ */
|
|
414
|
+
}) : /* @__PURE__ */ s("p", {
|
|
408
415
|
className: "mb-5 text-sm text-text-secondary",
|
|
409
416
|
children: E ? "Loading harvests…" : "No harvests recorded against this plan yet."
|
|
410
417
|
}),
|
|
411
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ c("div", {
|
|
412
419
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
413
420
|
children: [
|
|
414
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ s(S, {
|
|
415
422
|
label: "Crop",
|
|
416
|
-
children: /* @__PURE__ */
|
|
423
|
+
children: /* @__PURE__ */ c(f, {
|
|
417
424
|
value: Q,
|
|
418
|
-
onValueChange:
|
|
419
|
-
children: [/* @__PURE__ */
|
|
425
|
+
onValueChange: Se,
|
|
426
|
+
children: [/* @__PURE__ */ s(h, {
|
|
420
427
|
className: "w-full",
|
|
421
|
-
children: /* @__PURE__ */
|
|
422
|
-
}), /* @__PURE__ */
|
|
428
|
+
children: /* @__PURE__ */ s(g, { placeholder: "Select crop" })
|
|
429
|
+
}), /* @__PURE__ */ s(p, { children: D.map((e) => /* @__PURE__ */ s(m, {
|
|
423
430
|
value: e.id,
|
|
424
431
|
children: e.variety ? `${e.name} — ${e.variety}` : e.name
|
|
425
432
|
}, e.id)) })]
|
|
426
433
|
})
|
|
427
434
|
}),
|
|
428
|
-
/* @__PURE__ */
|
|
435
|
+
/* @__PURE__ */ s(S, {
|
|
429
436
|
label: "Quantity",
|
|
430
|
-
children: /* @__PURE__ */
|
|
437
|
+
children: /* @__PURE__ */ s(d, {
|
|
431
438
|
type: "number",
|
|
432
439
|
min: "0",
|
|
433
440
|
step: "any",
|
|
@@ -436,49 +443,49 @@ var v = [
|
|
|
436
443
|
placeholder: "e.g. 120"
|
|
437
444
|
})
|
|
438
445
|
}),
|
|
439
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ s(S, {
|
|
440
447
|
label: "Unit",
|
|
441
|
-
children: /* @__PURE__ */
|
|
448
|
+
children: /* @__PURE__ */ s(d, {
|
|
442
449
|
value: W,
|
|
443
|
-
onChange: (e) =>
|
|
450
|
+
onChange: (e) => Ce(e.target.value),
|
|
444
451
|
placeholder: "kg"
|
|
445
452
|
})
|
|
446
453
|
}),
|
|
447
|
-
/* @__PURE__ */
|
|
454
|
+
/* @__PURE__ */ s(S, {
|
|
448
455
|
label: "Quality",
|
|
449
|
-
children: /* @__PURE__ */
|
|
456
|
+
children: /* @__PURE__ */ c(f, {
|
|
450
457
|
value: G,
|
|
451
|
-
onValueChange:
|
|
452
|
-
children: [/* @__PURE__ */
|
|
458
|
+
onValueChange: we,
|
|
459
|
+
children: [/* @__PURE__ */ s(h, {
|
|
453
460
|
className: "w-full",
|
|
454
|
-
children: /* @__PURE__ */
|
|
455
|
-
}), /* @__PURE__ */
|
|
456
|
-
/* @__PURE__ */
|
|
461
|
+
children: /* @__PURE__ */ s(g, {})
|
|
462
|
+
}), /* @__PURE__ */ c(p, { children: [
|
|
463
|
+
/* @__PURE__ */ s(m, {
|
|
457
464
|
value: "A",
|
|
458
465
|
children: "Grade A"
|
|
459
466
|
}),
|
|
460
|
-
/* @__PURE__ */
|
|
467
|
+
/* @__PURE__ */ s(m, {
|
|
461
468
|
value: "B",
|
|
462
469
|
children: "Grade B"
|
|
463
470
|
}),
|
|
464
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ s(m, {
|
|
465
472
|
value: "C",
|
|
466
473
|
children: "Grade C"
|
|
467
474
|
})
|
|
468
475
|
] })]
|
|
469
476
|
})
|
|
470
477
|
}),
|
|
471
|
-
/* @__PURE__ */
|
|
478
|
+
/* @__PURE__ */ s(S, {
|
|
472
479
|
label: "Harvest date",
|
|
473
|
-
children: /* @__PURE__ */
|
|
480
|
+
children: /* @__PURE__ */ s(d, {
|
|
474
481
|
type: "date",
|
|
475
482
|
value: K,
|
|
476
|
-
onChange: (e) =>
|
|
483
|
+
onChange: (e) => Te(e.target.value)
|
|
477
484
|
})
|
|
478
485
|
}),
|
|
479
|
-
/* @__PURE__ */
|
|
486
|
+
/* @__PURE__ */ s(S, {
|
|
480
487
|
label: "Price / unit",
|
|
481
|
-
children: /* @__PURE__ */
|
|
488
|
+
children: /* @__PURE__ */ s(d, {
|
|
482
489
|
type: "number",
|
|
483
490
|
min: "0",
|
|
484
491
|
step: "any",
|
|
@@ -489,21 +496,21 @@ var v = [
|
|
|
489
496
|
})
|
|
490
497
|
]
|
|
491
498
|
}),
|
|
492
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ c("div", {
|
|
493
500
|
className: "mt-4 flex flex-wrap items-center gap-4",
|
|
494
|
-
children: [/* @__PURE__ */
|
|
501
|
+
children: [/* @__PURE__ */ c("label", {
|
|
495
502
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
496
|
-
children: [/* @__PURE__ */
|
|
503
|
+
children: [/* @__PURE__ */ s("input", {
|
|
497
504
|
type: "checkbox",
|
|
498
505
|
checked: Y,
|
|
499
|
-
onChange: (e) =>
|
|
506
|
+
onChange: (e) => Ee(e.target.checked),
|
|
500
507
|
className: "h-4 w-4 rounded border-border-subtle"
|
|
501
508
|
}), "Add harvested quantity to inventory"]
|
|
502
|
-
}), /* @__PURE__ */ l
|
|
503
|
-
onClick:
|
|
509
|
+
}), /* @__PURE__ */ c(l, {
|
|
510
|
+
onClick: ke,
|
|
504
511
|
disabled: X,
|
|
505
512
|
children: [
|
|
506
|
-
/* @__PURE__ */
|
|
513
|
+
/* @__PURE__ */ s(o, { className: "h-4 w-4" }),
|
|
507
514
|
" ",
|
|
508
515
|
X ? "Recording…" : "Record harvest"
|
|
509
516
|
]
|
|
@@ -513,19 +520,19 @@ var v = [
|
|
|
513
520
|
})
|
|
514
521
|
]
|
|
515
522
|
});
|
|
516
|
-
}, x = ({ label: e, value: t, unit: n }) => /* @__PURE__ */
|
|
523
|
+
}, x = ({ label: e, value: t, unit: n }) => /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("div", {
|
|
517
524
|
className: "text-xs text-text-secondary",
|
|
518
525
|
children: e
|
|
519
|
-
}), /* @__PURE__ */
|
|
526
|
+
}), /* @__PURE__ */ c("div", {
|
|
520
527
|
className: "mt-1 text-lg font-semibold text-text-primary",
|
|
521
|
-
children: [t, n ? /* @__PURE__ */
|
|
528
|
+
children: [t, n ? /* @__PURE__ */ s("span", {
|
|
522
529
|
className: "ms-1 text-xs font-normal text-text-secondary",
|
|
523
530
|
children: n
|
|
524
531
|
}) : null]
|
|
525
|
-
})] }), S = ({ label: e, children: t }) => /* @__PURE__ */
|
|
532
|
+
})] }), S = ({ label: e, children: t }) => /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
|
|
526
533
|
className: "text-xs font-medium text-text-secondary",
|
|
527
534
|
children: e
|
|
528
|
-
}), /* @__PURE__ */
|
|
535
|
+
}), /* @__PURE__ */ s("div", {
|
|
529
536
|
className: "mt-1",
|
|
530
537
|
children: t
|
|
531
538
|
})] });
|