@burdenoff/microfe-healthybowl 2026.810.7 → 2026.810.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/healthybowl/pages/crops/CropDetailsPage.js +364 -346
- package/dist/healthybowl/pages/crops/CropDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js +243 -228
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/pest-management/AiPestDetectionPage.js +273 -272
- package/dist/healthybowl/pages/pest-management/AiPestDetectionPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,29 +8,29 @@ import { ToastContainer as ne } from "../../components/Toast.js";
|
|
|
8
8
|
import { useConfirm as re } from "../../components/ConfirmDialog.js";
|
|
9
9
|
import { Breadcrumbs as ie } from "../../components/Breadcrumbs.js";
|
|
10
10
|
import { PageLoader as ae } from "../../components/PageLoader.js";
|
|
11
|
-
import { Modal as
|
|
12
|
-
import { HBEntityTags as
|
|
13
|
-
import { HBEntityImages as
|
|
14
|
-
import { useToast as
|
|
15
|
-
import { CreateFarmTaskButton as
|
|
11
|
+
import { Modal as i } from "../../components/Modal.js";
|
|
12
|
+
import { HBEntityTags as a } from "../../components/HBEntityTags.js";
|
|
13
|
+
import { HBEntityImages as o } from "../../components/HBEntityImages.js";
|
|
14
|
+
import { useToast as oe } from "../../hooks/useToast.js";
|
|
15
|
+
import { CreateFarmTaskButton as se } from "../../components/CreateFarmTaskButton.js";
|
|
16
16
|
import "../../components/index.js";
|
|
17
|
-
import { useHealthyBowlData as
|
|
18
|
-
import { isNative as
|
|
19
|
-
import { useEffect as
|
|
20
|
-
import { useI18n as
|
|
21
|
-
import { AlertTriangle as
|
|
22
|
-
import { useNavigate as
|
|
23
|
-
import { Fragment as
|
|
24
|
-
import { Button as
|
|
17
|
+
import { useHealthyBowlData as ce } from "../../hooks/useHealthyBowlData.js";
|
|
18
|
+
import { isNative as le, nativeNotify as ue, nativeToast as de } from "../../../utils/nativeBridge.js";
|
|
19
|
+
import { useEffect as fe, useState as s } from "react";
|
|
20
|
+
import { useI18n as pe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
21
|
+
import { AlertTriangle as me, ArrowLeft as he, Calendar as c, Droplets as ge, Edit as l, Leaf as _e, MapPin as u, ScanSearch as ve, Sprout as d, Sun as ye, Trash2 as be, TrendingUp as f } from "lucide-react";
|
|
22
|
+
import { useNavigate as xe, useParams as Se } from "react-router";
|
|
23
|
+
import { Fragment as Ce, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
24
|
+
import { Button as h, GlassCard as we, Select as Te, SelectContent as Ee, SelectItem as g, SelectTrigger as De, SelectValue as Oe } from "@burdenoff/fe-libs/ui";
|
|
25
25
|
//#region src/healthybowl/pages/crops/CropDetailsPage.tsx
|
|
26
|
-
var
|
|
26
|
+
var _ = (e) => {
|
|
27
27
|
switch (e) {
|
|
28
28
|
case "excellent": return "success";
|
|
29
29
|
case "good": return "info";
|
|
30
30
|
case "fair": return "warning";
|
|
31
31
|
default: return "error";
|
|
32
32
|
}
|
|
33
|
-
},
|
|
33
|
+
}, v = (e) => {
|
|
34
34
|
switch (e) {
|
|
35
35
|
case "harvest_ready": return "success";
|
|
36
36
|
case "growing":
|
|
@@ -38,367 +38,385 @@ var v = (e) => {
|
|
|
38
38
|
case "planted": return "muted";
|
|
39
39
|
default: return "default";
|
|
40
40
|
}
|
|
41
|
-
},
|
|
41
|
+
}, y = [
|
|
42
42
|
"Seedling",
|
|
43
43
|
"Vegetative",
|
|
44
44
|
"Flowering",
|
|
45
45
|
"Fruiting",
|
|
46
46
|
"Mature"
|
|
47
|
-
],
|
|
48
|
-
let { t:
|
|
49
|
-
Seedling:
|
|
50
|
-
Vegetative:
|
|
51
|
-
Flowering:
|
|
52
|
-
Fruiting:
|
|
53
|
-
Mature:
|
|
54
|
-
}, { cropId:
|
|
55
|
-
|
|
56
|
-
let e =
|
|
57
|
-
e &&
|
|
58
|
-
}, [
|
|
59
|
-
let [
|
|
60
|
-
|
|
47
|
+
], b = () => {
|
|
48
|
+
let { t: b } = pe(), x = re(), { crops: S, fields: C, errors: w, loadings: T, updateCrop: ke, deleteCrop: Ae, refetch: je } = ce(), Me = {
|
|
49
|
+
Seedling: b("healthybowl.crops.detail.stages.seedling", "Seedling"),
|
|
50
|
+
Vegetative: b("healthybowl.crops.detail.stages.vegetative", "Vegetative"),
|
|
51
|
+
Flowering: b("healthybowl.crops.detail.stages.flowering", "Flowering"),
|
|
52
|
+
Fruiting: b("healthybowl.crops.detail.stages.fruiting", "Fruiting"),
|
|
53
|
+
Mature: b("healthybowl.crops.detail.stages.mature", "Mature")
|
|
54
|
+
}, { cropId: E } = Se(), D = xe(), { buildPath: O } = t(), { toasts: Ne, toast: k, dismiss: Pe } = oe(), [A, j] = s(!1), [M, N] = s(!1), [P, Fe] = s(() => S.find((e) => e.id === E));
|
|
55
|
+
fe(() => {
|
|
56
|
+
let e = S.find((e) => e.id === E);
|
|
57
|
+
e && Fe(e);
|
|
58
|
+
}, [S, E]);
|
|
59
|
+
let [F, I] = s(""), [L, R] = s(""), [z, B] = s(""), [V, H] = s(""), [U, W] = s(""), [G, K] = s("good"), [q, J] = s([]), Y = () => {
|
|
60
|
+
P && (I(P.name), R(P.variety), B(P.category), H(String(P.yieldEstimate)), W(P.expectedHarvestDate), K(P.healthStatus), J(P.imageIds ?? []), j(!0));
|
|
61
61
|
};
|
|
62
|
-
if (!
|
|
63
|
-
title:
|
|
64
|
-
children:
|
|
65
|
-
title:
|
|
66
|
-
description:
|
|
67
|
-
action: /* @__PURE__ */
|
|
68
|
-
onClick: () =>
|
|
69
|
-
children:
|
|
62
|
+
if (!P) return /* @__PURE__ */ p(n, {
|
|
63
|
+
title: b("healthybowl.crops.detail.notFound.pageTitle", "Crop Not Found"),
|
|
64
|
+
children: T.crops ? /* @__PURE__ */ p(ae, {}) : w.crops ? /* @__PURE__ */ p(te, { onRetry: je }) : /* @__PURE__ */ p(ee, {
|
|
65
|
+
title: b("healthybowl.crops.detail.notFound.title", "Crop not found"),
|
|
66
|
+
description: b("healthybowl.crops.detail.notFound.description", "The crop you are looking for does not exist."),
|
|
67
|
+
action: /* @__PURE__ */ p(h, {
|
|
68
|
+
onClick: () => D(O("crops")),
|
|
69
|
+
children: b("healthybowl.crops.detail.actions.backToCrops", "Back to Crops")
|
|
70
70
|
})
|
|
71
71
|
})
|
|
72
72
|
});
|
|
73
|
-
let
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
let X = C.find((e) => e.id === P.field || e.name === P.fieldName), Z = (() => {
|
|
74
|
+
let e = new URLSearchParams({ cropId: P.id });
|
|
75
|
+
return X?.id && e.set("fieldId", X.id), `${O("pest-management/ai-detection")}?${e.toString()}`;
|
|
76
|
+
})(), Q = y.indexOf(P.growthStage), $ = P.daysToHarvest, Ie = X ? Math.round(P.yieldEstimate / X.area) : P.yieldEstimate;
|
|
77
|
+
return P ? /* @__PURE__ */ m(n, {
|
|
78
|
+
title: P.name,
|
|
79
|
+
description: b("healthybowl.crops.detail.headerSubtitle", "{{variety}} - {{category}}", {
|
|
80
|
+
variety: P.variety,
|
|
81
|
+
category: P.category
|
|
79
82
|
}),
|
|
80
|
-
actions: /* @__PURE__ */
|
|
83
|
+
actions: /* @__PURE__ */ m("div", {
|
|
81
84
|
className: "flex items-center gap-2",
|
|
82
85
|
children: [
|
|
83
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ p(se, {
|
|
84
87
|
entityType: "CROP",
|
|
85
|
-
entityId:
|
|
86
|
-
entityLabel:
|
|
88
|
+
entityId: P.id,
|
|
89
|
+
entityLabel: P.name
|
|
87
90
|
}),
|
|
88
|
-
/* @__PURE__ */ h
|
|
91
|
+
/* @__PURE__ */ m(h, {
|
|
89
92
|
variant: "outline",
|
|
90
|
-
onClick:
|
|
93
|
+
onClick: () => D(Z),
|
|
91
94
|
children: [
|
|
92
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ p(ve, { className: "h-4 w-4" }),
|
|
93
96
|
" ",
|
|
94
|
-
|
|
97
|
+
b("healthybowl.crops.detail.actions.diagnose", "Diagnose")
|
|
95
98
|
]
|
|
96
99
|
}),
|
|
97
|
-
/* @__PURE__ */ h
|
|
100
|
+
/* @__PURE__ */ m(h, {
|
|
101
|
+
variant: "outline",
|
|
102
|
+
onClick: Y,
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ p(l, { className: "h-4 w-4" }),
|
|
105
|
+
" ",
|
|
106
|
+
b("healthybowl.common.edit", "Edit")
|
|
107
|
+
]
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ m(h, {
|
|
98
110
|
variant: "destructive",
|
|
99
111
|
onClick: async () => {
|
|
100
|
-
if (
|
|
101
|
-
title:
|
|
102
|
-
message:
|
|
103
|
-
okButtonTitle:
|
|
104
|
-
cancelButtonTitle:
|
|
112
|
+
if (P && await x({
|
|
113
|
+
title: b("healthybowl.crops.detail.delete.confirmTitle", "Delete crop?"),
|
|
114
|
+
message: b("healthybowl.crops.detail.delete.confirmMessage", "{{name}} will be permanently removed.", { name: P.name }),
|
|
115
|
+
okButtonTitle: b("healthybowl.common.delete", "Delete"),
|
|
116
|
+
cancelButtonTitle: b("healthybowl.common.cancel", "Cancel")
|
|
105
117
|
}) !== !1) {
|
|
106
|
-
|
|
118
|
+
N(!0);
|
|
107
119
|
try {
|
|
108
|
-
await
|
|
109
|
-
title:
|
|
110
|
-
description:
|
|
120
|
+
await Ae(P.id), k({
|
|
121
|
+
title: b("healthybowl.crops.detail.toast.deleted.title", "Crop deleted"),
|
|
122
|
+
description: b("healthybowl.crops.detail.toast.deleted.description", "{{name}} has been removed.", { name: P.name }),
|
|
111
123
|
variant: "success"
|
|
112
|
-
}),
|
|
124
|
+
}), le() && (de(b("healthybowl.crops.detail.toast.deleted.title", "Crop deleted")), ue("success")), D(O("crops"));
|
|
113
125
|
} catch (e) {
|
|
114
|
-
|
|
115
|
-
title:
|
|
126
|
+
k({
|
|
127
|
+
title: b("healthybowl.crops.detail.toast.deleteFailed.title", "Delete failed"),
|
|
116
128
|
description: String(e),
|
|
117
129
|
variant: "error"
|
|
118
|
-
}),
|
|
130
|
+
}), N(!1);
|
|
119
131
|
}
|
|
120
132
|
}
|
|
121
133
|
},
|
|
122
|
-
disabled:
|
|
134
|
+
disabled: M,
|
|
123
135
|
children: [
|
|
124
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ p(be, { className: "h-4 w-4" }),
|
|
125
137
|
" ",
|
|
126
|
-
|
|
138
|
+
b("healthybowl.common.delete", "Delete")
|
|
127
139
|
]
|
|
128
140
|
}),
|
|
129
|
-
/* @__PURE__ */ h
|
|
141
|
+
/* @__PURE__ */ m(h, {
|
|
130
142
|
variant: "outline",
|
|
131
|
-
onClick: () =>
|
|
143
|
+
onClick: () => D(O("crops")),
|
|
132
144
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ p(he, { className: "h-4 w-4" }),
|
|
134
146
|
" ",
|
|
135
|
-
|
|
147
|
+
b("healthybowl.common.back", "Back")
|
|
136
148
|
]
|
|
137
149
|
})
|
|
138
150
|
]
|
|
139
151
|
}),
|
|
140
152
|
purpose: "Everything about one crop in your fields — its variety, health, growth progress and the field it's planted in. Use this page to keep its details current and record what happens as it grows toward harvest.",
|
|
141
153
|
nextSteps: [
|
|
154
|
+
{
|
|
155
|
+
id: "diagnose",
|
|
156
|
+
label: b("healthybowl.crops.detail.nextSteps.diagnose.label", "Diagnose this crop"),
|
|
157
|
+
description: b("healthybowl.crops.detail.nextSteps.diagnose.desc", "Upload a plant photo and check for pest or disease symptoms."),
|
|
158
|
+
href: Z
|
|
159
|
+
},
|
|
142
160
|
{
|
|
143
161
|
id: "edit",
|
|
144
|
-
label:
|
|
145
|
-
description:
|
|
146
|
-
onClick:
|
|
162
|
+
label: b("healthybowl.crops.detail.nextSteps.edit.label", "Update this crop"),
|
|
163
|
+
description: b("healthybowl.crops.detail.nextSteps.edit.desc", "Keep its status, health and details accurate as it grows."),
|
|
164
|
+
onClick: Y
|
|
147
165
|
},
|
|
148
166
|
{
|
|
149
167
|
id: "fields",
|
|
150
|
-
label:
|
|
151
|
-
description:
|
|
152
|
-
href:
|
|
168
|
+
label: b("healthybowl.crops.detail.nextSteps.fields.label", "Check the field it grows in"),
|
|
169
|
+
description: b("healthybowl.crops.detail.nextSteps.fields.desc", "Review soil, irrigation and conditions for this crop’s field."),
|
|
170
|
+
href: O("crops/fields")
|
|
153
171
|
},
|
|
154
172
|
{
|
|
155
173
|
id: "harvest",
|
|
156
|
-
label:
|
|
157
|
-
description:
|
|
158
|
-
href:
|
|
174
|
+
label: b("healthybowl.crops.detail.nextSteps.harvest.label", "Record a harvest"),
|
|
175
|
+
description: b("healthybowl.crops.detail.nextSteps.harvest.desc", "Log yield and quality once this crop is ready to pick."),
|
|
176
|
+
href: O("crops/harvest")
|
|
159
177
|
}
|
|
160
178
|
],
|
|
161
179
|
nextStepsKey: "healthybowl-crop-detail",
|
|
162
180
|
children: [
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
label:
|
|
165
|
-
href:
|
|
166
|
-
}, { label:
|
|
167
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ p(ie, { items: [{
|
|
182
|
+
label: b("healthybowl.crops.detail.breadcrumb.crops", "Crops"),
|
|
183
|
+
href: O("crops")
|
|
184
|
+
}, { label: P.name }] }),
|
|
185
|
+
/* @__PURE__ */ m("div", {
|
|
168
186
|
className: "flex flex-wrap items-center gap-3",
|
|
169
187
|
children: [
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
label: (
|
|
172
|
-
variant:
|
|
188
|
+
/* @__PURE__ */ p(r, {
|
|
189
|
+
label: (P.status ?? "unknown").replace("_", " "),
|
|
190
|
+
variant: v(P.status ?? "unknown"),
|
|
173
191
|
dot: !0
|
|
174
192
|
}),
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
label:
|
|
177
|
-
variant:
|
|
193
|
+
/* @__PURE__ */ p(r, {
|
|
194
|
+
label: P.healthStatus,
|
|
195
|
+
variant: _(P.healthStatus),
|
|
178
196
|
dot: !0
|
|
179
197
|
}),
|
|
180
|
-
|
|
181
|
-
label:
|
|
198
|
+
P.organicCertified && /* @__PURE__ */ p(r, {
|
|
199
|
+
label: b("healthybowl.crops.detail.badge.organicCertified", "Organic Certified"),
|
|
182
200
|
variant: "success"
|
|
183
201
|
}),
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
label:
|
|
202
|
+
/* @__PURE__ */ p(r, {
|
|
203
|
+
label: P.season,
|
|
186
204
|
variant: "muted"
|
|
187
205
|
})
|
|
188
206
|
]
|
|
189
207
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ p(a, {
|
|
191
209
|
entityType: "CROP",
|
|
192
|
-
entityId:
|
|
193
|
-
tags:
|
|
210
|
+
entityId: P.id,
|
|
211
|
+
tags: P.entityTags ?? [],
|
|
194
212
|
className: "mt-1"
|
|
195
213
|
}),
|
|
196
|
-
(
|
|
214
|
+
(P.imageIds ?? []).length > 0 && /* @__PURE__ */ p(o, {
|
|
197
215
|
entity: "Crop",
|
|
198
|
-
imageIds:
|
|
216
|
+
imageIds: P.imageIds ?? [],
|
|
199
217
|
onChange: () => {},
|
|
200
218
|
readOnly: !0,
|
|
201
219
|
className: "mt-1"
|
|
202
220
|
}),
|
|
203
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ m("div", {
|
|
204
222
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
205
|
-
children: [/* @__PURE__ */
|
|
223
|
+
children: [/* @__PURE__ */ m("div", {
|
|
206
224
|
className: "space-y-6 lg:col-span-2",
|
|
207
225
|
children: [
|
|
208
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ m(we, {
|
|
209
227
|
treatment: "glass",
|
|
210
228
|
glow: !0,
|
|
211
229
|
className: "border-border-seam p-6",
|
|
212
|
-
children: [/* @__PURE__ */
|
|
230
|
+
children: [/* @__PURE__ */ m("h3", {
|
|
213
231
|
className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
214
232
|
children: [
|
|
215
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ p(ye, { className: "h-4 w-4 text-warning" }),
|
|
216
234
|
" ",
|
|
217
|
-
|
|
235
|
+
b("healthybowl.crops.detail.overview.title", "Crop Overview")
|
|
218
236
|
]
|
|
219
|
-
}), /* @__PURE__ */
|
|
237
|
+
}), /* @__PURE__ */ p("div", {
|
|
220
238
|
className: "grid grid-cols-2 gap-4 md:grid-cols-4",
|
|
221
239
|
children: [
|
|
222
240
|
{
|
|
223
241
|
key: "category",
|
|
224
|
-
icon:
|
|
225
|
-
label:
|
|
226
|
-
value:
|
|
242
|
+
icon: d,
|
|
243
|
+
label: b("healthybowl.crops.detail.overview.category", "Category"),
|
|
244
|
+
value: P.category
|
|
227
245
|
},
|
|
228
246
|
{
|
|
229
247
|
key: "season",
|
|
230
|
-
icon:
|
|
231
|
-
label:
|
|
232
|
-
value:
|
|
248
|
+
icon: c,
|
|
249
|
+
label: b("healthybowl.crops.detail.overview.season", "Season"),
|
|
250
|
+
value: P.season
|
|
233
251
|
},
|
|
234
252
|
{
|
|
235
253
|
key: "growthStage",
|
|
236
|
-
icon:
|
|
237
|
-
label:
|
|
238
|
-
value:
|
|
254
|
+
icon: _e,
|
|
255
|
+
label: b("healthybowl.crops.detail.overview.growthStage", "Growth Stage"),
|
|
256
|
+
value: P.growthStage
|
|
239
257
|
},
|
|
240
258
|
{
|
|
241
259
|
key: "field",
|
|
242
|
-
icon:
|
|
243
|
-
label:
|
|
244
|
-
value:
|
|
260
|
+
icon: u,
|
|
261
|
+
label: b("healthybowl.crops.detail.overview.field", "Field"),
|
|
262
|
+
value: P.fieldName
|
|
245
263
|
}
|
|
246
|
-
].map(({ key: e, icon: t, label: n, value: r }) => /* @__PURE__ */
|
|
264
|
+
].map(({ key: e, icon: t, label: n, value: r }) => /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("div", {
|
|
247
265
|
className: "flex items-center gap-1 text-text-secondary",
|
|
248
|
-
children: [/* @__PURE__ */
|
|
266
|
+
children: [/* @__PURE__ */ p(t, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ p("span", {
|
|
249
267
|
className: "text-xs",
|
|
250
268
|
children: n
|
|
251
269
|
})]
|
|
252
|
-
}), /* @__PURE__ */
|
|
270
|
+
}), /* @__PURE__ */ p("p", {
|
|
253
271
|
className: "mt-1 text-sm font-semibold capitalize text-text-primary",
|
|
254
272
|
children: r
|
|
255
273
|
})] }, e))
|
|
256
274
|
})]
|
|
257
275
|
}),
|
|
258
|
-
|
|
276
|
+
X && /* @__PURE__ */ m("div", {
|
|
259
277
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
260
|
-
children: [/* @__PURE__ */
|
|
278
|
+
children: [/* @__PURE__ */ m("h3", {
|
|
261
279
|
className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
262
280
|
children: [
|
|
263
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ p(u, { className: "h-4 w-4 text-success" }),
|
|
264
282
|
" ",
|
|
265
|
-
|
|
283
|
+
b("healthybowl.crops.detail.fieldDetails.title", "Field Details")
|
|
266
284
|
]
|
|
267
|
-
}), /* @__PURE__ */
|
|
285
|
+
}), /* @__PURE__ */ m("div", {
|
|
268
286
|
className: "grid grid-cols-2 gap-4 md:grid-cols-4",
|
|
269
287
|
children: [
|
|
270
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
|
|
271
289
|
className: "text-xs text-text-secondary",
|
|
272
|
-
children:
|
|
273
|
-
}), /* @__PURE__ */
|
|
290
|
+
children: b("healthybowl.crops.detail.fieldDetails.field", "Field")
|
|
291
|
+
}), /* @__PURE__ */ p("p", {
|
|
274
292
|
className: "text-sm font-semibold text-text-primary",
|
|
275
|
-
children:
|
|
293
|
+
children: X.name
|
|
276
294
|
})] }),
|
|
277
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
|
|
278
296
|
className: "text-xs text-text-secondary",
|
|
279
|
-
children:
|
|
280
|
-
}), /* @__PURE__ */
|
|
297
|
+
children: b("healthybowl.crops.detail.fieldDetails.area", "Area")
|
|
298
|
+
}), /* @__PURE__ */ m("p", {
|
|
281
299
|
className: "text-sm font-semibold text-text-primary",
|
|
282
300
|
children: [
|
|
283
|
-
|
|
301
|
+
X.area,
|
|
284
302
|
" ",
|
|
285
|
-
|
|
303
|
+
X.unit
|
|
286
304
|
]
|
|
287
305
|
})] }),
|
|
288
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
|
|
289
307
|
className: "text-xs text-text-secondary",
|
|
290
|
-
children:
|
|
291
|
-
}), /* @__PURE__ */
|
|
308
|
+
children: b("healthybowl.crops.detail.fieldDetails.soilType", "Soil Type")
|
|
309
|
+
}), /* @__PURE__ */ p("p", {
|
|
292
310
|
className: "text-sm font-semibold text-text-primary",
|
|
293
|
-
children:
|
|
311
|
+
children: X.soilType
|
|
294
312
|
})] }),
|
|
295
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
|
|
296
314
|
className: "text-xs text-text-secondary",
|
|
297
|
-
children:
|
|
298
|
-
}), /* @__PURE__ */
|
|
315
|
+
children: b("healthybowl.crops.detail.fieldDetails.irrigation", "Irrigation")
|
|
316
|
+
}), /* @__PURE__ */ p("p", {
|
|
299
317
|
className: "text-sm font-semibold text-text-primary",
|
|
300
|
-
children:
|
|
318
|
+
children: X.irrigationType
|
|
301
319
|
})] })
|
|
302
320
|
]
|
|
303
321
|
})]
|
|
304
322
|
}),
|
|
305
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ m("div", {
|
|
306
324
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
307
325
|
children: [
|
|
308
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ m("h3", {
|
|
309
327
|
className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
310
328
|
children: [
|
|
311
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ p(c, { className: "h-4 w-4 text-info" }),
|
|
312
330
|
" ",
|
|
313
|
-
|
|
331
|
+
b("healthybowl.crops.detail.timeline.title", "Timeline")
|
|
314
332
|
]
|
|
315
333
|
}),
|
|
316
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ m("div", {
|
|
317
335
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
318
|
-
children: [/* @__PURE__ */
|
|
336
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
|
|
319
337
|
className: "text-xs text-text-secondary",
|
|
320
|
-
children:
|
|
321
|
-
}), /* @__PURE__ */
|
|
338
|
+
children: b("healthybowl.crops.detail.timeline.plantedOn", "Planted On")
|
|
339
|
+
}), /* @__PURE__ */ p("p", {
|
|
322
340
|
className: "text-sm font-semibold text-text-primary",
|
|
323
|
-
children: e(
|
|
324
|
-
})] }), /* @__PURE__ */
|
|
341
|
+
children: e(P.plantingDate)
|
|
342
|
+
})] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
|
|
325
343
|
className: "text-xs text-text-secondary",
|
|
326
|
-
children:
|
|
327
|
-
}), /* @__PURE__ */
|
|
344
|
+
children: b("healthybowl.crops.detail.timeline.expectedHarvest", "Expected Harvest")
|
|
345
|
+
}), /* @__PURE__ */ p("p", {
|
|
328
346
|
className: "text-sm font-semibold text-text-primary",
|
|
329
|
-
children: e(
|
|
347
|
+
children: e(P.expectedHarvestDate)
|
|
330
348
|
})] })]
|
|
331
349
|
}),
|
|
332
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ p("div", {
|
|
333
351
|
className: "mt-4",
|
|
334
|
-
children: $ > 0 ? /* @__PURE__ */
|
|
352
|
+
children: $ > 0 ? /* @__PURE__ */ p("div", {
|
|
335
353
|
className: "rounded-lg bg-info/10 p-3",
|
|
336
|
-
children: /* @__PURE__ */
|
|
354
|
+
children: /* @__PURE__ */ m("p", {
|
|
337
355
|
className: "text-sm text-info",
|
|
338
356
|
children: [
|
|
339
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ p("span", {
|
|
340
358
|
className: "font-bold",
|
|
341
|
-
children:
|
|
359
|
+
children: b("healthybowl.crops.detail.timeline.daysCount", "{{count}} days", { count: $ })
|
|
342
360
|
}),
|
|
343
361
|
" ",
|
|
344
|
-
|
|
362
|
+
b("healthybowl.crops.detail.timeline.untilHarvest", "until expected harvest")
|
|
345
363
|
]
|
|
346
364
|
})
|
|
347
|
-
}) : /* @__PURE__ */
|
|
365
|
+
}) : /* @__PURE__ */ p("div", {
|
|
348
366
|
className: "rounded-lg bg-success-subtle p-3",
|
|
349
|
-
children: /* @__PURE__ */
|
|
367
|
+
children: /* @__PURE__ */ p("p", {
|
|
350
368
|
className: "text-sm font-bold text-success",
|
|
351
|
-
children:
|
|
369
|
+
children: b("healthybowl.crops.detail.timeline.readyForHarvest", "Ready for harvest!")
|
|
352
370
|
})
|
|
353
371
|
})
|
|
354
372
|
})
|
|
355
373
|
]
|
|
356
374
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ m("div", {
|
|
358
376
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
359
377
|
children: [
|
|
360
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ m("div", {
|
|
361
379
|
className: "flex items-center justify-between",
|
|
362
|
-
children: [/* @__PURE__ */
|
|
380
|
+
children: [/* @__PURE__ */ p("h3", {
|
|
363
381
|
className: "text-sm font-semibold text-text-primary",
|
|
364
|
-
children:
|
|
365
|
-
}), /* @__PURE__ */
|
|
382
|
+
children: b("healthybowl.crops.detail.growthProgress.title", "Growth Progress")
|
|
383
|
+
}), /* @__PURE__ */ m("span", {
|
|
366
384
|
className: "text-lg font-bold text-text-primary",
|
|
367
|
-
children: [
|
|
385
|
+
children: [P.progress, "%"]
|
|
368
386
|
})]
|
|
369
387
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ p("div", {
|
|
371
389
|
className: "mt-3 h-4 rounded-full bg-bg-sunken",
|
|
372
|
-
children: /* @__PURE__ */
|
|
390
|
+
children: /* @__PURE__ */ p("div", {
|
|
373
391
|
className: "h-4 rounded-full bg-action-primary-bg transition-all",
|
|
374
|
-
style: { width: `${
|
|
392
|
+
style: { width: `${P.progress}%` }
|
|
375
393
|
})
|
|
376
394
|
}),
|
|
377
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ m("div", {
|
|
378
396
|
className: "mt-6",
|
|
379
|
-
children: [/* @__PURE__ */
|
|
397
|
+
children: [/* @__PURE__ */ p("h4", {
|
|
380
398
|
className: "mb-3 text-xs font-medium text-text-secondary",
|
|
381
|
-
children:
|
|
382
|
-
}), /* @__PURE__ */
|
|
399
|
+
children: b("healthybowl.crops.detail.growthProgress.stageLabel", "Growth Stage")
|
|
400
|
+
}), /* @__PURE__ */ p("div", {
|
|
383
401
|
className: "flex items-center",
|
|
384
|
-
children:
|
|
402
|
+
children: y.map((e, t) => /* @__PURE__ */ m("div", {
|
|
385
403
|
className: "flex flex-1 flex-col items-center gap-1.5",
|
|
386
|
-
children: [/* @__PURE__ */
|
|
404
|
+
children: [/* @__PURE__ */ m("div", {
|
|
387
405
|
className: "flex w-full items-center",
|
|
388
406
|
children: [
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ p("div", { className: `h-0.5 flex-1 ${t === 0 ? "bg-transparent" : t <= Q ? "bg-action-primary-bg" : "bg-bg-sunken"}` }),
|
|
408
|
+
/* @__PURE__ */ p("div", {
|
|
391
409
|
className: `h-4 w-4 shrink-0 rounded-full border-2 ${t <= Q ? "border-primary bg-action-primary-bg" : "border-muted bg-bg-surface"}`,
|
|
392
|
-
children: t <= Q && /* @__PURE__ */
|
|
410
|
+
children: t <= Q && /* @__PURE__ */ p("div", {
|
|
393
411
|
className: "flex h-full items-center justify-center",
|
|
394
|
-
children: /* @__PURE__ */
|
|
412
|
+
children: /* @__PURE__ */ p("div", { className: "h-1.5 w-1.5 rounded-full bg-primary-foreground" })
|
|
395
413
|
})
|
|
396
414
|
}),
|
|
397
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ p("div", { className: `h-0.5 flex-1 ${t === y.length - 1 ? "bg-transparent" : t < Q ? "bg-action-primary-bg" : "bg-bg-sunken"}` })
|
|
398
416
|
]
|
|
399
|
-
}), /* @__PURE__ */
|
|
417
|
+
}), /* @__PURE__ */ p("span", {
|
|
400
418
|
className: `text-center text-xs ${t <= Q ? "font-medium text-text-primary" : "text-text-secondary"}`,
|
|
401
|
-
children:
|
|
419
|
+
children: Me[e] ?? e
|
|
402
420
|
})]
|
|
403
421
|
}, e))
|
|
404
422
|
})]
|
|
@@ -406,140 +424,140 @@ var v = (e) => {
|
|
|
406
424
|
]
|
|
407
425
|
})
|
|
408
426
|
]
|
|
409
|
-
}), /* @__PURE__ */
|
|
427
|
+
}), /* @__PURE__ */ m("div", {
|
|
410
428
|
className: "space-y-6",
|
|
411
429
|
children: [
|
|
412
|
-
/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */ m("div", {
|
|
413
431
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
414
432
|
children: [
|
|
415
|
-
/* @__PURE__ */
|
|
433
|
+
/* @__PURE__ */ p("h3", {
|
|
416
434
|
className: "mb-4 text-sm font-semibold text-text-primary",
|
|
417
|
-
children:
|
|
435
|
+
children: b("healthybowl.crops.detail.currentStatus.title", "Current Status")
|
|
418
436
|
}),
|
|
419
|
-
/* @__PURE__ */
|
|
437
|
+
/* @__PURE__ */ m("div", {
|
|
420
438
|
className: "space-y-3",
|
|
421
439
|
children: [
|
|
422
|
-
/* @__PURE__ */
|
|
440
|
+
/* @__PURE__ */ m("div", {
|
|
423
441
|
className: "flex items-center justify-between",
|
|
424
|
-
children: [/* @__PURE__ */
|
|
442
|
+
children: [/* @__PURE__ */ p("span", {
|
|
425
443
|
className: "text-xs text-text-secondary",
|
|
426
|
-
children:
|
|
427
|
-
}), /* @__PURE__ */
|
|
428
|
-
label:
|
|
429
|
-
variant:
|
|
444
|
+
children: b("healthybowl.crops.detail.currentStatus.health", "Health")
|
|
445
|
+
}), /* @__PURE__ */ p(r, {
|
|
446
|
+
label: P.healthStatus,
|
|
447
|
+
variant: _(P.healthStatus)
|
|
430
448
|
})]
|
|
431
449
|
}),
|
|
432
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ m("div", {
|
|
433
451
|
className: "flex items-center justify-between",
|
|
434
|
-
children: [/* @__PURE__ */
|
|
452
|
+
children: [/* @__PURE__ */ p("span", {
|
|
435
453
|
className: "text-xs text-text-secondary",
|
|
436
|
-
children:
|
|
437
|
-
}), /* @__PURE__ */
|
|
454
|
+
children: b("healthybowl.crops.detail.currentStatus.growthStage", "Growth Stage")
|
|
455
|
+
}), /* @__PURE__ */ p("span", {
|
|
438
456
|
className: "text-xs font-medium text-text-primary",
|
|
439
|
-
children:
|
|
457
|
+
children: P.growthStage
|
|
440
458
|
})]
|
|
441
459
|
}),
|
|
442
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ m("div", {
|
|
443
461
|
className: "flex items-center justify-between",
|
|
444
|
-
children: [/* @__PURE__ */
|
|
462
|
+
children: [/* @__PURE__ */ p("span", {
|
|
445
463
|
className: "text-xs text-text-secondary",
|
|
446
|
-
children:
|
|
447
|
-
}), /* @__PURE__ */
|
|
464
|
+
children: b("healthybowl.crops.detail.currentStatus.organic", "Organic")
|
|
465
|
+
}), /* @__PURE__ */ p("span", {
|
|
448
466
|
className: "text-xs font-medium text-text-primary",
|
|
449
|
-
children:
|
|
467
|
+
children: P.organicCertified ? b("healthybowl.common.yes", "Yes") : b("healthybowl.common.no", "No")
|
|
450
468
|
})]
|
|
451
469
|
})
|
|
452
470
|
]
|
|
453
471
|
}),
|
|
454
|
-
|
|
472
|
+
P.healthStatus === "fair" && /* @__PURE__ */ p("div", {
|
|
455
473
|
className: "mt-3 rounded-lg bg-warning/10 p-3",
|
|
456
|
-
children: /* @__PURE__ */
|
|
474
|
+
children: /* @__PURE__ */ m("div", {
|
|
457
475
|
className: "flex items-start gap-2",
|
|
458
|
-
children: [/* @__PURE__ */
|
|
476
|
+
children: [/* @__PURE__ */ p(me, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-warning" }), /* @__PURE__ */ p("p", {
|
|
459
477
|
className: "text-xs text-warning",
|
|
460
|
-
children:
|
|
478
|
+
children: b("healthybowl.crops.detail.currentStatus.attentionWarning", "This crop needs attention. Check for potential issues.")
|
|
461
479
|
})]
|
|
462
480
|
})
|
|
463
481
|
})
|
|
464
482
|
]
|
|
465
483
|
}),
|
|
466
|
-
/* @__PURE__ */
|
|
484
|
+
/* @__PURE__ */ m("div", {
|
|
467
485
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
468
|
-
children: [/* @__PURE__ */
|
|
486
|
+
children: [/* @__PURE__ */ m("h3", {
|
|
469
487
|
className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
470
488
|
children: [
|
|
471
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ p(f, { className: "h-4 w-4 text-success" }),
|
|
472
490
|
" ",
|
|
473
|
-
|
|
491
|
+
b("healthybowl.crops.detail.yield.title", "Yield Estimation")
|
|
474
492
|
]
|
|
475
|
-
}), /* @__PURE__ */
|
|
493
|
+
}), /* @__PURE__ */ m("div", {
|
|
476
494
|
className: "text-center",
|
|
477
495
|
children: [
|
|
478
|
-
/* @__PURE__ */
|
|
496
|
+
/* @__PURE__ */ p("p", {
|
|
479
497
|
className: "text-3xl font-bold text-success",
|
|
480
|
-
children: (
|
|
498
|
+
children: (P.yieldEstimate ?? 0).toLocaleString()
|
|
481
499
|
}),
|
|
482
|
-
/* @__PURE__ */
|
|
500
|
+
/* @__PURE__ */ p("p", {
|
|
483
501
|
className: "text-xs text-text-secondary",
|
|
484
|
-
children:
|
|
502
|
+
children: b("healthybowl.crops.detail.yield.expected", "{{unit}} expected", { unit: P.yieldUnit ?? b("healthybowl.crops.detail.yield.unitsFallback", "units") })
|
|
485
503
|
}),
|
|
486
|
-
|
|
504
|
+
X && /* @__PURE__ */ p("p", {
|
|
487
505
|
className: "mt-2 text-xs text-text-secondary",
|
|
488
|
-
children:
|
|
489
|
-
amount:
|
|
490
|
-
unit:
|
|
491
|
-
denominator: (
|
|
506
|
+
children: b("healthybowl.crops.detail.yield.perUnit", "~{{amount}} {{unit}} per {{denominator}}", {
|
|
507
|
+
amount: Ie,
|
|
508
|
+
unit: P.yieldUnit,
|
|
509
|
+
denominator: (X.unit ?? "").replace(/s$/, "")
|
|
492
510
|
})
|
|
493
511
|
})
|
|
494
512
|
]
|
|
495
513
|
})]
|
|
496
514
|
}),
|
|
497
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ m("div", {
|
|
498
516
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
499
|
-
children: [/* @__PURE__ */
|
|
517
|
+
children: [/* @__PURE__ */ p("h3", {
|
|
500
518
|
className: "mb-4 text-sm font-semibold text-text-primary",
|
|
501
|
-
children:
|
|
502
|
-
}), /* @__PURE__ */
|
|
519
|
+
children: b("healthybowl.crops.detail.quickActions.title", "Quick Actions")
|
|
520
|
+
}), /* @__PURE__ */ m("div", {
|
|
503
521
|
className: "space-y-2",
|
|
504
522
|
children: [
|
|
505
|
-
/* @__PURE__ */ h
|
|
523
|
+
/* @__PURE__ */ m(h, {
|
|
506
524
|
variant: "outline",
|
|
507
|
-
onClick: () =>
|
|
525
|
+
onClick: () => D(O("analytics")),
|
|
508
526
|
className: "w-full justify-start",
|
|
509
527
|
children: [
|
|
510
|
-
/* @__PURE__ */
|
|
528
|
+
/* @__PURE__ */ p(f, { className: "h-4 w-4 text-text-secondary" }),
|
|
511
529
|
" ",
|
|
512
|
-
|
|
530
|
+
b("healthybowl.crops.detail.quickActions.viewAnalytics", "View Analytics")
|
|
513
531
|
]
|
|
514
532
|
}),
|
|
515
|
-
/* @__PURE__ */ h
|
|
533
|
+
/* @__PURE__ */ m(h, {
|
|
516
534
|
variant: "outline",
|
|
517
|
-
onClick: () =>
|
|
535
|
+
onClick: () => D(O("weather")),
|
|
518
536
|
className: "w-full justify-start",
|
|
519
537
|
children: [
|
|
520
|
-
/* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ p(ge, { className: "h-4 w-4 text-text-secondary" }),
|
|
521
539
|
" ",
|
|
522
|
-
|
|
540
|
+
b("healthybowl.crops.detail.quickActions.checkWeather", "Check Weather")
|
|
523
541
|
]
|
|
524
542
|
}),
|
|
525
|
-
|
|
543
|
+
X && /* @__PURE__ */ m(h, {
|
|
526
544
|
variant: "outline",
|
|
527
|
-
onClick: () =>
|
|
545
|
+
onClick: () => D(O(`crops/fields/${X.id}`)),
|
|
528
546
|
className: "w-full justify-start",
|
|
529
547
|
children: [
|
|
530
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ p(u, { className: "h-4 w-4 text-text-secondary" }),
|
|
531
549
|
" ",
|
|
532
|
-
|
|
550
|
+
b("healthybowl.crops.detail.quickActions.viewField", "View Field")
|
|
533
551
|
]
|
|
534
552
|
}),
|
|
535
|
-
/* @__PURE__ */ h
|
|
553
|
+
/* @__PURE__ */ m(h, {
|
|
536
554
|
variant: "outline",
|
|
537
|
-
onClick: () =>
|
|
555
|
+
onClick: () => D(O("crops")),
|
|
538
556
|
className: "w-full justify-start",
|
|
539
557
|
children: [
|
|
540
|
-
/* @__PURE__ */
|
|
558
|
+
/* @__PURE__ */ p(d, { className: "h-4 w-4 text-text-secondary" }),
|
|
541
559
|
" ",
|
|
542
|
-
|
|
560
|
+
b("healthybowl.crops.detail.quickActions.allCrops", "All Crops")
|
|
543
561
|
]
|
|
544
562
|
})
|
|
545
563
|
]
|
|
@@ -548,173 +566,173 @@ var v = (e) => {
|
|
|
548
566
|
]
|
|
549
567
|
})]
|
|
550
568
|
}),
|
|
551
|
-
/* @__PURE__ */
|
|
552
|
-
open:
|
|
553
|
-
onClose: () =>
|
|
554
|
-
title:
|
|
555
|
-
description:
|
|
569
|
+
/* @__PURE__ */ p(i, {
|
|
570
|
+
open: A,
|
|
571
|
+
onClose: () => j(!1),
|
|
572
|
+
title: b("healthybowl.crops.detail.editModal.title", "Edit {{name}}", { name: P.name }),
|
|
573
|
+
description: b("healthybowl.crops.detail.editModal.description", "Update crop details"),
|
|
556
574
|
size: "lg",
|
|
557
|
-
footer: /* @__PURE__ */
|
|
575
|
+
footer: /* @__PURE__ */ m(Ce, { children: [/* @__PURE__ */ p(h, {
|
|
558
576
|
variant: "outline",
|
|
559
|
-
onClick: () =>
|
|
560
|
-
children:
|
|
561
|
-
}), /* @__PURE__ */
|
|
577
|
+
onClick: () => j(!1),
|
|
578
|
+
children: b("healthybowl.common.cancel", "Cancel")
|
|
579
|
+
}), /* @__PURE__ */ p(h, {
|
|
562
580
|
onClick: async () => {
|
|
563
|
-
if (
|
|
564
|
-
if (!
|
|
565
|
-
|
|
566
|
-
title:
|
|
567
|
-
description:
|
|
581
|
+
if (P) {
|
|
582
|
+
if (!F.trim()) {
|
|
583
|
+
k({
|
|
584
|
+
title: b("healthybowl.crops.detail.toast.missingFields.title", "Missing required fields"),
|
|
585
|
+
description: b("healthybowl.crops.detail.toast.missingFields.description", "Crop name is required."),
|
|
568
586
|
variant: "warning"
|
|
569
587
|
});
|
|
570
588
|
return;
|
|
571
589
|
}
|
|
572
|
-
|
|
590
|
+
N(!0);
|
|
573
591
|
try {
|
|
574
|
-
await
|
|
575
|
-
id:
|
|
576
|
-
name:
|
|
577
|
-
variety:
|
|
578
|
-
category:
|
|
579
|
-
yieldEstimate:
|
|
580
|
-
expectedHarvestDate:
|
|
581
|
-
healthStatus:
|
|
582
|
-
imageIds:
|
|
583
|
-
}),
|
|
584
|
-
title:
|
|
585
|
-
description:
|
|
592
|
+
await ke({
|
|
593
|
+
id: P.id,
|
|
594
|
+
name: F.trim(),
|
|
595
|
+
variety: L,
|
|
596
|
+
category: z,
|
|
597
|
+
yieldEstimate: V ? Number(V) : void 0,
|
|
598
|
+
expectedHarvestDate: U || void 0,
|
|
599
|
+
healthStatus: G,
|
|
600
|
+
imageIds: q
|
|
601
|
+
}), k({
|
|
602
|
+
title: b("healthybowl.crops.detail.toast.updated.title", "Crop updated"),
|
|
603
|
+
description: b("healthybowl.crops.detail.toast.updated.description", "{{name}} details have been saved.", { name: F.trim() }),
|
|
586
604
|
variant: "success"
|
|
587
|
-
}),
|
|
605
|
+
}), j(!1);
|
|
588
606
|
} catch (e) {
|
|
589
|
-
|
|
590
|
-
title:
|
|
607
|
+
k({
|
|
608
|
+
title: b("healthybowl.crops.detail.toast.updateFailed.title", "Update failed"),
|
|
591
609
|
description: String(e),
|
|
592
610
|
variant: "error"
|
|
593
611
|
});
|
|
594
612
|
} finally {
|
|
595
|
-
|
|
613
|
+
N(!1);
|
|
596
614
|
}
|
|
597
615
|
}
|
|
598
616
|
},
|
|
599
|
-
disabled:
|
|
600
|
-
children:
|
|
617
|
+
disabled: M,
|
|
618
|
+
children: M ? b("healthybowl.crops.detail.editModal.saving", "Saving...") : b("healthybowl.crops.detail.editModal.saveChanges", "Save Changes")
|
|
601
619
|
})] }),
|
|
602
|
-
children: /* @__PURE__ */
|
|
620
|
+
children: /* @__PURE__ */ m("div", {
|
|
603
621
|
className: "grid gap-4 sm:grid-cols-2",
|
|
604
622
|
children: [
|
|
605
|
-
/* @__PURE__ */
|
|
623
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
606
624
|
className: "text-sm font-medium text-text-primary",
|
|
607
|
-
children:
|
|
608
|
-
}), /* @__PURE__ */
|
|
609
|
-
value:
|
|
610
|
-
onChange: (e) =>
|
|
625
|
+
children: b("healthybowl.crops.detail.form.cropName", "Crop Name")
|
|
626
|
+
}), /* @__PURE__ */ p("input", {
|
|
627
|
+
value: F,
|
|
628
|
+
onChange: (e) => I(e.target.value),
|
|
611
629
|
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)]"
|
|
612
630
|
})] }),
|
|
613
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
614
632
|
className: "text-sm font-medium text-text-primary",
|
|
615
|
-
children:
|
|
616
|
-
}), /* @__PURE__ */
|
|
617
|
-
value:
|
|
618
|
-
onChange: (e) =>
|
|
633
|
+
children: b("healthybowl.crops.detail.form.variety", "Variety")
|
|
634
|
+
}), /* @__PURE__ */ p("input", {
|
|
635
|
+
value: L,
|
|
636
|
+
onChange: (e) => R(e.target.value),
|
|
619
637
|
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)]"
|
|
620
638
|
})] }),
|
|
621
|
-
/* @__PURE__ */
|
|
639
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
622
640
|
className: "text-sm font-medium text-text-primary",
|
|
623
|
-
children:
|
|
624
|
-
}), /* @__PURE__ */
|
|
625
|
-
value:
|
|
626
|
-
onChange: (e) =>
|
|
641
|
+
children: b("healthybowl.crops.detail.form.category", "Category")
|
|
642
|
+
}), /* @__PURE__ */ p("input", {
|
|
643
|
+
value: z,
|
|
644
|
+
onChange: (e) => B(e.target.value),
|
|
627
645
|
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)]"
|
|
628
646
|
})] }),
|
|
629
|
-
/* @__PURE__ */
|
|
647
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
630
648
|
className: "text-sm font-medium text-text-primary",
|
|
631
|
-
children:
|
|
632
|
-
}), /* @__PURE__ */
|
|
649
|
+
children: b("healthybowl.crops.detail.form.yieldEstimate", "Yield Estimate ({{unit}})", { unit: P.yieldUnit })
|
|
650
|
+
}), /* @__PURE__ */ p("input", {
|
|
633
651
|
type: "number",
|
|
634
|
-
value:
|
|
635
|
-
onChange: (e) =>
|
|
652
|
+
value: V,
|
|
653
|
+
onChange: (e) => H(e.target.value),
|
|
636
654
|
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)]"
|
|
637
655
|
})] }),
|
|
638
|
-
/* @__PURE__ */
|
|
656
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
639
657
|
className: "text-sm font-medium text-text-primary",
|
|
640
|
-
children:
|
|
641
|
-
}), /* @__PURE__ */
|
|
658
|
+
children: b("healthybowl.crops.detail.form.expectedHarvest", "Expected Harvest")
|
|
659
|
+
}), /* @__PURE__ */ p("input", {
|
|
642
660
|
type: "date",
|
|
643
|
-
value:
|
|
644
|
-
onChange: (e) =>
|
|
661
|
+
value: U,
|
|
662
|
+
onChange: (e) => W(e.target.value),
|
|
645
663
|
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)]"
|
|
646
664
|
})] }),
|
|
647
|
-
/* @__PURE__ */
|
|
665
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
648
666
|
className: "text-sm font-medium text-text-primary",
|
|
649
|
-
children:
|
|
650
|
-
}), /* @__PURE__ */
|
|
651
|
-
value:
|
|
652
|
-
onValueChange: (e) =>
|
|
653
|
-
children: [/* @__PURE__ */
|
|
667
|
+
children: b("healthybowl.crops.detail.form.healthStatus", "Health Status")
|
|
668
|
+
}), /* @__PURE__ */ m(Te, {
|
|
669
|
+
value: G,
|
|
670
|
+
onValueChange: (e) => K(e),
|
|
671
|
+
children: [/* @__PURE__ */ p(De, {
|
|
654
672
|
className: "mt-1 w-full",
|
|
655
|
-
children: /* @__PURE__ */
|
|
656
|
-
}), /* @__PURE__ */
|
|
657
|
-
/* @__PURE__ */
|
|
673
|
+
children: /* @__PURE__ */ p(Oe, {})
|
|
674
|
+
}), /* @__PURE__ */ m(Ee, { children: [
|
|
675
|
+
/* @__PURE__ */ p(g, {
|
|
658
676
|
value: "excellent",
|
|
659
|
-
children:
|
|
677
|
+
children: b("healthybowl.crops.detail.form.healthOptions.excellent", "Excellent")
|
|
660
678
|
}),
|
|
661
|
-
/* @__PURE__ */
|
|
679
|
+
/* @__PURE__ */ p(g, {
|
|
662
680
|
value: "good",
|
|
663
|
-
children:
|
|
681
|
+
children: b("healthybowl.crops.detail.form.healthOptions.good", "Good")
|
|
664
682
|
}),
|
|
665
|
-
/* @__PURE__ */
|
|
683
|
+
/* @__PURE__ */ p(g, {
|
|
666
684
|
value: "fair",
|
|
667
|
-
children:
|
|
685
|
+
children: b("healthybowl.crops.detail.form.healthOptions.fair", "Fair")
|
|
668
686
|
}),
|
|
669
|
-
/* @__PURE__ */
|
|
687
|
+
/* @__PURE__ */ p(g, {
|
|
670
688
|
value: "poor",
|
|
671
|
-
children:
|
|
689
|
+
children: b("healthybowl.crops.detail.form.healthOptions.poor", "Poor")
|
|
672
690
|
}),
|
|
673
|
-
/* @__PURE__ */
|
|
691
|
+
/* @__PURE__ */ p(g, {
|
|
674
692
|
value: "critical",
|
|
675
|
-
children:
|
|
693
|
+
children: b("healthybowl.crops.detail.form.healthOptions.critical", "Critical")
|
|
676
694
|
})
|
|
677
695
|
] })]
|
|
678
696
|
})] }),
|
|
679
|
-
/* @__PURE__ */
|
|
697
|
+
/* @__PURE__ */ m("div", {
|
|
680
698
|
className: "sm:col-span-2",
|
|
681
|
-
children: [/* @__PURE__ */
|
|
699
|
+
children: [/* @__PURE__ */ p("label", {
|
|
682
700
|
className: "text-sm font-medium text-text-primary",
|
|
683
|
-
children:
|
|
684
|
-
}), /* @__PURE__ */
|
|
701
|
+
children: b("healthybowl.crops.detail.form.photos", "Photos")
|
|
702
|
+
}), /* @__PURE__ */ p("div", {
|
|
685
703
|
className: "mt-1",
|
|
686
|
-
children: /* @__PURE__ */
|
|
704
|
+
children: /* @__PURE__ */ p(o, {
|
|
687
705
|
entity: "Crop",
|
|
688
|
-
imageIds:
|
|
689
|
-
onChange:
|
|
706
|
+
imageIds: q,
|
|
707
|
+
onChange: J
|
|
690
708
|
})
|
|
691
709
|
})]
|
|
692
710
|
})
|
|
693
711
|
]
|
|
694
712
|
})
|
|
695
713
|
}),
|
|
696
|
-
/* @__PURE__ */
|
|
697
|
-
toasts:
|
|
698
|
-
onDismiss:
|
|
714
|
+
/* @__PURE__ */ p(ne, {
|
|
715
|
+
toasts: Ne,
|
|
716
|
+
onDismiss: Pe
|
|
699
717
|
})
|
|
700
718
|
]
|
|
701
|
-
}) : /* @__PURE__ */
|
|
702
|
-
title:
|
|
703
|
-
description:
|
|
704
|
-
children: /* @__PURE__ */
|
|
719
|
+
}) : /* @__PURE__ */ p(n, {
|
|
720
|
+
title: b("healthybowl.crops.detail.notFound.pageTitle", "Crop Not Found"),
|
|
721
|
+
description: b("healthybowl.crops.detail.notFound.altDescription", "The requested crop could not be found."),
|
|
722
|
+
children: /* @__PURE__ */ m("div", {
|
|
705
723
|
className: "flex flex-col items-center justify-center py-12 text-center",
|
|
706
|
-
children: [/* @__PURE__ */
|
|
724
|
+
children: [/* @__PURE__ */ p("p", {
|
|
707
725
|
className: "text-text-secondary",
|
|
708
|
-
children:
|
|
709
|
-
}), /* @__PURE__ */
|
|
710
|
-
onClick: () =>
|
|
726
|
+
children: b("healthybowl.crops.detail.notFound.altHint", "This crop may have been removed or the ID is invalid.")
|
|
727
|
+
}), /* @__PURE__ */ p(h, {
|
|
728
|
+
onClick: () => D(O("crops")),
|
|
711
729
|
className: "mt-4",
|
|
712
|
-
children:
|
|
730
|
+
children: b("healthybowl.crops.detail.actions.backToCrops", "Back to Crops")
|
|
713
731
|
})]
|
|
714
732
|
})
|
|
715
733
|
});
|
|
716
734
|
};
|
|
717
735
|
//#endregion
|
|
718
|
-
export {
|
|
736
|
+
export { b as CropDetailsPage };
|
|
719
737
|
|
|
720
738
|
//# sourceMappingURL=CropDetailsPage.js.map
|