@burdenoff/microfe-healthybowl 2026.710.1 → 2026.710.3
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.
|
@@ -17,33 +17,33 @@ import { useHealthyBowlData as le } from "../../hooks/useHealthyBowlData.js";
|
|
|
17
17
|
import { DEFAULT_BED_WIDTH_M as o, DEFAULT_CROP_SPACING_PRESET as s, DEFAULT_PATH_WIDTH_M as c, estimatePlantingCapacity as ue, getCropSpacingPreset as l } from "../../utils/plantingCapacity.js";
|
|
18
18
|
import { useEffect as de, useMemo as u, useState as d } from "react";
|
|
19
19
|
import { useI18n as fe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
20
|
-
import { Activity as
|
|
21
|
-
import { useNavigate as
|
|
22
|
-
import { Fragment as
|
|
23
|
-
import { Button as
|
|
20
|
+
import { Activity as pe, ArrowLeft as me, BarChart3 as he, Calendar as ge, CloudRain as _e, Droplets as ve, Edit as ye, Eye as be, Leaf as xe, Map as Se, Sun as Ce, Thermometer as we, Trash2 as Te, TrendingUp as Ee, Wind as De } from "lucide-react";
|
|
21
|
+
import { useNavigate as Oe, useParams as ke } from "react-router-dom";
|
|
22
|
+
import { Fragment as Ae, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
23
|
+
import { Button as m, GlassCard as je, Select as h, SelectContent as g, SelectItem as _, SelectTrigger as v, SelectValue as y } from "@burdenoff/fe-libs/ui";
|
|
24
24
|
//#region src/healthybowl/pages/crops/FieldDetailsPage.tsx
|
|
25
|
-
var
|
|
25
|
+
var b = (e) => {
|
|
26
26
|
switch (e) {
|
|
27
27
|
case "active": return "success";
|
|
28
28
|
case "fallow": return "muted";
|
|
29
29
|
case "preparation": return "warning";
|
|
30
30
|
default: return "default";
|
|
31
31
|
}
|
|
32
|
-
},
|
|
32
|
+
}, Me = (e) => {
|
|
33
33
|
switch (e) {
|
|
34
34
|
case "optimal": return "success";
|
|
35
35
|
case "acceptable": return "info";
|
|
36
36
|
case "needs_attention": return "warning";
|
|
37
37
|
default: return "error";
|
|
38
38
|
}
|
|
39
|
-
},
|
|
39
|
+
}, x = (e, t) => {
|
|
40
40
|
let n = Number(e);
|
|
41
41
|
return Number.isFinite(n) && n > 0 ? n : t;
|
|
42
|
-
},
|
|
42
|
+
}, Ne = (e, t) => {
|
|
43
43
|
let n = Number(e);
|
|
44
44
|
return Number.isFinite(n) && n >= 0 ? n : t;
|
|
45
|
-
},
|
|
46
|
-
let { t: C } = fe(), Pe = ne(), { fields: Fe, crops: E, soilTests: Ie, weatherData: D, errors: Le, loadings: Re, updateField: ze, deleteField: Be, refetch: O } = le(), { fieldId: Ve } =
|
|
45
|
+
}, S = (e, t = 1) => new Intl.NumberFormat("en-US", { maximumFractionDigits: t }).format(e), C = () => {
|
|
46
|
+
let { t: C } = fe(), Pe = ne(), { fields: Fe, crops: E, soilTests: Ie, weatherData: D, errors: Le, loadings: Re, updateField: ze, deleteField: Be, refetch: O } = le(), { fieldId: Ve } = ke(), k = Oe(), { buildPath: A } = n(), { toasts: He, toast: j, dismiss: Ue } = oe(), [We, M] = d(!1), [N, P] = d(!1), F = Fe.find((e) => e.id === Ve), [I, Ge] = d(""), [L, Ke] = d(""), [qe, Je] = d("acres"), [Ye, Xe] = d(""), [Ze, Qe] = d(""), [$e, et] = d("active"), [tt, nt] = d(!1), [R, rt] = d(""), [z, B] = d(String(s.plantSpacingCm)), [V, H] = d(String(s.rowSpacingCm)), [U, it] = d(String(o)), [W, at] = d(String(c)), G = () => {
|
|
47
47
|
F && (Ge(F.name), Ke(String(F.area)), Je(F.unit ?? "acres"), Xe(F.soilType), Qe(F.irrigationType), et(F.status), nt(F.organicCertified), M(!0));
|
|
48
48
|
}, ot = async () => {
|
|
49
49
|
if (F) {
|
|
@@ -103,13 +103,20 @@ var x = (e) => {
|
|
|
103
103
|
}), P(!1);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
}, K = u(() => F ? E.filter((e) => e.field === F.id || e.fieldName === F.name) : [], [E, F]), q = u(() =>
|
|
106
|
+
}, K = u(() => F ? E.filter((e) => e.field === F.id || e.fieldName === F.name) : [], [E, F]), q = u(() => {
|
|
107
|
+
let e = /* @__PURE__ */ new Set();
|
|
108
|
+
return [...K, ...E].filter((t) => !e.has(t.id) && !!e.add(t.id));
|
|
109
|
+
}, [E, K]), ct = u(() => K[0] ?? q[0] ?? null, [q, K]), J = u(() => q.find((e) => e.id === R) ?? ct, [
|
|
110
|
+
R,
|
|
111
|
+
q,
|
|
112
|
+
ct
|
|
113
|
+
]), Y = u(() => l(J), [J]), X = u(() => F ? ue({
|
|
107
114
|
fieldArea: F.area,
|
|
108
115
|
fieldUnit: F.unit,
|
|
109
|
-
bedWidthM:
|
|
110
|
-
pathWidthM:
|
|
111
|
-
plantSpacingCm:
|
|
112
|
-
rowSpacingCm:
|
|
116
|
+
bedWidthM: x(U, o),
|
|
117
|
+
pathWidthM: Ne(W, c),
|
|
118
|
+
plantSpacingCm: x(z, Y.plantSpacingCm),
|
|
119
|
+
rowSpacingCm: x(V, Y.rowSpacingCm)
|
|
113
120
|
}) : null, [
|
|
114
121
|
U,
|
|
115
122
|
F,
|
|
@@ -123,7 +130,7 @@ var x = (e) => {
|
|
|
123
130
|
let e = l(J);
|
|
124
131
|
rt(J.id), B(String(e.plantSpacingCm)), H(String(e.rowSpacingCm));
|
|
125
132
|
}, [R, J]);
|
|
126
|
-
let
|
|
133
|
+
let lt = (e) => {
|
|
127
134
|
let t = q.find((t) => t.id === e);
|
|
128
135
|
rt(e);
|
|
129
136
|
let n = l(t);
|
|
@@ -169,7 +176,7 @@ var x = (e) => {
|
|
|
169
176
|
K,
|
|
170
177
|
Z,
|
|
171
178
|
C
|
|
172
|
-
]),
|
|
179
|
+
]), ut = u(() => K.length === 0 ? [{
|
|
173
180
|
season: C("healthybowl.crops.fieldDetail.cropHistory.currentSeason", "Current"),
|
|
174
181
|
crop: C("healthybowl.crops.fieldDetail.cropHistory.noCropsPlanted", "No crops planted"),
|
|
175
182
|
status: "fallow"
|
|
@@ -178,45 +185,45 @@ var x = (e) => {
|
|
|
178
185
|
crop: `${e.name} (${e.variety})`,
|
|
179
186
|
status: e.status === "harvested" ? "completed" : "active"
|
|
180
187
|
})), [K, C]);
|
|
181
|
-
return F ? /* @__PURE__ */
|
|
188
|
+
return F ? /* @__PURE__ */ p(r, {
|
|
182
189
|
title: F.name,
|
|
183
190
|
description: C("healthybowl.crops.fieldDetail.header.description", "{{area}} {{unit}} - {{soilType}}", {
|
|
184
191
|
area: F.area,
|
|
185
192
|
unit: F.unit,
|
|
186
193
|
soilType: F.soilType
|
|
187
194
|
}),
|
|
188
|
-
actions: /* @__PURE__ */
|
|
195
|
+
actions: /* @__PURE__ */ p("div", {
|
|
189
196
|
className: "flex items-center gap-2",
|
|
190
197
|
children: [
|
|
191
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ f(ce, {
|
|
192
199
|
entityType: "FIELD",
|
|
193
200
|
entityId: F.id,
|
|
194
201
|
entityLabel: F.name
|
|
195
202
|
}),
|
|
196
|
-
/* @__PURE__ */ m
|
|
203
|
+
/* @__PURE__ */ p(m, {
|
|
197
204
|
variant: "outline",
|
|
198
205
|
onClick: () => k(A("crops/fields")),
|
|
199
206
|
children: [
|
|
200
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ f(me, { className: "h-4 w-4" }),
|
|
201
208
|
" ",
|
|
202
209
|
C("healthybowl.crops.fieldDetail.actions.backToFields", "Back to Fields")
|
|
203
210
|
]
|
|
204
211
|
}),
|
|
205
|
-
/* @__PURE__ */ m
|
|
212
|
+
/* @__PURE__ */ p(m, {
|
|
206
213
|
variant: "outline",
|
|
207
214
|
onClick: G,
|
|
208
215
|
children: [
|
|
209
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ f(ye, { className: "h-4 w-4" }),
|
|
210
217
|
" ",
|
|
211
218
|
C("healthybowl.crops.fieldDetail.actions.editField", "Edit Field")
|
|
212
219
|
]
|
|
213
220
|
}),
|
|
214
|
-
/* @__PURE__ */ m
|
|
221
|
+
/* @__PURE__ */ p(m, {
|
|
215
222
|
variant: "destructive",
|
|
216
223
|
onClick: st,
|
|
217
224
|
disabled: N,
|
|
218
225
|
children: [
|
|
219
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ f(Te, { className: "h-4 w-4" }),
|
|
220
227
|
" ",
|
|
221
228
|
C("healthybowl.common.delete", "Delete")
|
|
222
229
|
]
|
|
@@ -246,7 +253,7 @@ var x = (e) => {
|
|
|
246
253
|
],
|
|
247
254
|
nextStepsKey: "healthybowl-field-detail",
|
|
248
255
|
children: [
|
|
249
|
-
/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ f(re, { items: [
|
|
250
257
|
{
|
|
251
258
|
label: C("healthybowl.crops.fieldDetail.breadcrumbs.crops", "Crops"),
|
|
252
259
|
href: A("crops")
|
|
@@ -257,50 +264,50 @@ var x = (e) => {
|
|
|
257
264
|
},
|
|
258
265
|
{ label: F.name }
|
|
259
266
|
] }),
|
|
260
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ p("div", {
|
|
261
268
|
className: "flex flex-wrap items-center gap-3",
|
|
262
|
-
children: [/* @__PURE__ */
|
|
269
|
+
children: [/* @__PURE__ */ f(i, {
|
|
263
270
|
label: F.status,
|
|
264
|
-
variant:
|
|
271
|
+
variant: b(F.status),
|
|
265
272
|
dot: !0
|
|
266
|
-
}), F.organicCertified ? /* @__PURE__ */
|
|
273
|
+
}), F.organicCertified ? /* @__PURE__ */ f(i, {
|
|
267
274
|
label: C("healthybowl.crops.fieldDetail.badges.organicCertified", "Organic Certified"),
|
|
268
275
|
variant: "success"
|
|
269
|
-
}) : /* @__PURE__ */
|
|
276
|
+
}) : /* @__PURE__ */ f(i, {
|
|
270
277
|
label: C("healthybowl.crops.fieldDetail.badges.notCertified", "Not Certified"),
|
|
271
278
|
variant: "muted"
|
|
272
279
|
})]
|
|
273
280
|
}),
|
|
274
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ p("div", {
|
|
275
282
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
276
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ p("div", {
|
|
277
284
|
className: "space-y-6 lg:col-span-2",
|
|
278
285
|
children: [
|
|
279
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ p(je, {
|
|
280
287
|
treatment: "glass",
|
|
281
288
|
glow: !0,
|
|
282
289
|
className: "border-border-seam p-6",
|
|
283
290
|
children: [
|
|
284
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ f("h3", {
|
|
285
292
|
className: "mb-4 text-sm font-semibold text-text-primary",
|
|
286
293
|
children: C("healthybowl.crops.fieldDetail.info.heading", "Field Information")
|
|
287
294
|
}),
|
|
288
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ p("div", {
|
|
289
296
|
className: "grid grid-cols-1 gap-6 sm:grid-cols-2",
|
|
290
|
-
children: [/* @__PURE__ */
|
|
297
|
+
children: [/* @__PURE__ */ p("div", {
|
|
291
298
|
className: "space-y-4",
|
|
292
299
|
children: [
|
|
293
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("span", {
|
|
294
301
|
className: "text-xs text-text-secondary",
|
|
295
302
|
children: C("healthybowl.crops.fieldDetail.info.fieldName", "Field Name")
|
|
296
|
-
}), /* @__PURE__ */
|
|
303
|
+
}), /* @__PURE__ */ f("p", {
|
|
297
304
|
className: "text-sm font-semibold text-text-primary",
|
|
298
305
|
children: F.name
|
|
299
306
|
})] }),
|
|
300
|
-
/* @__PURE__ */
|
|
307
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("span", {
|
|
301
308
|
className: "text-xs text-text-secondary",
|
|
302
309
|
children: C("healthybowl.crops.fieldDetail.info.area", "Area")
|
|
303
|
-
}), /* @__PURE__ */
|
|
310
|
+
}), /* @__PURE__ */ p("p", {
|
|
304
311
|
className: "text-sm font-semibold text-text-primary",
|
|
305
312
|
children: [
|
|
306
313
|
F.area,
|
|
@@ -308,67 +315,67 @@ var x = (e) => {
|
|
|
308
315
|
F.unit
|
|
309
316
|
]
|
|
310
317
|
})] }),
|
|
311
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("span", {
|
|
312
319
|
className: "text-xs text-text-secondary",
|
|
313
320
|
children: C("healthybowl.crops.fieldDetail.info.status", "Status")
|
|
314
|
-
}), /* @__PURE__ */
|
|
321
|
+
}), /* @__PURE__ */ f("div", {
|
|
315
322
|
className: "mt-1",
|
|
316
|
-
children: /* @__PURE__ */
|
|
323
|
+
children: /* @__PURE__ */ f(i, {
|
|
317
324
|
label: F.status,
|
|
318
|
-
variant:
|
|
325
|
+
variant: b(F.status)
|
|
319
326
|
})
|
|
320
327
|
})] })
|
|
321
328
|
]
|
|
322
|
-
}), /* @__PURE__ */
|
|
329
|
+
}), /* @__PURE__ */ p("div", {
|
|
323
330
|
className: "space-y-4",
|
|
324
331
|
children: [
|
|
325
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("span", {
|
|
326
333
|
className: "text-xs text-text-secondary",
|
|
327
334
|
children: C("healthybowl.crops.fieldDetail.info.soilType", "Soil Type")
|
|
328
|
-
}), /* @__PURE__ */
|
|
335
|
+
}), /* @__PURE__ */ f("p", {
|
|
329
336
|
className: "text-sm font-semibold text-text-primary",
|
|
330
337
|
children: F.soilType
|
|
331
338
|
})] }),
|
|
332
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("span", {
|
|
333
340
|
className: "text-xs text-text-secondary",
|
|
334
341
|
children: C("healthybowl.crops.fieldDetail.info.irrigation", "Irrigation")
|
|
335
|
-
}), /* @__PURE__ */
|
|
342
|
+
}), /* @__PURE__ */ f("p", {
|
|
336
343
|
className: "text-sm font-semibold text-text-primary",
|
|
337
344
|
children: F.irrigationType
|
|
338
345
|
})] }),
|
|
339
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("span", {
|
|
340
347
|
className: "text-xs text-text-secondary",
|
|
341
348
|
children: C("healthybowl.crops.fieldDetail.info.currentCrops", "Current Crops")
|
|
342
|
-
}), /* @__PURE__ */
|
|
349
|
+
}), /* @__PURE__ */ f("p", {
|
|
343
350
|
className: "text-sm font-semibold text-text-primary",
|
|
344
351
|
children: (F.crops ?? []).length > 0 ? (F.crops ?? []).join(", ") : C("healthybowl.crops.fieldDetail.info.noneValue", "None")
|
|
345
352
|
})] })
|
|
346
353
|
]
|
|
347
354
|
})]
|
|
348
355
|
}),
|
|
349
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ p("div", {
|
|
350
357
|
className: "mt-6 border-t border-border-subtle pt-4",
|
|
351
|
-
children: [/* @__PURE__ */
|
|
358
|
+
children: [/* @__PURE__ */ f("span", {
|
|
352
359
|
className: "text-xs text-text-secondary",
|
|
353
360
|
children: C("healthybowl.crops.fieldDetail.info.gpsCoordinates", "GPS Coordinates")
|
|
354
|
-
}), /* @__PURE__ */
|
|
361
|
+
}), /* @__PURE__ */ p("div", {
|
|
355
362
|
className: "mt-1 flex items-center gap-4",
|
|
356
|
-
children: [/* @__PURE__ */
|
|
363
|
+
children: [/* @__PURE__ */ p("span", {
|
|
357
364
|
className: "text-xs text-text-secondary",
|
|
358
365
|
children: [
|
|
359
366
|
C("healthybowl.crops.fieldDetail.info.latLabel", "Lat:"),
|
|
360
367
|
" ",
|
|
361
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ f("span", {
|
|
362
369
|
className: "font-mono text-sm text-text-primary",
|
|
363
370
|
children: F.location?.lat ?? 0
|
|
364
371
|
})
|
|
365
372
|
]
|
|
366
|
-
}), /* @__PURE__ */
|
|
373
|
+
}), /* @__PURE__ */ p("span", {
|
|
367
374
|
className: "text-xs text-text-secondary",
|
|
368
375
|
children: [
|
|
369
376
|
C("healthybowl.crops.fieldDetail.info.lngLabel", "Lng:"),
|
|
370
377
|
" ",
|
|
371
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ f("span", {
|
|
372
379
|
className: "font-mono text-sm text-text-primary",
|
|
373
380
|
children: F.location?.lng ?? 0
|
|
374
381
|
})
|
|
@@ -378,64 +385,64 @@ var x = (e) => {
|
|
|
378
385
|
})
|
|
379
386
|
]
|
|
380
387
|
}),
|
|
381
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ p("div", {
|
|
382
389
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
383
390
|
children: [
|
|
384
|
-
/* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ p("div", {
|
|
385
392
|
className: "mb-4",
|
|
386
|
-
children: [/* @__PURE__ */
|
|
393
|
+
children: [/* @__PURE__ */ p("h3", {
|
|
387
394
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
388
395
|
children: [
|
|
389
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ f(Se, { className: "h-4 w-4 text-success" }),
|
|
390
397
|
" ",
|
|
391
398
|
C("healthybowl.crops.fieldDetail.boundary.heading", "Field Boundary")
|
|
392
399
|
]
|
|
393
|
-
}), /* @__PURE__ */
|
|
400
|
+
}), /* @__PURE__ */ f("p", {
|
|
394
401
|
className: "mt-1 text-xs text-text-secondary",
|
|
395
402
|
children: C("healthybowl.crops.fieldDetail.boundary.description", "Draw or import this field’s boundary on the satellite map. Saving updates the field area automatically.")
|
|
396
403
|
})]
|
|
397
404
|
}),
|
|
398
|
-
/* @__PURE__ */
|
|
405
|
+
/* @__PURE__ */ f(se, {
|
|
399
406
|
fieldId: F.id,
|
|
400
407
|
unit: F.unit ?? "acres",
|
|
401
408
|
center: F.location,
|
|
402
409
|
initialBoundary: F.boundary,
|
|
403
410
|
onSaved: O
|
|
404
411
|
}),
|
|
405
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ p("div", {
|
|
406
413
|
className: "mt-5 border-t border-border-subtle pt-5",
|
|
407
414
|
children: [
|
|
408
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ p("div", {
|
|
409
416
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
410
|
-
children: [/* @__PURE__ */
|
|
417
|
+
children: [/* @__PURE__ */ f("h4", {
|
|
411
418
|
className: "text-sm font-semibold text-text-primary",
|
|
412
419
|
children: C("healthybowl.crops.fieldDetail.capacity.heading", "Planting capacity")
|
|
413
|
-
}), /* @__PURE__ */
|
|
420
|
+
}), /* @__PURE__ */ f(i, {
|
|
414
421
|
label: Y.label,
|
|
415
422
|
variant: "muted"
|
|
416
423
|
})]
|
|
417
424
|
}),
|
|
418
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ p("div", {
|
|
419
426
|
className: "mt-4 grid gap-3 md:grid-cols-2 xl:grid-cols-6",
|
|
420
427
|
children: [
|
|
421
|
-
/* @__PURE__ */
|
|
428
|
+
/* @__PURE__ */ p("div", {
|
|
422
429
|
className: "xl:col-span-2",
|
|
423
|
-
children: [/* @__PURE__ */
|
|
430
|
+
children: [/* @__PURE__ */ f("label", {
|
|
424
431
|
className: "text-xs font-medium text-text-secondary",
|
|
425
432
|
children: C("healthybowl.crops.fieldDetail.capacity.crop", "Crop")
|
|
426
|
-
}), /* @__PURE__ */
|
|
433
|
+
}), /* @__PURE__ */ p(h, {
|
|
427
434
|
value: R,
|
|
428
|
-
onValueChange:
|
|
429
|
-
children: [/* @__PURE__ */
|
|
435
|
+
onValueChange: lt,
|
|
436
|
+
children: [/* @__PURE__ */ f(v, {
|
|
430
437
|
className: "mt-1 w-full",
|
|
431
|
-
children: /* @__PURE__ */
|
|
432
|
-
}), /* @__PURE__ */
|
|
438
|
+
children: /* @__PURE__ */ f(y, { placeholder: C("healthybowl.crops.fieldDetail.capacity.cropPlaceholder", "Select crop") })
|
|
439
|
+
}), /* @__PURE__ */ f(g, { children: q.map((e) => /* @__PURE__ */ f(_, {
|
|
433
440
|
value: e.id,
|
|
434
441
|
children: e.variety ? `${e.name} - ${e.variety}` : e.name
|
|
435
442
|
}, e.id)) })]
|
|
436
443
|
})]
|
|
437
444
|
}),
|
|
438
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ f(w, {
|
|
439
446
|
label: C("healthybowl.crops.fieldDetail.capacity.plantSpacing", "Plant spacing"),
|
|
440
447
|
unit: "cm",
|
|
441
448
|
value: z,
|
|
@@ -443,7 +450,7 @@ var x = (e) => {
|
|
|
443
450
|
step: "1",
|
|
444
451
|
onChange: B
|
|
445
452
|
}),
|
|
446
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ f(w, {
|
|
447
454
|
label: C("healthybowl.crops.fieldDetail.capacity.rowSpacing", "Row spacing"),
|
|
448
455
|
unit: "cm",
|
|
449
456
|
value: V,
|
|
@@ -451,7 +458,7 @@ var x = (e) => {
|
|
|
451
458
|
step: "1",
|
|
452
459
|
onChange: H
|
|
453
460
|
}),
|
|
454
|
-
/* @__PURE__ */
|
|
461
|
+
/* @__PURE__ */ f(w, {
|
|
455
462
|
label: C("healthybowl.crops.fieldDetail.capacity.bedWidth", "Bed width"),
|
|
456
463
|
unit: "m",
|
|
457
464
|
value: U,
|
|
@@ -459,7 +466,7 @@ var x = (e) => {
|
|
|
459
466
|
step: "0.1",
|
|
460
467
|
onChange: it
|
|
461
468
|
}),
|
|
462
|
-
/* @__PURE__ */
|
|
469
|
+
/* @__PURE__ */ f(w, {
|
|
463
470
|
label: C("healthybowl.crops.fieldDetail.capacity.pathWidth", "Path width"),
|
|
464
471
|
unit: "m",
|
|
465
472
|
value: W,
|
|
@@ -469,36 +476,41 @@ var x = (e) => {
|
|
|
469
476
|
})
|
|
470
477
|
]
|
|
471
478
|
}),
|
|
472
|
-
X ? /* @__PURE__ */
|
|
479
|
+
X ? /* @__PURE__ */ p("div", {
|
|
473
480
|
className: "mt-4 grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-6",
|
|
474
481
|
children: [
|
|
475
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ f(T, {
|
|
476
483
|
label: C("healthybowl.crops.fieldDetail.capacity.metrics.beds", "Beds"),
|
|
477
484
|
value: t(X.bedCount)
|
|
478
485
|
}),
|
|
479
|
-
/* @__PURE__ */
|
|
486
|
+
/* @__PURE__ */ f(T, {
|
|
480
487
|
label: C("healthybowl.crops.fieldDetail.capacity.metrics.rowsPerBed", "Rows / bed"),
|
|
481
488
|
value: t(X.rowsPerBed)
|
|
482
489
|
}),
|
|
483
|
-
/* @__PURE__ */
|
|
490
|
+
/* @__PURE__ */ f(T, {
|
|
484
491
|
label: C("healthybowl.crops.fieldDetail.capacity.metrics.plantsPerBed", "Plants / bed"),
|
|
485
492
|
value: t(X.plantsPerBed)
|
|
486
493
|
}),
|
|
487
|
-
/* @__PURE__ */
|
|
494
|
+
/* @__PURE__ */ f(T, {
|
|
488
495
|
label: C("healthybowl.crops.fieldDetail.capacity.metrics.totalPlants", "Total plants"),
|
|
489
496
|
value: t(X.totalPlants)
|
|
490
497
|
}),
|
|
491
|
-
/* @__PURE__ */
|
|
498
|
+
/* @__PURE__ */ f(T, {
|
|
492
499
|
label: C("healthybowl.crops.fieldDetail.capacity.metrics.seedlings", "Seedlings"),
|
|
493
500
|
value: t(X.seedlingTarget)
|
|
494
501
|
}),
|
|
495
|
-
/* @__PURE__ */
|
|
502
|
+
/* @__PURE__ */ f(T, {
|
|
496
503
|
label: C("healthybowl.crops.fieldDetail.capacity.metrics.bedLength", "Bed length"),
|
|
497
|
-
value:
|
|
504
|
+
value: S(X.bedLengthM),
|
|
498
505
|
unit: "m"
|
|
506
|
+
}),
|
|
507
|
+
/* @__PURE__ */ f(T, {
|
|
508
|
+
label: C("healthybowl.crops.fieldDetail.capacity.metrics.density", "Density"),
|
|
509
|
+
value: S(X.densityPlantsPerSqm, 2),
|
|
510
|
+
unit: C("healthybowl.crops.fieldDetail.capacity.metrics.densityUnit", "plants/m²")
|
|
499
511
|
})
|
|
500
512
|
]
|
|
501
|
-
}) : /* @__PURE__ */
|
|
513
|
+
}) : /* @__PURE__ */ f("p", {
|
|
502
514
|
className: "mt-4 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-sm text-text-secondary",
|
|
503
515
|
children: C("healthybowl.crops.fieldDetail.capacity.empty", "Set this field area to calculate beds and plants.")
|
|
504
516
|
})
|
|
@@ -506,76 +518,76 @@ var x = (e) => {
|
|
|
506
518
|
})
|
|
507
519
|
]
|
|
508
520
|
}),
|
|
509
|
-
/* @__PURE__ */
|
|
521
|
+
/* @__PURE__ */ p("div", {
|
|
510
522
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
511
|
-
children: [/* @__PURE__ */
|
|
523
|
+
children: [/* @__PURE__ */ p("h3", {
|
|
512
524
|
className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
513
525
|
children: [
|
|
514
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ f(xe, { className: "h-4 w-4 text-success" }),
|
|
515
527
|
" ",
|
|
516
528
|
C("healthybowl.crops.fieldDetail.currentCrops.heading", "Current Crops")
|
|
517
529
|
]
|
|
518
|
-
}), K.length > 0 ? /* @__PURE__ */
|
|
530
|
+
}), K.length > 0 ? /* @__PURE__ */ f("div", {
|
|
519
531
|
className: "flex flex-col gap-3",
|
|
520
|
-
children: K.map((e) => /* @__PURE__ */
|
|
532
|
+
children: K.map((e) => /* @__PURE__ */ p("div", {
|
|
521
533
|
onClick: () => k(A(`crops/${e.id}`)),
|
|
522
534
|
className: "flex cursor-pointer items-center justify-between rounded-md border border-border-subtle p-3 transition-colors hover:bg-bg-sunken/50",
|
|
523
|
-
children: [/* @__PURE__ */
|
|
524
|
-
/* @__PURE__ */
|
|
535
|
+
children: [/* @__PURE__ */ p("div", { children: [
|
|
536
|
+
/* @__PURE__ */ f("span", {
|
|
525
537
|
className: "text-sm font-medium text-text-primary",
|
|
526
538
|
children: e.name
|
|
527
539
|
}),
|
|
528
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ f("span", {
|
|
529
541
|
className: "ml-2 text-xs text-text-secondary",
|
|
530
542
|
children: e.variety
|
|
531
543
|
}),
|
|
532
|
-
/* @__PURE__ */
|
|
544
|
+
/* @__PURE__ */ p("div", {
|
|
533
545
|
className: "mt-1 flex items-center gap-2",
|
|
534
|
-
children: [/* @__PURE__ */
|
|
546
|
+
children: [/* @__PURE__ */ f("div", {
|
|
535
547
|
className: "h-1.5 w-24 rounded-full bg-bg-sunken",
|
|
536
|
-
children: /* @__PURE__ */
|
|
548
|
+
children: /* @__PURE__ */ f("div", {
|
|
537
549
|
className: "h-1.5 rounded-full bg-action-primary-bg",
|
|
538
550
|
style: { width: `${e.progress}%` }
|
|
539
551
|
})
|
|
540
|
-
}), /* @__PURE__ */
|
|
552
|
+
}), /* @__PURE__ */ p("span", {
|
|
541
553
|
className: "text-xs text-text-secondary",
|
|
542
554
|
children: [e.progress, "%"]
|
|
543
555
|
})]
|
|
544
556
|
})
|
|
545
|
-
] }), /* @__PURE__ */
|
|
557
|
+
] }), /* @__PURE__ */ p("div", {
|
|
546
558
|
className: "flex items-center gap-2",
|
|
547
|
-
children: [/* @__PURE__ */
|
|
559
|
+
children: [/* @__PURE__ */ f(i, {
|
|
548
560
|
label: e.growthStage,
|
|
549
561
|
variant: "info"
|
|
550
|
-
}), /* @__PURE__ */
|
|
562
|
+
}), /* @__PURE__ */ p("span", {
|
|
551
563
|
className: "text-xs text-text-secondary",
|
|
552
564
|
children: [e.daysToHarvest, "d"]
|
|
553
565
|
})]
|
|
554
566
|
})]
|
|
555
567
|
}, e.id))
|
|
556
|
-
}) : /* @__PURE__ */
|
|
568
|
+
}) : /* @__PURE__ */ f("p", {
|
|
557
569
|
className: "text-sm text-text-secondary",
|
|
558
570
|
children: C("healthybowl.crops.fieldDetail.currentCrops.empty", "No crops currently planted.")
|
|
559
571
|
})]
|
|
560
572
|
}),
|
|
561
|
-
Z && /* @__PURE__ */
|
|
573
|
+
Z && /* @__PURE__ */ p("div", {
|
|
562
574
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
563
575
|
children: [
|
|
564
|
-
/* @__PURE__ */
|
|
576
|
+
/* @__PURE__ */ p("div", {
|
|
565
577
|
className: "mb-4 flex items-center justify-between",
|
|
566
|
-
children: [/* @__PURE__ */
|
|
578
|
+
children: [/* @__PURE__ */ p("h3", {
|
|
567
579
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
568
580
|
children: [
|
|
569
|
-
/* @__PURE__ */
|
|
581
|
+
/* @__PURE__ */ f(pe, { className: "h-4 w-4 text-warning" }),
|
|
570
582
|
" ",
|
|
571
583
|
C("healthybowl.crops.fieldDetail.soilHealth.heading", "Soil Health")
|
|
572
584
|
]
|
|
573
|
-
}), /* @__PURE__ */
|
|
585
|
+
}), /* @__PURE__ */ f(i, {
|
|
574
586
|
label: (Z.status ?? "unknown").replace("_", " "),
|
|
575
|
-
variant:
|
|
587
|
+
variant: Me(Z.status ?? "unknown")
|
|
576
588
|
})]
|
|
577
589
|
}),
|
|
578
|
-
/* @__PURE__ */
|
|
590
|
+
/* @__PURE__ */ f("div", {
|
|
579
591
|
className: "grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-6",
|
|
580
592
|
children: [
|
|
581
593
|
{
|
|
@@ -614,25 +626,25 @@ var x = (e) => {
|
|
|
614
626
|
value: `${Z.moisture}%`,
|
|
615
627
|
good: Z.moisture >= 20 && Z.moisture <= 40
|
|
616
628
|
}
|
|
617
|
-
].map(({ key: e, label: t, value: n, good: r }) => /* @__PURE__ */
|
|
629
|
+
].map(({ key: e, label: t, value: n, good: r }) => /* @__PURE__ */ p("div", {
|
|
618
630
|
className: "text-center",
|
|
619
|
-
children: [/* @__PURE__ */
|
|
631
|
+
children: [/* @__PURE__ */ f("span", {
|
|
620
632
|
className: "text-xs text-text-secondary",
|
|
621
633
|
children: t
|
|
622
|
-
}), /* @__PURE__ */
|
|
634
|
+
}), /* @__PURE__ */ f("p", {
|
|
623
635
|
className: `text-sm font-semibold ${r ? "text-success" : "text-warning"}`,
|
|
624
636
|
children: n
|
|
625
637
|
})]
|
|
626
638
|
}, e))
|
|
627
639
|
}),
|
|
628
|
-
Z.recommendations.length > 0 && /* @__PURE__ */
|
|
640
|
+
Z.recommendations.length > 0 && /* @__PURE__ */ p("div", {
|
|
629
641
|
className: "mt-4 border-t border-border-subtle pt-4",
|
|
630
|
-
children: [/* @__PURE__ */
|
|
642
|
+
children: [/* @__PURE__ */ f("h4", {
|
|
631
643
|
className: "mb-2 text-xs font-medium text-text-secondary",
|
|
632
644
|
children: C("healthybowl.crops.fieldDetail.soilHealth.recommendations", "Recommendations")
|
|
633
|
-
}), /* @__PURE__ */
|
|
645
|
+
}), /* @__PURE__ */ f("ul", {
|
|
634
646
|
className: "space-y-1",
|
|
635
|
-
children: Z.recommendations.map((e, t) => /* @__PURE__ */
|
|
647
|
+
children: Z.recommendations.map((e, t) => /* @__PURE__ */ p("li", {
|
|
636
648
|
className: "text-xs text-text-primary",
|
|
637
649
|
children: ["- ", e]
|
|
638
650
|
}, t))
|
|
@@ -640,26 +652,26 @@ var x = (e) => {
|
|
|
640
652
|
})
|
|
641
653
|
]
|
|
642
654
|
}),
|
|
643
|
-
/* @__PURE__ */
|
|
655
|
+
/* @__PURE__ */ p("div", {
|
|
644
656
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
645
|
-
children: [/* @__PURE__ */
|
|
657
|
+
children: [/* @__PURE__ */ p("h3", {
|
|
646
658
|
className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
647
659
|
children: [
|
|
648
|
-
/* @__PURE__ */
|
|
660
|
+
/* @__PURE__ */ f(ge, { className: "h-4 w-4 text-info" }),
|
|
649
661
|
" ",
|
|
650
662
|
C("healthybowl.crops.fieldDetail.cropHistory.heading", "Crop History")
|
|
651
663
|
]
|
|
652
|
-
}), /* @__PURE__ */
|
|
664
|
+
}), /* @__PURE__ */ f("div", {
|
|
653
665
|
className: "space-y-3",
|
|
654
|
-
children:
|
|
666
|
+
children: ut.map((e, t) => /* @__PURE__ */ p("div", {
|
|
655
667
|
className: "flex items-center justify-between rounded-md border border-border-subtle p-3",
|
|
656
|
-
children: [/* @__PURE__ */
|
|
668
|
+
children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("span", {
|
|
657
669
|
className: "text-sm font-medium text-text-primary",
|
|
658
670
|
children: e.crop
|
|
659
|
-
}), /* @__PURE__ */
|
|
671
|
+
}), /* @__PURE__ */ f("p", {
|
|
660
672
|
className: "text-xs text-text-secondary",
|
|
661
673
|
children: e.season
|
|
662
|
-
})] }), /* @__PURE__ */
|
|
674
|
+
})] }), /* @__PURE__ */ f(i, {
|
|
663
675
|
label: e.status,
|
|
664
676
|
variant: e.status === "active" ? "success" : "muted"
|
|
665
677
|
})]
|
|
@@ -667,87 +679,87 @@ var x = (e) => {
|
|
|
667
679
|
})]
|
|
668
680
|
})
|
|
669
681
|
]
|
|
670
|
-
}), /* @__PURE__ */
|
|
682
|
+
}), /* @__PURE__ */ p("div", {
|
|
671
683
|
className: "space-y-6",
|
|
672
684
|
children: [
|
|
673
|
-
/* @__PURE__ */
|
|
685
|
+
/* @__PURE__ */ p("div", {
|
|
674
686
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
675
|
-
children: [/* @__PURE__ */
|
|
687
|
+
children: [/* @__PURE__ */ p("h3", {
|
|
676
688
|
className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
677
689
|
children: [
|
|
678
|
-
/* @__PURE__ */
|
|
690
|
+
/* @__PURE__ */ f(_e, { className: "h-4 w-4 text-info" }),
|
|
679
691
|
" ",
|
|
680
692
|
C("healthybowl.crops.fieldDetail.weather.heading", "Current Conditions")
|
|
681
693
|
]
|
|
682
|
-
}), /* @__PURE__ */
|
|
694
|
+
}), /* @__PURE__ */ p("div", {
|
|
683
695
|
className: "space-y-3",
|
|
684
696
|
children: [
|
|
685
|
-
/* @__PURE__ */
|
|
697
|
+
/* @__PURE__ */ p("div", {
|
|
686
698
|
className: "flex items-center justify-between",
|
|
687
|
-
children: [/* @__PURE__ */
|
|
699
|
+
children: [/* @__PURE__ */ p("span", {
|
|
688
700
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
689
701
|
children: [
|
|
690
|
-
/* @__PURE__ */
|
|
702
|
+
/* @__PURE__ */ f(we, { className: "h-3.5 w-3.5" }),
|
|
691
703
|
" ",
|
|
692
704
|
C("healthybowl.crops.fieldDetail.weather.temperature", "Temperature")
|
|
693
705
|
]
|
|
694
|
-
}), /* @__PURE__ */
|
|
706
|
+
}), /* @__PURE__ */ p("span", {
|
|
695
707
|
className: "text-sm font-medium text-text-primary",
|
|
696
708
|
children: [Q.current.temperature, "°C"]
|
|
697
709
|
})]
|
|
698
710
|
}),
|
|
699
|
-
/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ p("div", {
|
|
700
712
|
className: "flex items-center justify-between",
|
|
701
|
-
children: [/* @__PURE__ */
|
|
713
|
+
children: [/* @__PURE__ */ p("span", {
|
|
702
714
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
703
715
|
children: [
|
|
704
|
-
/* @__PURE__ */
|
|
716
|
+
/* @__PURE__ */ f(ve, { className: "h-3.5 w-3.5" }),
|
|
705
717
|
" ",
|
|
706
718
|
C("healthybowl.crops.fieldDetail.weather.humidity", "Humidity")
|
|
707
719
|
]
|
|
708
|
-
}), /* @__PURE__ */
|
|
720
|
+
}), /* @__PURE__ */ p("span", {
|
|
709
721
|
className: "text-sm font-medium text-text-primary",
|
|
710
722
|
children: [Q.current.humidity, "%"]
|
|
711
723
|
})]
|
|
712
724
|
}),
|
|
713
|
-
/* @__PURE__ */
|
|
725
|
+
/* @__PURE__ */ p("div", {
|
|
714
726
|
className: "flex items-center justify-between",
|
|
715
|
-
children: [/* @__PURE__ */
|
|
727
|
+
children: [/* @__PURE__ */ p("span", {
|
|
716
728
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
717
729
|
children: [
|
|
718
|
-
/* @__PURE__ */
|
|
730
|
+
/* @__PURE__ */ f(De, { className: "h-3.5 w-3.5" }),
|
|
719
731
|
" ",
|
|
720
732
|
C("healthybowl.crops.fieldDetail.weather.wind", "Wind")
|
|
721
733
|
]
|
|
722
|
-
}), /* @__PURE__ */
|
|
734
|
+
}), /* @__PURE__ */ p("span", {
|
|
723
735
|
className: "text-sm font-medium text-text-primary",
|
|
724
736
|
children: [Q.current.windSpeed, " km/h"]
|
|
725
737
|
})]
|
|
726
738
|
}),
|
|
727
|
-
/* @__PURE__ */
|
|
739
|
+
/* @__PURE__ */ p("div", {
|
|
728
740
|
className: "flex items-center justify-between",
|
|
729
|
-
children: [/* @__PURE__ */
|
|
741
|
+
children: [/* @__PURE__ */ p("span", {
|
|
730
742
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
731
743
|
children: [
|
|
732
|
-
/* @__PURE__ */
|
|
744
|
+
/* @__PURE__ */ f(Ce, { className: "h-3.5 w-3.5" }),
|
|
733
745
|
" ",
|
|
734
746
|
C("healthybowl.crops.fieldDetail.weather.uvIndex", "UV Index")
|
|
735
747
|
]
|
|
736
|
-
}), /* @__PURE__ */
|
|
748
|
+
}), /* @__PURE__ */ f("span", {
|
|
737
749
|
className: "text-sm font-medium text-text-primary",
|
|
738
750
|
children: Q.current.uvIndex
|
|
739
751
|
})]
|
|
740
752
|
}),
|
|
741
|
-
/* @__PURE__ */
|
|
753
|
+
/* @__PURE__ */ p("div", {
|
|
742
754
|
className: "flex items-center justify-between",
|
|
743
|
-
children: [/* @__PURE__ */
|
|
755
|
+
children: [/* @__PURE__ */ p("span", {
|
|
744
756
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
745
757
|
children: [
|
|
746
|
-
/* @__PURE__ */
|
|
758
|
+
/* @__PURE__ */ f(be, { className: "h-3.5 w-3.5" }),
|
|
747
759
|
" ",
|
|
748
760
|
C("healthybowl.crops.fieldDetail.weather.visibility", "Visibility")
|
|
749
761
|
]
|
|
750
|
-
}), /* @__PURE__ */
|
|
762
|
+
}), /* @__PURE__ */ p("span", {
|
|
751
763
|
className: "text-sm font-medium text-text-primary",
|
|
752
764
|
children: [Q.current.visibility, " km"]
|
|
753
765
|
})]
|
|
@@ -755,50 +767,50 @@ var x = (e) => {
|
|
|
755
767
|
]
|
|
756
768
|
})]
|
|
757
769
|
}),
|
|
758
|
-
/* @__PURE__ */
|
|
770
|
+
/* @__PURE__ */ p("div", {
|
|
759
771
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
760
|
-
children: [/* @__PURE__ */
|
|
772
|
+
children: [/* @__PURE__ */ f("h3", {
|
|
761
773
|
className: "mb-4 text-sm font-semibold text-text-primary",
|
|
762
774
|
children: C("healthybowl.crops.fieldDetail.quickActions.heading", "Quick Actions")
|
|
763
|
-
}), /* @__PURE__ */
|
|
775
|
+
}), /* @__PURE__ */ p("div", {
|
|
764
776
|
className: "space-y-2",
|
|
765
777
|
children: [
|
|
766
|
-
/* @__PURE__ */ m
|
|
778
|
+
/* @__PURE__ */ p(m, {
|
|
767
779
|
variant: "outline",
|
|
768
780
|
onClick: () => k(A("weather")),
|
|
769
781
|
className: "w-full justify-start",
|
|
770
782
|
children: [
|
|
771
|
-
/* @__PURE__ */
|
|
783
|
+
/* @__PURE__ */ f(Ce, { className: "h-4 w-4 text-text-secondary" }),
|
|
772
784
|
" ",
|
|
773
785
|
C("healthybowl.crops.fieldDetail.quickActions.weatherData", "Weather Data")
|
|
774
786
|
]
|
|
775
787
|
}),
|
|
776
|
-
/* @__PURE__ */ m
|
|
788
|
+
/* @__PURE__ */ p(m, {
|
|
777
789
|
variant: "outline",
|
|
778
790
|
onClick: () => k(A("soil-health")),
|
|
779
791
|
className: "w-full justify-start",
|
|
780
792
|
children: [
|
|
781
|
-
/* @__PURE__ */
|
|
793
|
+
/* @__PURE__ */ f(he, { className: "h-4 w-4 text-text-secondary" }),
|
|
782
794
|
" ",
|
|
783
795
|
C("healthybowl.crops.fieldDetail.quickActions.soilAnalysis", "Soil Analysis")
|
|
784
796
|
]
|
|
785
797
|
}),
|
|
786
|
-
/* @__PURE__ */ m
|
|
798
|
+
/* @__PURE__ */ p(m, {
|
|
787
799
|
variant: "outline",
|
|
788
800
|
onClick: () => k(A("crops")),
|
|
789
801
|
className: "w-full justify-start",
|
|
790
802
|
children: [
|
|
791
|
-
/* @__PURE__ */
|
|
803
|
+
/* @__PURE__ */ f(Ee, { className: "h-4 w-4 text-text-secondary" }),
|
|
792
804
|
" ",
|
|
793
805
|
C("healthybowl.crops.fieldDetail.quickActions.cropHistory", "Crop History")
|
|
794
806
|
]
|
|
795
807
|
}),
|
|
796
|
-
/* @__PURE__ */ m
|
|
808
|
+
/* @__PURE__ */ p(m, {
|
|
797
809
|
variant: "outline",
|
|
798
810
|
onClick: () => k(A("analytics")),
|
|
799
811
|
className: "w-full justify-start",
|
|
800
812
|
children: [
|
|
801
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ f(pe, { className: "h-4 w-4 text-text-secondary" }),
|
|
802
814
|
" ",
|
|
803
815
|
C("healthybowl.crops.fieldDetail.quickActions.generateReport", "Generate Report")
|
|
804
816
|
]
|
|
@@ -806,24 +818,24 @@ var x = (e) => {
|
|
|
806
818
|
]
|
|
807
819
|
})]
|
|
808
820
|
}),
|
|
809
|
-
/* @__PURE__ */
|
|
821
|
+
/* @__PURE__ */ p("div", {
|
|
810
822
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
811
|
-
children: [/* @__PURE__ */
|
|
823
|
+
children: [/* @__PURE__ */ f("h3", {
|
|
812
824
|
className: "mb-4 text-sm font-semibold text-text-primary",
|
|
813
825
|
children: C("healthybowl.crops.fieldDetail.recentActivity.heading", "Recent Activity")
|
|
814
|
-
}), /* @__PURE__ */
|
|
826
|
+
}), /* @__PURE__ */ f("div", {
|
|
815
827
|
className: "space-y-4",
|
|
816
|
-
children: $.map((t, n) => /* @__PURE__ */
|
|
828
|
+
children: $.map((t, n) => /* @__PURE__ */ p("div", {
|
|
817
829
|
className: "flex gap-3",
|
|
818
|
-
children: [/* @__PURE__ */
|
|
830
|
+
children: [/* @__PURE__ */ p("div", {
|
|
819
831
|
className: "relative flex flex-col items-center",
|
|
820
|
-
children: [/* @__PURE__ */
|
|
821
|
-
}), /* @__PURE__ */
|
|
832
|
+
children: [/* @__PURE__ */ f("div", { className: "h-2 w-2 rounded-full bg-action-primary-bg" }), n < $.length - 1 && /* @__PURE__ */ f("div", { className: "w-0.5 flex-1 bg-border" })]
|
|
833
|
+
}), /* @__PURE__ */ p("div", {
|
|
822
834
|
className: "pb-4",
|
|
823
|
-
children: [/* @__PURE__ */
|
|
835
|
+
children: [/* @__PURE__ */ f("p", {
|
|
824
836
|
className: "text-sm text-text-primary",
|
|
825
837
|
children: t.action
|
|
826
|
-
}), /* @__PURE__ */
|
|
838
|
+
}), /* @__PURE__ */ f("p", {
|
|
827
839
|
className: "text-xs text-text-secondary",
|
|
828
840
|
children: e(t.date)
|
|
829
841
|
})]
|
|
@@ -834,107 +846,107 @@ var x = (e) => {
|
|
|
834
846
|
]
|
|
835
847
|
})]
|
|
836
848
|
}),
|
|
837
|
-
/* @__PURE__ */
|
|
849
|
+
/* @__PURE__ */ f(ae, {
|
|
838
850
|
open: We,
|
|
839
851
|
onClose: () => M(!1),
|
|
840
852
|
title: C("healthybowl.crops.fieldDetail.editModal.title", "Edit Field"),
|
|
841
853
|
description: C("healthybowl.crops.fieldDetail.editModal.description", "Update details for {{name}}", { name: F.name }),
|
|
842
854
|
size: "lg",
|
|
843
|
-
footer: /* @__PURE__ */
|
|
855
|
+
footer: /* @__PURE__ */ p(Ae, { children: [/* @__PURE__ */ f(m, {
|
|
844
856
|
variant: "outline",
|
|
845
857
|
onClick: () => M(!1),
|
|
846
858
|
children: C("healthybowl.common.cancel", "Cancel")
|
|
847
|
-
}), /* @__PURE__ */
|
|
859
|
+
}), /* @__PURE__ */ f(m, {
|
|
848
860
|
onClick: ot,
|
|
849
861
|
disabled: N,
|
|
850
862
|
children: N ? C("healthybowl.crops.fieldDetail.editModal.saving", "Saving...") : C("healthybowl.crops.fieldDetail.editModal.saveChanges", "Save Changes")
|
|
851
863
|
})] }),
|
|
852
|
-
children: /* @__PURE__ */
|
|
864
|
+
children: /* @__PURE__ */ p("div", {
|
|
853
865
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
854
866
|
children: [
|
|
855
|
-
/* @__PURE__ */
|
|
867
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
856
868
|
className: "text-sm font-medium text-text-primary",
|
|
857
869
|
children: C("healthybowl.crops.fieldDetail.form.fieldName.label", "Field Name *")
|
|
858
|
-
}), /* @__PURE__ */
|
|
870
|
+
}), /* @__PURE__ */ f("input", {
|
|
859
871
|
type: "text",
|
|
860
872
|
value: I,
|
|
861
873
|
onChange: (e) => Ge(e.target.value),
|
|
862
874
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
863
875
|
})] }),
|
|
864
|
-
/* @__PURE__ */
|
|
876
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
865
877
|
className: "text-sm font-medium text-text-primary",
|
|
866
878
|
children: C("healthybowl.crops.fieldDetail.form.area.label", "Area *")
|
|
867
|
-
}), /* @__PURE__ */
|
|
879
|
+
}), /* @__PURE__ */ f("input", {
|
|
868
880
|
type: "number",
|
|
869
881
|
min: 0,
|
|
870
882
|
value: L,
|
|
871
883
|
onChange: (e) => Ke(e.target.value),
|
|
872
884
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
873
885
|
})] }),
|
|
874
|
-
/* @__PURE__ */
|
|
886
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
875
887
|
className: "text-sm font-medium text-text-primary",
|
|
876
888
|
children: C("healthybowl.crops.fieldDetail.form.unit.label", "Unit")
|
|
877
|
-
}), /* @__PURE__ */
|
|
889
|
+
}), /* @__PURE__ */ p(h, {
|
|
878
890
|
value: qe,
|
|
879
891
|
onValueChange: (e) => Je(e),
|
|
880
|
-
children: [/* @__PURE__ */
|
|
892
|
+
children: [/* @__PURE__ */ f(v, {
|
|
881
893
|
className: "mt-1 w-full",
|
|
882
|
-
children: /* @__PURE__ */
|
|
883
|
-
}), /* @__PURE__ */
|
|
894
|
+
children: /* @__PURE__ */ f(y, {})
|
|
895
|
+
}), /* @__PURE__ */ p(g, { children: [/* @__PURE__ */ f(_, {
|
|
884
896
|
value: "acres",
|
|
885
897
|
children: C("healthybowl.crops.fieldDetail.form.unit.options.acres", "Acres")
|
|
886
|
-
}), /* @__PURE__ */
|
|
898
|
+
}), /* @__PURE__ */ f(_, {
|
|
887
899
|
value: "hectares",
|
|
888
900
|
children: C("healthybowl.crops.fieldDetail.form.unit.options.hectares", "Hectares")
|
|
889
901
|
})] })]
|
|
890
902
|
})] }),
|
|
891
|
-
/* @__PURE__ */
|
|
903
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
892
904
|
className: "text-sm font-medium text-text-primary",
|
|
893
905
|
children: C("healthybowl.crops.fieldDetail.form.status.label", "Status")
|
|
894
|
-
}), /* @__PURE__ */
|
|
906
|
+
}), /* @__PURE__ */ p(h, {
|
|
895
907
|
value: $e,
|
|
896
908
|
onValueChange: et,
|
|
897
|
-
children: [/* @__PURE__ */
|
|
909
|
+
children: [/* @__PURE__ */ f(v, {
|
|
898
910
|
className: "mt-1 w-full",
|
|
899
|
-
children: /* @__PURE__ */
|
|
900
|
-
}), /* @__PURE__ */
|
|
901
|
-
/* @__PURE__ */
|
|
911
|
+
children: /* @__PURE__ */ f(y, {})
|
|
912
|
+
}), /* @__PURE__ */ p(g, { children: [
|
|
913
|
+
/* @__PURE__ */ f(_, {
|
|
902
914
|
value: "active",
|
|
903
915
|
children: C("healthybowl.crops.fieldDetail.form.status.options.active", "Active")
|
|
904
916
|
}),
|
|
905
|
-
/* @__PURE__ */
|
|
917
|
+
/* @__PURE__ */ f(_, {
|
|
906
918
|
value: "preparation",
|
|
907
919
|
children: C("healthybowl.crops.fieldDetail.form.status.options.preparation", "Preparation")
|
|
908
920
|
}),
|
|
909
|
-
/* @__PURE__ */
|
|
921
|
+
/* @__PURE__ */ f(_, {
|
|
910
922
|
value: "fallow",
|
|
911
923
|
children: C("healthybowl.crops.fieldDetail.form.status.options.fallow", "Fallow")
|
|
912
924
|
})
|
|
913
925
|
] })]
|
|
914
926
|
})] }),
|
|
915
|
-
/* @__PURE__ */
|
|
927
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
916
928
|
className: "text-sm font-medium text-text-primary",
|
|
917
929
|
children: C("healthybowl.crops.fieldDetail.form.soilType.label", "Soil Type")
|
|
918
|
-
}), /* @__PURE__ */
|
|
930
|
+
}), /* @__PURE__ */ f("input", {
|
|
919
931
|
type: "text",
|
|
920
932
|
value: Ye,
|
|
921
933
|
onChange: (e) => Xe(e.target.value),
|
|
922
934
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
923
935
|
})] }),
|
|
924
|
-
/* @__PURE__ */
|
|
936
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
925
937
|
className: "text-sm font-medium text-text-primary",
|
|
926
938
|
children: C("healthybowl.crops.fieldDetail.form.irrigationType.label", "Irrigation Type")
|
|
927
|
-
}), /* @__PURE__ */
|
|
939
|
+
}), /* @__PURE__ */ f("input", {
|
|
928
940
|
type: "text",
|
|
929
941
|
value: Ze,
|
|
930
942
|
onChange: (e) => Qe(e.target.value),
|
|
931
943
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
932
944
|
})] }),
|
|
933
|
-
/* @__PURE__ */
|
|
945
|
+
/* @__PURE__ */ f("div", {
|
|
934
946
|
className: "sm:col-span-2",
|
|
935
|
-
children: /* @__PURE__ */
|
|
947
|
+
children: /* @__PURE__ */ p("label", {
|
|
936
948
|
className: "flex cursor-pointer items-center gap-2 text-sm font-medium text-text-primary",
|
|
937
|
-
children: [/* @__PURE__ */
|
|
949
|
+
children: [/* @__PURE__ */ f("input", {
|
|
938
950
|
type: "checkbox",
|
|
939
951
|
checked: tt,
|
|
940
952
|
onChange: (e) => nt(e.target.checked),
|
|
@@ -945,46 +957,46 @@ var x = (e) => {
|
|
|
945
957
|
]
|
|
946
958
|
})
|
|
947
959
|
}),
|
|
948
|
-
/* @__PURE__ */
|
|
960
|
+
/* @__PURE__ */ f(te, {
|
|
949
961
|
toasts: He,
|
|
950
962
|
onDismiss: Ue
|
|
951
963
|
})
|
|
952
964
|
]
|
|
953
|
-
}) : /* @__PURE__ */
|
|
965
|
+
}) : /* @__PURE__ */ f(r, {
|
|
954
966
|
title: C("healthybowl.crops.fieldDetail.notFound.pageTitle", "Field Not Found"),
|
|
955
|
-
children: Re.crops ? /* @__PURE__ */
|
|
967
|
+
children: Re.crops ? /* @__PURE__ */ f(ie, {}) : Le.crops ? /* @__PURE__ */ f(ee, { onRetry: O }) : /* @__PURE__ */ f(a, {
|
|
956
968
|
title: C("healthybowl.crops.fieldDetail.notFound.title", "Field not found"),
|
|
957
969
|
description: C("healthybowl.crops.fieldDetail.notFound.description", "The field you are looking for does not exist."),
|
|
958
|
-
action: /* @__PURE__ */
|
|
970
|
+
action: /* @__PURE__ */ f(m, {
|
|
959
971
|
onClick: () => k(A("crops/fields")),
|
|
960
972
|
children: C("healthybowl.crops.fieldDetail.actions.backToFields", "Back to Fields")
|
|
961
973
|
})
|
|
962
974
|
})
|
|
963
975
|
});
|
|
964
|
-
}, w = ({ label: e, unit: t, value: n, min: r, step: i, onChange: a }) => /* @__PURE__ */
|
|
976
|
+
}, w = ({ label: e, unit: t, value: n, min: r, step: i, onChange: a }) => /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
965
977
|
className: "text-xs font-medium text-text-secondary",
|
|
966
978
|
children: e
|
|
967
|
-
}), /* @__PURE__ */
|
|
979
|
+
}), /* @__PURE__ */ p("div", {
|
|
968
980
|
className: "relative mt-1",
|
|
969
|
-
children: [/* @__PURE__ */
|
|
981
|
+
children: [/* @__PURE__ */ f("input", {
|
|
970
982
|
type: "number",
|
|
971
983
|
value: n,
|
|
972
984
|
min: r,
|
|
973
985
|
step: i,
|
|
974
986
|
onChange: (e) => a(e.target.value),
|
|
975
987
|
className: "h-10 w-full rounded-md border border-border-subtle bg-bg-surface px-3 pr-10 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
976
|
-
}), /* @__PURE__ */
|
|
988
|
+
}), /* @__PURE__ */ f("span", {
|
|
977
989
|
className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-xs text-text-secondary",
|
|
978
990
|
children: t
|
|
979
991
|
})]
|
|
980
|
-
})] }), T = ({ label: e, value: t, unit: n }) => /* @__PURE__ */
|
|
992
|
+
})] }), T = ({ label: e, value: t, unit: n }) => /* @__PURE__ */ p("div", {
|
|
981
993
|
className: "min-w-0 rounded-md border border-border-subtle bg-bg-sunken/60 p-3",
|
|
982
|
-
children: [/* @__PURE__ */
|
|
994
|
+
children: [/* @__PURE__ */ f("span", {
|
|
983
995
|
className: "block truncate text-xs text-text-secondary",
|
|
984
996
|
children: e
|
|
985
|
-
}), /* @__PURE__ */
|
|
997
|
+
}), /* @__PURE__ */ p("p", {
|
|
986
998
|
className: "mt-1 text-lg font-semibold text-text-primary",
|
|
987
|
-
children: [t, n && /* @__PURE__ */
|
|
999
|
+
children: [t, n && /* @__PURE__ */ f("span", {
|
|
988
1000
|
className: "ml-1 text-xs font-medium text-text-secondary",
|
|
989
1001
|
children: n
|
|
990
1002
|
})]
|