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