@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.
@@ -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 o, CalendarClock as te, PackageCheck as ne, Sprout as s, Target as re, Trash2 as ie } from "lucide-react";
8
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
9
- import { Button as u, GlassCard as d, Input as f, Select as p, SelectContent as m, SelectItem as h, SelectTrigger as g, SelectValue as _, Textarea as ae } from "@burdenoff/fe-libs/ui";
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 v = [
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
- ], oe = (e) => v.find((t) => t.value === e)?.label ?? e, y = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), se = (e) => {
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
- }, b = ({ plan: b, crops: C }) => {
56
- let { toast: w } = r(), { execution: T, loading: E, setTransplantDate: ce, addActivity: le, deleteActivity: ue, recordHarvest: de } = ee(b.id), D = i(() => {
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]), fe = i(() => D.find((e) => e.name === b.cropName)?.id ?? D[0]?.id ?? "", [D, b.cropName]), [O, k] = a(""), [pe, A] = a(!1), me = async () => {
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 ce(O), w({
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, he] = a("WATERING"), [M, ge] = a(y()), [N, P] = a(""), [F, I] = a(""), [L, _e] = a(""), [R, z] = a(""), [B, V] = a(!1), ve = async () => {
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 le({
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(""), _e(""), z("");
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
- }, ye = async (e) => {
109
+ }, be = async (e) => {
106
110
  try {
107
- await ue(e), w({
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
- }, [be, xe] = a(""), [H, U] = a(""), [W, Se] = a("kg"), [G, Ce] = a("A"), [K, we] = a(y()), [q, J] = a(""), [Y, Te] = a(!0), [X, Z] = a(!1), Q = be || fe, Ee = async () => {
118
- let e = se(H);
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
- Z(!0);
141
- try {
142
- await de({
143
- cropId: Q,
144
- fieldId: b.fieldId,
145
- quantity: e,
146
- unit: W.trim() || "kg",
147
- quality: G,
148
- harvestDate: K,
149
- pricePerUnit: q ? Number(q) : null,
150
- addToInventory: Y
151
- }), w({
152
- title: Y ? "Harvest recorded & added to inventory" : "Harvest recorded",
153
- variant: "success"
154
- }), U(""), J("");
155
- } catch {
156
- w({
157
- title: "Could not record harvest",
158
- variant: "error"
159
- });
160
- } finally {
161
- Z(!1);
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, De = $ == null ? "—" : `${$ > 0 ? "+" : ""}${t(Math.round($))}%`, Oe = $ == null ? "muted" : $ >= 0 ? "success" : "warning";
164
- return /* @__PURE__ */ l("div", {
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__ */ l(d, {
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__ */ l("h3", {
180
+ /* @__PURE__ */ c("h3", {
174
181
  className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
175
- children: [/* @__PURE__ */ c(re, { className: "h-4 w-4 text-info" }), " Execution & yield"]
182
+ children: [/* @__PURE__ */ s(ie, { className: "h-4 w-4 text-info" }), " Execution & yield"]
176
183
  }),
177
- /* @__PURE__ */ l("div", {
184
+ /* @__PURE__ */ c("div", {
178
185
  className: "grid grid-cols-2 gap-4 md:grid-cols-4",
179
186
  children: [
180
- /* @__PURE__ */ c(x, {
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__ */ c(x, {
192
+ /* @__PURE__ */ s(x, {
186
193
  label: "Actual yield",
187
194
  value: t(T?.actualYield ?? 0),
188
195
  unit: "kg"
189
196
  }),
190
- /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("div", {
197
+ /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("div", {
191
198
  className: "text-xs text-text-secondary",
192
199
  children: "Variance"
193
- }), /* @__PURE__ */ c("div", {
200
+ }), /* @__PURE__ */ s("div", {
194
201
  className: "mt-1",
195
- children: /* @__PURE__ */ c(n, {
196
- label: De,
197
- variant: Oe
202
+ children: /* @__PURE__ */ s(n, {
203
+ label: Ae,
204
+ variant: je
198
205
  })
199
206
  })] }),
200
- /* @__PURE__ */ c(x, {
207
+ /* @__PURE__ */ s(x, {
201
208
  label: "Harvests",
202
209
  value: t(T?.harvestCount ?? 0)
203
210
  })
204
211
  ]
205
212
  }),
206
- /* @__PURE__ */ l("div", {
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__ */ l("div", { children: [
209
- /* @__PURE__ */ l("div", {
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__ */ c(te, { className: "h-3.5 w-3.5" }), " Transplant date"]
218
+ children: [/* @__PURE__ */ s(ne, { className: "h-3.5 w-3.5" }), " Transplant date"]
212
219
  }),
213
- /* @__PURE__ */ c("div", {
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__ */ l("div", {
224
+ /* @__PURE__ */ c("div", {
218
225
  className: "mt-2 flex items-center gap-2",
219
- children: [/* @__PURE__ */ c(f, {
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__ */ c(u, {
232
+ }), /* @__PURE__ */ s(l, {
226
233
  size: "sm",
227
234
  variant: "outline",
228
- onClick: me,
229
- disabled: !O || pe,
235
+ onClick: he,
236
+ disabled: !O || me,
230
237
  children: T?.transplantDate ? "Update" : "Set"
231
238
  })]
232
239
  })
233
- ] }), /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("div", {
240
+ ] }), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("div", {
234
241
  className: "text-xs text-text-secondary",
235
242
  children: "Sow / nursery date"
236
- }), /* @__PURE__ */ c("div", {
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__ */ l(d, {
250
+ /* @__PURE__ */ c(u, {
244
251
  treatment: "glass",
245
252
  className: "border-border-seam p-6",
246
253
  children: [
247
- /* @__PURE__ */ l("h3", {
254
+ /* @__PURE__ */ c("h3", {
248
255
  className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
249
- children: [/* @__PURE__ */ c(o, { className: "h-4 w-4 text-info" }), " Activity log"]
256
+ children: [/* @__PURE__ */ s(te, { className: "h-4 w-4 text-info" }), " Activity log"]
250
257
  }),
251
- T && T.activities.length > 0 ? /* @__PURE__ */ c("ul", {
258
+ T && T.activities.length > 0 ? /* @__PURE__ */ s("ul", {
252
259
  className: "mb-5 space-y-2",
253
- children: T.activities.map((r) => /* @__PURE__ */ l("li", {
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__ */ l("div", {
262
+ children: [/* @__PURE__ */ c("div", {
256
263
  className: "min-w-0",
257
- children: [/* @__PURE__ */ l("div", {
264
+ children: [/* @__PURE__ */ c("div", {
258
265
  className: "flex items-center gap-2",
259
- children: [/* @__PURE__ */ c(n, {
260
- label: oe(r.type),
266
+ children: [/* @__PURE__ */ s(n, {
267
+ label: se(r.type),
261
268
  variant: "info"
262
- }), /* @__PURE__ */ c("span", {
269
+ }), /* @__PURE__ */ s("span", {
263
270
  className: "text-xs text-text-secondary",
264
271
  children: e(r.activityDate)
265
272
  })]
266
- }), /* @__PURE__ */ c("div", {
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__ */ c(u, {
281
+ }), /* @__PURE__ */ s(l, {
275
282
  size: "sm",
276
283
  variant: "ghost",
277
- onClick: () => ye(r.id),
284
+ onClick: () => be(r.id),
278
285
  "aria-label": "Remove activity",
279
- children: /* @__PURE__ */ c(ie, { className: "h-4 w-4 text-text-secondary" })
286
+ children: /* @__PURE__ */ s(ae, { className: "h-4 w-4 text-text-secondary" })
280
287
  })]
281
288
  }, r.id))
282
- }) : /* @__PURE__ */ c("p", {
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__ */ l("div", {
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__ */ c(S, {
296
+ /* @__PURE__ */ s(S, {
290
297
  label: "Type",
291
- children: /* @__PURE__ */ l(p, {
298
+ children: /* @__PURE__ */ c(f, {
292
299
  value: j,
293
- onValueChange: he,
294
- children: [/* @__PURE__ */ c(g, {
300
+ onValueChange: ge,
301
+ children: [/* @__PURE__ */ s(h, {
295
302
  className: "w-full",
296
- children: /* @__PURE__ */ c(_, {})
297
- }), /* @__PURE__ */ c(m, { children: v.map((e) => /* @__PURE__ */ c(h, {
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__ */ c(S, {
310
+ /* @__PURE__ */ s(S, {
304
311
  label: "Date",
305
- children: /* @__PURE__ */ c(f, {
312
+ children: /* @__PURE__ */ s(d, {
306
313
  type: "date",
307
314
  value: M,
308
- onChange: (e) => ge(e.target.value)
315
+ onChange: (e) => _e(e.target.value)
309
316
  })
310
317
  }),
311
- /* @__PURE__ */ c(S, {
318
+ /* @__PURE__ */ s(S, {
312
319
  label: "Quantity",
313
- children: /* @__PURE__ */ c(f, {
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__ */ c(S, {
329
+ /* @__PURE__ */ s(S, {
323
330
  label: "Unit",
324
- children: /* @__PURE__ */ c(f, {
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__ */ c(S, {
337
+ /* @__PURE__ */ s(S, {
331
338
  label: "Labor (hrs)",
332
- children: /* @__PURE__ */ c(f, {
339
+ children: /* @__PURE__ */ s(d, {
333
340
  type: "number",
334
341
  min: "0",
335
342
  step: "any",
336
343
  value: L,
337
- onChange: (e) => _e(e.target.value),
344
+ onChange: (e) => ve(e.target.value),
338
345
  placeholder: "e.g. 1.5"
339
346
  })
340
347
  }),
341
- /* @__PURE__ */ c(S, {
348
+ /* @__PURE__ */ s(S, {
342
349
  label: "Notes",
343
- children: /* @__PURE__ */ c(ae, {
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__ */ c("div", {
359
+ /* @__PURE__ */ s("div", {
353
360
  className: "mt-4",
354
- children: /* @__PURE__ */ l(u, {
355
- onClick: ve,
361
+ children: /* @__PURE__ */ c(l, {
362
+ onClick: ye,
356
363
  disabled: B,
357
364
  children: [
358
- /* @__PURE__ */ c(o, { className: "h-4 w-4" }),
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__ */ l(d, {
373
+ /* @__PURE__ */ c(u, {
367
374
  treatment: "glass",
368
375
  className: "border-border-seam p-6",
369
376
  children: [
370
- /* @__PURE__ */ l("h3", {
377
+ /* @__PURE__ */ c("h3", {
371
378
  className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
372
- children: [/* @__PURE__ */ c(s, { className: "h-4 w-4 text-info" }), " Harvest & inventory"]
379
+ children: [/* @__PURE__ */ s(o, { className: "h-4 w-4 text-info" }), " Harvest & inventory"]
373
380
  }),
374
- T && T.harvests.length > 0 ? /* @__PURE__ */ c("ul", {
381
+ T && T.harvests.length > 0 ? /* @__PURE__ */ s("ul", {
375
382
  className: "mb-5 space-y-2",
376
- children: T.harvests.map((r) => /* @__PURE__ */ l("li", {
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__ */ l("div", {
385
+ children: [/* @__PURE__ */ c("div", {
379
386
  className: "min-w-0",
380
- children: [/* @__PURE__ */ l("div", {
387
+ children: [/* @__PURE__ */ c("div", {
381
388
  className: "flex items-center gap-2",
382
- children: [/* @__PURE__ */ c("span", {
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__ */ c(n, {
392
+ }), /* @__PURE__ */ s(n, {
386
393
  label: `Grade ${r.qualityGrade}`,
387
394
  variant: "muted"
388
395
  })]
389
- }), /* @__PURE__ */ l("div", {
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__ */ l("span", {
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__ */ c(ne, { className: "h-4 w-4" }), " In inventory"]
402
- }) : /* @__PURE__ */ c(n, {
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__ */ c("p", {
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__ */ l("div", {
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__ */ c(S, {
421
+ /* @__PURE__ */ s(S, {
415
422
  label: "Crop",
416
- children: /* @__PURE__ */ l(p, {
423
+ children: /* @__PURE__ */ c(f, {
417
424
  value: Q,
418
- onValueChange: xe,
419
- children: [/* @__PURE__ */ c(g, {
425
+ onValueChange: Se,
426
+ children: [/* @__PURE__ */ s(h, {
420
427
  className: "w-full",
421
- children: /* @__PURE__ */ c(_, { placeholder: "Select crop" })
422
- }), /* @__PURE__ */ c(m, { children: D.map((e) => /* @__PURE__ */ c(h, {
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__ */ c(S, {
435
+ /* @__PURE__ */ s(S, {
429
436
  label: "Quantity",
430
- children: /* @__PURE__ */ c(f, {
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__ */ c(S, {
446
+ /* @__PURE__ */ s(S, {
440
447
  label: "Unit",
441
- children: /* @__PURE__ */ c(f, {
448
+ children: /* @__PURE__ */ s(d, {
442
449
  value: W,
443
- onChange: (e) => Se(e.target.value),
450
+ onChange: (e) => Ce(e.target.value),
444
451
  placeholder: "kg"
445
452
  })
446
453
  }),
447
- /* @__PURE__ */ c(S, {
454
+ /* @__PURE__ */ s(S, {
448
455
  label: "Quality",
449
- children: /* @__PURE__ */ l(p, {
456
+ children: /* @__PURE__ */ c(f, {
450
457
  value: G,
451
- onValueChange: Ce,
452
- children: [/* @__PURE__ */ c(g, {
458
+ onValueChange: we,
459
+ children: [/* @__PURE__ */ s(h, {
453
460
  className: "w-full",
454
- children: /* @__PURE__ */ c(_, {})
455
- }), /* @__PURE__ */ l(m, { children: [
456
- /* @__PURE__ */ c(h, {
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__ */ c(h, {
467
+ /* @__PURE__ */ s(m, {
461
468
  value: "B",
462
469
  children: "Grade B"
463
470
  }),
464
- /* @__PURE__ */ c(h, {
471
+ /* @__PURE__ */ s(m, {
465
472
  value: "C",
466
473
  children: "Grade C"
467
474
  })
468
475
  ] })]
469
476
  })
470
477
  }),
471
- /* @__PURE__ */ c(S, {
478
+ /* @__PURE__ */ s(S, {
472
479
  label: "Harvest date",
473
- children: /* @__PURE__ */ c(f, {
480
+ children: /* @__PURE__ */ s(d, {
474
481
  type: "date",
475
482
  value: K,
476
- onChange: (e) => we(e.target.value)
483
+ onChange: (e) => Te(e.target.value)
477
484
  })
478
485
  }),
479
- /* @__PURE__ */ c(S, {
486
+ /* @__PURE__ */ s(S, {
480
487
  label: "Price / unit",
481
- children: /* @__PURE__ */ c(f, {
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__ */ l("div", {
499
+ /* @__PURE__ */ c("div", {
493
500
  className: "mt-4 flex flex-wrap items-center gap-4",
494
- children: [/* @__PURE__ */ l("label", {
501
+ children: [/* @__PURE__ */ c("label", {
495
502
  className: "flex items-center gap-2 text-sm text-text-primary",
496
- children: [/* @__PURE__ */ c("input", {
503
+ children: [/* @__PURE__ */ s("input", {
497
504
  type: "checkbox",
498
505
  checked: Y,
499
- onChange: (e) => Te(e.target.checked),
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(u, {
503
- onClick: Ee,
509
+ }), /* @__PURE__ */ c(l, {
510
+ onClick: ke,
504
511
  disabled: X,
505
512
  children: [
506
- /* @__PURE__ */ c(s, { className: "h-4 w-4" }),
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__ */ l("div", { children: [/* @__PURE__ */ c("div", {
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__ */ l("div", {
526
+ }), /* @__PURE__ */ c("div", {
520
527
  className: "mt-1 text-lg font-semibold text-text-primary",
521
- children: [t, n ? /* @__PURE__ */ c("span", {
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__ */ l("div", { children: [/* @__PURE__ */ c("label", {
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__ */ c("div", {
535
+ }), /* @__PURE__ */ s("div", {
529
536
  className: "mt-1",
530
537
  children: t
531
538
  })] });