@burdenoff/microfe-healthybowl 2026.801.2 → 2026.801.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.
|
@@ -3,250 +3,272 @@ import { useBasePath as n } from "../../hooks/useBasePath.js";
|
|
|
3
3
|
import { PageLayout as r } from "../../components/PageLayout.js";
|
|
4
4
|
import { StatusBadge as i } from "../../components/StatusBadge.js";
|
|
5
5
|
import { EmptyState as ee } from "../../components/EmptyState.js";
|
|
6
|
-
import { ErrorState as
|
|
7
|
-
import { ToastContainer as
|
|
8
|
-
import { useConfirm as
|
|
9
|
-
import { Breadcrumbs as
|
|
10
|
-
import { PageLoader as
|
|
11
|
-
import { Modal as
|
|
12
|
-
import { useToast as
|
|
13
|
-
import { FieldMap as
|
|
14
|
-
import { CreateFarmTaskButton as
|
|
6
|
+
import { ErrorState as a } from "../../components/ErrorState.js";
|
|
7
|
+
import { ToastContainer as te } from "../../components/Toast.js";
|
|
8
|
+
import { useConfirm as ne } from "../../components/ConfirmDialog.js";
|
|
9
|
+
import { Breadcrumbs as re } from "../../components/Breadcrumbs.js";
|
|
10
|
+
import { PageLoader as ie } from "../../components/PageLoader.js";
|
|
11
|
+
import { Modal as ae } from "../../components/Modal.js";
|
|
12
|
+
import { useToast as oe } from "../../hooks/useToast.js";
|
|
13
|
+
import { FieldMap as se } from "../../components/FieldMap.js";
|
|
14
|
+
import { CreateFarmTaskButton as ce } from "../../components/CreateFarmTaskButton.js";
|
|
15
15
|
import "../../components/index.js";
|
|
16
|
-
import { useHealthyBowlData as
|
|
17
|
-
import { usePlantCatalog as
|
|
18
|
-
import { DEFAULT_BED_WIDTH_M as
|
|
16
|
+
import { useHealthyBowlData as le } from "../../hooks/useHealthyBowlData.js";
|
|
17
|
+
import { usePlantCatalog as ue } from "../../hooks/usePlantCatalog.js";
|
|
18
|
+
import { DEFAULT_BED_WIDTH_M as de, DEFAULT_CROP_SPACING_PRESET as fe, DEFAULT_PATH_WIDTH_M as pe, estimatePlantingCapacity as me, getCropSpacingPreset as he } from "../../utils/plantingCapacity.js";
|
|
19
19
|
import { useSuccessionPlanning as ge } from "../../hooks/useSuccessionPlanning.js";
|
|
20
20
|
import { computeSeedRate as _e } from "../../utils/seedRate.js";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
21
|
+
import { buildCropComparison as ve, sortCropComparison as ye } from "../../utils/cropComparison.js";
|
|
22
|
+
import { useCallback as be, useEffect as xe, useMemo as o, useState as s } from "react";
|
|
23
|
+
import { useI18n as Se } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
24
|
+
import { Activity as Ce, ArrowLeft as we, BarChart3 as Te, Calendar as Ee, ChevronDown as c, ChevronUp as De, CloudRain as Oe, Droplets as ke, Edit as Ae, Eye as je, Leaf as Me, Map as Ne, Plus as Pe, Sprout as Fe, Sun as Ie, Table2 as Le, Thermometer as Re, Trash2 as ze, TrendingUp as Be, Wind as Ve } from "lucide-react";
|
|
25
|
+
import { useNavigate as He, useParams as Ue } from "react-router";
|
|
26
|
+
import { Fragment as We, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
27
|
+
import { Button as d, GlassCard as Ge, Select as f, SelectContent as p, SelectItem as m, SelectTrigger as h, SelectValue as g } from "@burdenoff/fe-libs/ui";
|
|
27
28
|
//#region src/healthybowl/pages/crops/FieldDetailsPage.tsx
|
|
28
|
-
var
|
|
29
|
+
var Ke = (e) => {
|
|
29
30
|
switch (e) {
|
|
30
31
|
case "active": return "success";
|
|
31
32
|
case "fallow": return "muted";
|
|
32
33
|
case "preparation": return "warning";
|
|
33
34
|
default: return "default";
|
|
34
35
|
}
|
|
35
|
-
},
|
|
36
|
+
}, qe = (e) => {
|
|
36
37
|
switch (e) {
|
|
37
38
|
case "optimal": return "success";
|
|
38
39
|
case "acceptable": return "info";
|
|
39
40
|
case "needs_attention": return "warning";
|
|
40
41
|
default: return "error";
|
|
41
42
|
}
|
|
42
|
-
},
|
|
43
|
+
}, _ = (e, t) => {
|
|
43
44
|
let n = Number(e);
|
|
44
45
|
return Number.isFinite(n) && n > 0 ? n : t;
|
|
45
|
-
},
|
|
46
|
+
}, Je = (e, t) => {
|
|
46
47
|
let n = Number(e);
|
|
47
48
|
return Number.isFinite(n) && n >= 0 ? n : t;
|
|
48
|
-
},
|
|
49
|
-
let { t:
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
if (
|
|
53
|
-
if (!
|
|
49
|
+
}, v = (e, t = 1) => new Intl.NumberFormat("en-US", { maximumFractionDigits: t }).format(e), Ye = () => {
|
|
50
|
+
let { t: c } = Se(), De = ne(), { fields: Ye, crops: S, soilTests: Xe, weatherData: Ze, errors: Qe, loadings: $e, updateField: et, deleteField: tt, refetch: nt } = le(), { fieldId: rt } = Ue(), C = He(), { buildPath: w } = n(), { toasts: it, toast: T, dismiss: at } = oe(), [ot, E] = s(!1), [st, D] = s(!1), O = Ye.find((e) => e.id === rt), [k, ct] = s(""), [lt, ut] = s(""), [dt, ft] = s("acres"), [pt, mt] = s(""), [ht, gt] = s(""), [_t, vt] = s("active"), [yt, bt] = s(!1), [A, xt] = s(""), { entries: j } = ue(), [M, St] = s(""), [N, P] = s(String(fe.plantSpacingCm)), [Ct, F] = s(String(fe.rowSpacingCm)), [I, wt] = s(String(de)), [L, Tt] = s(String(pe)), [R, Et] = s(null), Dt = () => {
|
|
51
|
+
O && (ct(O.name), ut(String(O.area)), ft(O.unit ?? "acres"), mt(O.soilType), gt(O.irrigationType), vt(O.status), bt(O.organicCertified), E(!0));
|
|
52
|
+
}, Ot = async () => {
|
|
53
|
+
if (O) {
|
|
54
|
+
if (!k.trim() || !lt) {
|
|
54
55
|
T({
|
|
55
|
-
title:
|
|
56
|
-
description:
|
|
56
|
+
title: c("healthybowl.crops.fieldDetail.toast.missingFields.title", "Missing required fields"),
|
|
57
|
+
description: c("healthybowl.crops.fieldDetail.toast.missingFields.description", "Name and area are required."),
|
|
57
58
|
variant: "warning"
|
|
58
59
|
});
|
|
59
60
|
return;
|
|
60
61
|
}
|
|
61
|
-
|
|
62
|
+
D(!0);
|
|
62
63
|
try {
|
|
63
|
-
await
|
|
64
|
-
id:
|
|
65
|
-
name:
|
|
66
|
-
area: Number(
|
|
67
|
-
unit:
|
|
68
|
-
soilType:
|
|
69
|
-
irrigationType:
|
|
70
|
-
status:
|
|
71
|
-
organicCertified:
|
|
64
|
+
await et({
|
|
65
|
+
id: O.id,
|
|
66
|
+
name: k.trim(),
|
|
67
|
+
area: Number(lt),
|
|
68
|
+
unit: dt,
|
|
69
|
+
soilType: pt.trim() || "Unknown",
|
|
70
|
+
irrigationType: ht.trim() || "None",
|
|
71
|
+
status: _t,
|
|
72
|
+
organicCertified: yt
|
|
72
73
|
}), T({
|
|
73
|
-
title:
|
|
74
|
-
description:
|
|
74
|
+
title: c("healthybowl.crops.fieldDetail.toast.updated.title", "Field updated"),
|
|
75
|
+
description: c("healthybowl.crops.fieldDetail.toast.updated.description", "{{name}} has been saved.", { name: k.trim() }),
|
|
75
76
|
variant: "success"
|
|
76
77
|
}), E(!1);
|
|
77
78
|
} catch (e) {
|
|
78
79
|
T({
|
|
79
|
-
title:
|
|
80
|
+
title: c("healthybowl.crops.fieldDetail.toast.updateFailed.title", "Update failed"),
|
|
80
81
|
description: String(e),
|
|
81
82
|
variant: "error"
|
|
82
83
|
});
|
|
83
84
|
} finally {
|
|
84
|
-
|
|
85
|
+
D(!1);
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
|
-
},
|
|
88
|
-
if (
|
|
89
|
-
title:
|
|
90
|
-
message:
|
|
91
|
-
okButtonTitle:
|
|
92
|
-
cancelButtonTitle:
|
|
88
|
+
}, kt = async () => {
|
|
89
|
+
if (O && await De({
|
|
90
|
+
title: c("healthybowl.crops.fieldDetail.deleteConfirm.title", "Delete field?"),
|
|
91
|
+
message: c("healthybowl.crops.fieldDetail.deleteConfirm.message", "{{name}} will be permanently removed.", { name: O.name }),
|
|
92
|
+
okButtonTitle: c("healthybowl.common.delete", "Delete"),
|
|
93
|
+
cancelButtonTitle: c("healthybowl.common.cancel", "Cancel")
|
|
93
94
|
}) !== !1) {
|
|
94
|
-
|
|
95
|
+
D(!0);
|
|
95
96
|
try {
|
|
96
|
-
await
|
|
97
|
-
title:
|
|
98
|
-
description:
|
|
97
|
+
await tt(O.id), T({
|
|
98
|
+
title: c("healthybowl.crops.fieldDetail.toast.deleted.title", "Field deleted"),
|
|
99
|
+
description: c("healthybowl.crops.fieldDetail.toast.deleted.description", "{{name}} has been removed.", { name: O.name }),
|
|
99
100
|
variant: "success"
|
|
100
101
|
}), C(w("crops/fields"));
|
|
101
102
|
} catch (e) {
|
|
102
103
|
T({
|
|
103
|
-
title:
|
|
104
|
+
title: c("healthybowl.crops.fieldDetail.toast.deleteFailed.title", "Delete failed"),
|
|
104
105
|
description: String(e),
|
|
105
106
|
variant: "error"
|
|
106
|
-
}),
|
|
107
|
+
}), D(!1);
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
|
-
},
|
|
110
|
+
}, z = o(() => O ? S.filter((e) => e.field === O.id || e.fieldName === O.name) : [], [S, O]), B = o(() => {
|
|
110
111
|
let e = /* @__PURE__ */ new Set();
|
|
111
|
-
return [...
|
|
112
|
-
}, [
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
]),
|
|
117
|
-
fieldArea:
|
|
118
|
-
fieldUnit:
|
|
119
|
-
bedWidthM:
|
|
120
|
-
pathWidthM:
|
|
121
|
-
plantSpacingCm:
|
|
122
|
-
rowSpacingCm:
|
|
112
|
+
return [...z, ...S].filter((t) => !e.has(t.id) && !!e.add(t.id));
|
|
113
|
+
}, [S, z]), At = o(() => z[0] ?? B[0] ?? null, [B, z]), V = o(() => B.find((e) => e.id === A) ?? At, [
|
|
114
|
+
A,
|
|
115
|
+
B,
|
|
116
|
+
At
|
|
117
|
+
]), H = o(() => he(V), [V]), U = R != null && R > 0 ? R : O?.area ?? 0, jt = R != null && R > 0, W = o(() => O ? me({
|
|
118
|
+
fieldArea: U,
|
|
119
|
+
fieldUnit: O.unit,
|
|
120
|
+
bedWidthM: _(I, de),
|
|
121
|
+
pathWidthM: Je(L, pe),
|
|
122
|
+
plantSpacingCm: _(N, H.plantSpacingCm),
|
|
123
|
+
rowSpacingCm: _(Ct, H.rowSpacingCm)
|
|
123
124
|
}) : null, [
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
H,
|
|
125
|
+
I,
|
|
126
|
+
U,
|
|
127
|
+
O,
|
|
128
128
|
L,
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
N,
|
|
130
|
+
Ct,
|
|
131
|
+
H
|
|
131
132
|
]);
|
|
132
|
-
|
|
133
|
-
if (!
|
|
134
|
-
let e =
|
|
135
|
-
|
|
136
|
-
}, [
|
|
137
|
-
let
|
|
138
|
-
let t =
|
|
139
|
-
|
|
140
|
-
let n =
|
|
141
|
-
|
|
142
|
-
},
|
|
143
|
-
if (
|
|
144
|
-
|
|
133
|
+
xe(() => {
|
|
134
|
+
if (!V || A === V.id) return;
|
|
135
|
+
let e = he(V);
|
|
136
|
+
xt(V.id), P(String(e.plantSpacingCm)), F(String(e.rowSpacingCm));
|
|
137
|
+
}, [A, V]);
|
|
138
|
+
let Mt = (e) => {
|
|
139
|
+
let t = B.find((t) => t.id === e);
|
|
140
|
+
xt(e), St("");
|
|
141
|
+
let n = he(t);
|
|
142
|
+
P(String(n.plantSpacingCm)), F(String(n.rowSpacingCm));
|
|
143
|
+
}, Nt = (e) => {
|
|
144
|
+
if (St(e), e === "none") {
|
|
145
|
+
St("");
|
|
145
146
|
return;
|
|
146
147
|
}
|
|
147
|
-
let t =
|
|
148
|
-
t && (t.plantSpacingCm != null &&
|
|
149
|
-
},
|
|
150
|
-
let e =
|
|
148
|
+
let t = j.find((t) => t.id === e);
|
|
149
|
+
t && (t.plantSpacingCm != null && P(String(t.plantSpacingCm)), t.rowSpacingCm != null && F(String(t.rowSpacingCm)));
|
|
150
|
+
}, G = o(() => {
|
|
151
|
+
let e = M ? j.find((e) => e.id === M) : void 0;
|
|
151
152
|
if (e) return e;
|
|
152
|
-
if (!
|
|
153
|
-
let t = (
|
|
153
|
+
if (!V) return;
|
|
154
|
+
let t = (V.name ?? "").trim().toLowerCase();
|
|
154
155
|
if (!t) return;
|
|
155
|
-
let n = (
|
|
156
|
-
return
|
|
156
|
+
let n = (V.variety ?? "").trim().toLowerCase();
|
|
157
|
+
return j.find((e) => (e.name ?? "").trim().toLowerCase() === t && (e.variety ?? "").trim().toLowerCase() === n) ?? j.find((e) => (e.name ?? "").trim().toLowerCase() === t);
|
|
157
158
|
}, [
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
]),
|
|
162
|
-
plantsNeeded:
|
|
163
|
-
seedsPerGram:
|
|
164
|
-
germinationRate:
|
|
165
|
-
seedsPerCell:
|
|
166
|
-
}) : null, [
|
|
159
|
+
M,
|
|
160
|
+
j,
|
|
161
|
+
V
|
|
162
|
+
]), K = o(() => W ? _e({
|
|
163
|
+
plantsNeeded: W.totalPlants,
|
|
164
|
+
seedsPerGram: G?.seedsPerGram,
|
|
165
|
+
germinationRate: G?.germinationRate,
|
|
166
|
+
seedsPerCell: G?.seedsPerCell
|
|
167
|
+
}) : null, [W, G]), [q, Pt] = s("label"), [J, Ft] = s("asc"), It = o(() => !O || j.length === 0 ? [] : ve(j, {
|
|
168
|
+
fieldArea: U,
|
|
169
|
+
fieldUnit: O.unit,
|
|
170
|
+
bedWidthM: _(I, de),
|
|
171
|
+
pathWidthM: Je(L, pe)
|
|
172
|
+
}), [
|
|
173
|
+
I,
|
|
174
|
+
U,
|
|
175
|
+
O,
|
|
176
|
+
L,
|
|
177
|
+
j
|
|
178
|
+
]), Y = o(() => ye(It, q, J), [
|
|
179
|
+
It,
|
|
180
|
+
q,
|
|
181
|
+
J
|
|
182
|
+
]), X = be((e) => {
|
|
183
|
+
if (e === q) {
|
|
184
|
+
Ft((e) => e === "asc" ? "desc" : "asc");
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
Pt(e), Ft(e === "label" ? "asc" : "desc");
|
|
188
|
+
}, [q]), { successionPlans: Lt, beds: Rt, createSuccession: zt, deletePlan: Bt } = ge(O?.id), [Z, Vt] = s(() => (/* @__PURE__ */ new Date()).toISOString().split("T")[0]), [Ht, Ut] = s("14"), [Wt, Gt] = s("4"), [Kt, qt] = s(""), [Jt, Yt] = s(!1), Xt = o(() => {
|
|
167
189
|
let e = /* @__PURE__ */ new Map();
|
|
168
|
-
for (let t of
|
|
190
|
+
for (let t of Lt) {
|
|
169
191
|
let n = String(t.successionGroupId), r = e.get(n);
|
|
170
192
|
r ? r.push(t) : e.set(n, [t]);
|
|
171
193
|
}
|
|
172
194
|
return Array.from(e.entries());
|
|
173
|
-
}, [
|
|
174
|
-
let t = e.cropId ?
|
|
195
|
+
}, [Lt]), Zt = be((e) => {
|
|
196
|
+
let t = e.cropId ? S.find((t) => t.id === e.cropId) : void 0;
|
|
175
197
|
if (t) return t.variety ? `${t.name} - ${t.variety}` : t.name;
|
|
176
|
-
let n = e.plantCatalogId ?
|
|
198
|
+
let n = e.plantCatalogId ? j.find((t) => t.id === e.plantCatalogId) : void 0;
|
|
177
199
|
if (n?.name?.trim()) return n.variety ? `${n.name} - ${n.variety}` : n.name;
|
|
178
200
|
let r = e.cropName?.trim();
|
|
179
201
|
if (r && !/^unknown(\s+crop)?$/i.test(r)) return r;
|
|
180
|
-
let i =
|
|
202
|
+
let i = z[0];
|
|
181
203
|
return i ? i.variety ? `${i.name} - ${i.variety}` : i.name : "—";
|
|
182
204
|
}, [
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
]),
|
|
187
|
-
if (!
|
|
188
|
-
let e = Number(
|
|
205
|
+
S,
|
|
206
|
+
j,
|
|
207
|
+
z
|
|
208
|
+
]), Qt = async () => {
|
|
209
|
+
if (!O) return;
|
|
210
|
+
let e = Number(Ht), t = Number(Wt);
|
|
189
211
|
if (!Z || !Number.isFinite(e) || e < 1 || !Number.isFinite(t) || t < 1) {
|
|
190
212
|
T({
|
|
191
|
-
title:
|
|
192
|
-
description:
|
|
213
|
+
title: c("healthybowl.crops.fieldDetail.succession.toast.invalid.title", "Check the schedule inputs"),
|
|
214
|
+
description: c("healthybowl.crops.fieldDetail.succession.toast.invalid.description", "A start date, an interval of at least 1 day and at least 1 sowing are required."),
|
|
193
215
|
variant: "warning"
|
|
194
216
|
});
|
|
195
217
|
return;
|
|
196
218
|
}
|
|
197
|
-
|
|
219
|
+
Yt(!0);
|
|
198
220
|
try {
|
|
199
|
-
let n = await
|
|
200
|
-
fieldId:
|
|
201
|
-
bedId:
|
|
202
|
-
cropId:
|
|
203
|
-
plantCatalogId:
|
|
204
|
-
season:
|
|
221
|
+
let n = await zt({
|
|
222
|
+
fieldId: O.id,
|
|
223
|
+
bedId: Kt || void 0,
|
|
224
|
+
cropId: V?.id ?? void 0,
|
|
225
|
+
plantCatalogId: M || void 0,
|
|
226
|
+
season: V?.season ? V.season.toUpperCase() : void 0,
|
|
205
227
|
year: new Date(Z).getFullYear(),
|
|
206
228
|
startDate: Z,
|
|
207
229
|
intervalDays: e,
|
|
208
230
|
count: t,
|
|
209
|
-
plantsNeeded:
|
|
210
|
-
seedGrams:
|
|
211
|
-
seedlingsToRaise:
|
|
212
|
-
density:
|
|
231
|
+
plantsNeeded: W?.totalPlants,
|
|
232
|
+
seedGrams: K?.seedGrams ?? void 0,
|
|
233
|
+
seedlingsToRaise: K?.seedlingsToRaise,
|
|
234
|
+
density: W?.densityPlantsPerSqm
|
|
213
235
|
});
|
|
214
236
|
T({
|
|
215
|
-
title:
|
|
216
|
-
description:
|
|
237
|
+
title: c("healthybowl.crops.fieldDetail.succession.toast.created.title", "Succession schedule created"),
|
|
238
|
+
description: c("healthybowl.crops.fieldDetail.succession.toast.created.description", "{{count}} sowings scheduled.", { count: n.length || t }),
|
|
217
239
|
variant: "success"
|
|
218
240
|
});
|
|
219
241
|
} catch (e) {
|
|
220
242
|
T({
|
|
221
|
-
title:
|
|
243
|
+
title: c("healthybowl.crops.fieldDetail.succession.toast.failed.title", "Could not create schedule"),
|
|
222
244
|
description: e instanceof Error ? e.message : String(e),
|
|
223
245
|
variant: "error"
|
|
224
246
|
});
|
|
225
247
|
} finally {
|
|
226
|
-
|
|
248
|
+
Yt(!1);
|
|
227
249
|
}
|
|
228
|
-
},
|
|
229
|
-
if (await
|
|
230
|
-
title:
|
|
231
|
-
message:
|
|
232
|
-
okButtonTitle:
|
|
233
|
-
cancelButtonTitle:
|
|
250
|
+
}, $t = async (e) => {
|
|
251
|
+
if (await De({
|
|
252
|
+
title: c("healthybowl.crops.fieldDetail.succession.deleteConfirm.title", "Delete this sowing?"),
|
|
253
|
+
message: c("healthybowl.crops.fieldDetail.succession.deleteConfirm.message", "This sowing will be permanently removed from the schedule."),
|
|
254
|
+
okButtonTitle: c("healthybowl.common.delete", "Delete"),
|
|
255
|
+
cancelButtonTitle: c("healthybowl.common.cancel", "Cancel")
|
|
234
256
|
}) !== !1) try {
|
|
235
|
-
await
|
|
236
|
-
title:
|
|
237
|
-
description:
|
|
257
|
+
await Bt(e.id), T({
|
|
258
|
+
title: c("healthybowl.crops.fieldDetail.succession.toast.deleted.title", "Sowing removed"),
|
|
259
|
+
description: c("healthybowl.crops.fieldDetail.succession.toast.deleted.description", "The sowing was deleted."),
|
|
238
260
|
variant: "success"
|
|
239
261
|
});
|
|
240
262
|
} catch (e) {
|
|
241
263
|
T({
|
|
242
|
-
title:
|
|
264
|
+
title: c("healthybowl.crops.fieldDetail.succession.toast.deleteFailed.title", "Could not delete sowing"),
|
|
243
265
|
description: e instanceof Error ? e.message : String(e),
|
|
244
266
|
variant: "error"
|
|
245
267
|
});
|
|
246
268
|
}
|
|
247
|
-
}, Q =
|
|
248
|
-
location:
|
|
249
|
-
current:
|
|
269
|
+
}, Q = O ? Xe.find((e) => e.fieldName === O.name) : void 0, $ = {
|
|
270
|
+
location: Ze?.location ?? "",
|
|
271
|
+
current: Ze?.current ?? {
|
|
250
272
|
temperature: 0,
|
|
251
273
|
condition: "N/A",
|
|
252
274
|
feelsLike: 0,
|
|
@@ -256,85 +278,85 @@ var He = (e) => {
|
|
|
256
278
|
pressure: 0,
|
|
257
279
|
visibility: 0
|
|
258
280
|
},
|
|
259
|
-
forecast:
|
|
260
|
-
},
|
|
281
|
+
forecast: Ze?.forecast ?? []
|
|
282
|
+
}, en = o(() => {
|
|
261
283
|
let e = [];
|
|
262
|
-
return
|
|
284
|
+
return z.forEach((t) => {
|
|
263
285
|
t.plantingDate && e.push({
|
|
264
286
|
date: t.plantingDate,
|
|
265
|
-
action:
|
|
287
|
+
action: c("healthybowl.crops.fieldDetail.timeline.planted", "{{name}} ({{variety}}) planted", {
|
|
266
288
|
name: t.name,
|
|
267
289
|
variety: t.variety
|
|
268
290
|
}),
|
|
269
291
|
type: "planting"
|
|
270
292
|
}), t.expectedHarvestDate && e.push({
|
|
271
293
|
date: t.expectedHarvestDate,
|
|
272
|
-
action:
|
|
294
|
+
action: c("healthybowl.crops.fieldDetail.timeline.expectedHarvest", "{{name}} expected harvest", { name: t.name }),
|
|
273
295
|
type: "harvest"
|
|
274
296
|
});
|
|
275
297
|
}), Q && e.push({
|
|
276
298
|
date: Q.date,
|
|
277
|
-
action:
|
|
299
|
+
action: c("healthybowl.crops.fieldDetail.timeline.soilTestConducted", "Soil test conducted"),
|
|
278
300
|
type: "testing"
|
|
279
301
|
}), e.sort((e, t) => new Date(t.date).getTime() - new Date(e.date).getTime()), e.length === 0 ? [{
|
|
280
302
|
date: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
|
|
281
|
-
action:
|
|
303
|
+
action: c("healthybowl.crops.fieldDetail.timeline.noActivity", "No activity recorded yet"),
|
|
282
304
|
type: "info"
|
|
283
305
|
}] : e.slice(0, 5);
|
|
284
306
|
}, [
|
|
285
|
-
|
|
307
|
+
z,
|
|
286
308
|
Q,
|
|
287
|
-
|
|
288
|
-
]),
|
|
289
|
-
season:
|
|
290
|
-
crop:
|
|
309
|
+
c
|
|
310
|
+
]), tn = o(() => z.length === 0 ? [{
|
|
311
|
+
season: c("healthybowl.crops.fieldDetail.cropHistory.currentSeason", "Current"),
|
|
312
|
+
crop: c("healthybowl.crops.fieldDetail.cropHistory.noCropsPlanted", "No crops planted"),
|
|
291
313
|
status: "fallow"
|
|
292
|
-
}] :
|
|
314
|
+
}] : z.map((e) => ({
|
|
293
315
|
season: `${e.season.charAt(0).toUpperCase() + e.season.slice(1)} - ${e.plantingDate ? new Date(e.plantingDate).getFullYear() : "N/A"}`,
|
|
294
316
|
crop: `${e.name} (${e.variety})`,
|
|
295
317
|
status: e.status === "harvested" ? "completed" : "active"
|
|
296
|
-
})), [
|
|
297
|
-
return
|
|
298
|
-
title:
|
|
299
|
-
description:
|
|
300
|
-
area:
|
|
301
|
-
unit:
|
|
302
|
-
soilType:
|
|
318
|
+
})), [z, c]);
|
|
319
|
+
return O ? /* @__PURE__ */ u(r, {
|
|
320
|
+
title: O.name,
|
|
321
|
+
description: c("healthybowl.crops.fieldDetail.header.description", "{{area}} {{unit}} - {{soilType}}", {
|
|
322
|
+
area: O.area,
|
|
323
|
+
unit: O.unit,
|
|
324
|
+
soilType: O.soilType
|
|
303
325
|
}),
|
|
304
|
-
actions: /* @__PURE__ */
|
|
326
|
+
actions: /* @__PURE__ */ u("div", {
|
|
305
327
|
className: "flex items-center gap-2",
|
|
306
328
|
children: [
|
|
307
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ l(ce, {
|
|
308
330
|
entityType: "FIELD",
|
|
309
|
-
entityId:
|
|
310
|
-
entityLabel:
|
|
331
|
+
entityId: O.id,
|
|
332
|
+
entityLabel: O.name
|
|
311
333
|
}),
|
|
312
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ u(d, {
|
|
313
335
|
variant: "outline",
|
|
314
336
|
onClick: () => C(w("crops/fields")),
|
|
315
337
|
children: [
|
|
316
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ l(we, { className: "h-4 w-4" }),
|
|
317
339
|
" ",
|
|
318
|
-
|
|
340
|
+
c("healthybowl.crops.fieldDetail.actions.backToFields", "Back to Fields")
|
|
319
341
|
]
|
|
320
342
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ u(d, {
|
|
322
344
|
variant: "outline",
|
|
323
|
-
onClick:
|
|
345
|
+
onClick: Dt,
|
|
324
346
|
children: [
|
|
325
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ l(Ae, { className: "h-4 w-4" }),
|
|
326
348
|
" ",
|
|
327
|
-
|
|
349
|
+
c("healthybowl.crops.fieldDetail.actions.editField", "Edit Field")
|
|
328
350
|
]
|
|
329
351
|
}),
|
|
330
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ u(d, {
|
|
331
353
|
variant: "destructive",
|
|
332
|
-
onClick:
|
|
333
|
-
disabled:
|
|
354
|
+
onClick: kt,
|
|
355
|
+
disabled: st,
|
|
334
356
|
children: [
|
|
335
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ l(ze, { className: "h-4 w-4" }),
|
|
336
358
|
" ",
|
|
337
|
-
|
|
359
|
+
c("healthybowl.common.delete", "Delete")
|
|
338
360
|
]
|
|
339
361
|
})
|
|
340
362
|
]
|
|
@@ -343,150 +365,150 @@ var He = (e) => {
|
|
|
343
365
|
nextSteps: [
|
|
344
366
|
{
|
|
345
367
|
id: "edit",
|
|
346
|
-
label:
|
|
347
|
-
description:
|
|
348
|
-
onClick:
|
|
368
|
+
label: c("healthybowl.crops.fieldDetail.nextSteps.edit.label", "Update field details"),
|
|
369
|
+
description: c("healthybowl.crops.fieldDetail.nextSteps.edit.desc", "Keep area, soil type and irrigation info current."),
|
|
370
|
+
onClick: Dt
|
|
349
371
|
},
|
|
350
372
|
{
|
|
351
373
|
id: "soil",
|
|
352
|
-
label:
|
|
353
|
-
description:
|
|
374
|
+
label: c("healthybowl.crops.fieldDetail.nextSteps.soil.label", "Run a soil test"),
|
|
375
|
+
description: c("healthybowl.crops.fieldDetail.nextSteps.soil.desc", "Check fertility before you plant or fertilise this field."),
|
|
354
376
|
href: w("soil/tests")
|
|
355
377
|
},
|
|
356
378
|
{
|
|
357
379
|
id: "plan",
|
|
358
|
-
label:
|
|
359
|
-
description:
|
|
380
|
+
label: c("healthybowl.crops.fieldDetail.nextSteps.plan.label", "Plan what to plant here"),
|
|
381
|
+
description: c("healthybowl.crops.fieldDetail.nextSteps.plan.desc", "Add a planting plan so this field is working toward your goals."),
|
|
360
382
|
href: w("crops/planning")
|
|
361
383
|
}
|
|
362
384
|
],
|
|
363
385
|
nextStepsKey: "healthybowl-field-detail",
|
|
364
386
|
children: [
|
|
365
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ l(re, { items: [
|
|
366
388
|
{
|
|
367
|
-
label:
|
|
389
|
+
label: c("healthybowl.crops.fieldDetail.breadcrumbs.crops", "Crops"),
|
|
368
390
|
href: w("crops")
|
|
369
391
|
},
|
|
370
392
|
{
|
|
371
|
-
label:
|
|
393
|
+
label: c("healthybowl.crops.fieldDetail.breadcrumbs.fields", "Fields"),
|
|
372
394
|
href: w("crops/fields")
|
|
373
395
|
},
|
|
374
|
-
{ label:
|
|
396
|
+
{ label: O.name }
|
|
375
397
|
] }),
|
|
376
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ u("div", {
|
|
377
399
|
className: "flex flex-wrap items-center gap-3",
|
|
378
|
-
children: [/* @__PURE__ */
|
|
379
|
-
label:
|
|
380
|
-
variant:
|
|
400
|
+
children: [/* @__PURE__ */ l(i, {
|
|
401
|
+
label: O.status,
|
|
402
|
+
variant: Ke(O.status),
|
|
381
403
|
dot: !0
|
|
382
|
-
}),
|
|
383
|
-
label:
|
|
404
|
+
}), O.organicCertified ? /* @__PURE__ */ l(i, {
|
|
405
|
+
label: c("healthybowl.crops.fieldDetail.badges.organicCertified", "Organic Certified"),
|
|
384
406
|
variant: "success"
|
|
385
|
-
}) : /* @__PURE__ */
|
|
386
|
-
label:
|
|
407
|
+
}) : /* @__PURE__ */ l(i, {
|
|
408
|
+
label: c("healthybowl.crops.fieldDetail.badges.notCertified", "Not Certified"),
|
|
387
409
|
variant: "muted"
|
|
388
410
|
})]
|
|
389
411
|
}),
|
|
390
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ u("div", {
|
|
391
413
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
392
|
-
children: [/* @__PURE__ */
|
|
414
|
+
children: [/* @__PURE__ */ u("div", {
|
|
393
415
|
className: "space-y-6 lg:col-span-2",
|
|
394
416
|
children: [
|
|
395
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ u(Ge, {
|
|
396
418
|
treatment: "glass",
|
|
397
419
|
glow: !0,
|
|
398
420
|
className: "border-border-seam p-6",
|
|
399
421
|
children: [
|
|
400
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ l("h3", {
|
|
401
423
|
className: "mb-4 text-sm font-semibold text-text-primary",
|
|
402
|
-
children:
|
|
424
|
+
children: c("healthybowl.crops.fieldDetail.info.heading", "Field Information")
|
|
403
425
|
}),
|
|
404
|
-
/* @__PURE__ */
|
|
426
|
+
/* @__PURE__ */ u("div", {
|
|
405
427
|
className: "grid grid-cols-1 gap-6 sm:grid-cols-2",
|
|
406
|
-
children: [/* @__PURE__ */
|
|
428
|
+
children: [/* @__PURE__ */ u("div", {
|
|
407
429
|
className: "space-y-4",
|
|
408
430
|
children: [
|
|
409
|
-
/* @__PURE__ */
|
|
431
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
|
|
410
432
|
className: "text-xs text-text-secondary",
|
|
411
|
-
children:
|
|
412
|
-
}), /* @__PURE__ */
|
|
433
|
+
children: c("healthybowl.crops.fieldDetail.info.fieldName", "Field Name")
|
|
434
|
+
}), /* @__PURE__ */ l("p", {
|
|
413
435
|
className: "text-sm font-semibold text-text-primary",
|
|
414
|
-
children:
|
|
436
|
+
children: O.name
|
|
415
437
|
})] }),
|
|
416
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
|
|
417
439
|
className: "text-xs text-text-secondary",
|
|
418
|
-
children:
|
|
419
|
-
}), /* @__PURE__ */
|
|
440
|
+
children: c("healthybowl.crops.fieldDetail.info.area", "Area")
|
|
441
|
+
}), /* @__PURE__ */ u("p", {
|
|
420
442
|
className: "text-sm font-semibold text-text-primary",
|
|
421
443
|
children: [
|
|
422
|
-
|
|
444
|
+
O.area,
|
|
423
445
|
" ",
|
|
424
|
-
|
|
446
|
+
O.unit
|
|
425
447
|
]
|
|
426
448
|
})] }),
|
|
427
|
-
/* @__PURE__ */
|
|
449
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
|
|
428
450
|
className: "text-xs text-text-secondary",
|
|
429
|
-
children:
|
|
430
|
-
}), /* @__PURE__ */
|
|
451
|
+
children: c("healthybowl.crops.fieldDetail.info.status", "Status")
|
|
452
|
+
}), /* @__PURE__ */ l("div", {
|
|
431
453
|
className: "mt-1",
|
|
432
|
-
children: /* @__PURE__ */
|
|
433
|
-
label:
|
|
434
|
-
variant:
|
|
454
|
+
children: /* @__PURE__ */ l(i, {
|
|
455
|
+
label: O.status,
|
|
456
|
+
variant: Ke(O.status)
|
|
435
457
|
})
|
|
436
458
|
})] })
|
|
437
459
|
]
|
|
438
|
-
}), /* @__PURE__ */
|
|
460
|
+
}), /* @__PURE__ */ u("div", {
|
|
439
461
|
className: "space-y-4",
|
|
440
462
|
children: [
|
|
441
|
-
/* @__PURE__ */
|
|
463
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
|
|
442
464
|
className: "text-xs text-text-secondary",
|
|
443
|
-
children:
|
|
444
|
-
}), /* @__PURE__ */
|
|
465
|
+
children: c("healthybowl.crops.fieldDetail.info.soilType", "Soil Type")
|
|
466
|
+
}), /* @__PURE__ */ l("p", {
|
|
445
467
|
className: "text-sm font-semibold text-text-primary",
|
|
446
|
-
children:
|
|
468
|
+
children: O.soilType
|
|
447
469
|
})] }),
|
|
448
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
|
|
449
471
|
className: "text-xs text-text-secondary",
|
|
450
|
-
children:
|
|
451
|
-
}), /* @__PURE__ */
|
|
472
|
+
children: c("healthybowl.crops.fieldDetail.info.irrigation", "Irrigation")
|
|
473
|
+
}), /* @__PURE__ */ l("p", {
|
|
452
474
|
className: "text-sm font-semibold text-text-primary",
|
|
453
|
-
children:
|
|
475
|
+
children: O.irrigationType
|
|
454
476
|
})] }),
|
|
455
|
-
/* @__PURE__ */
|
|
477
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
|
|
456
478
|
className: "text-xs text-text-secondary",
|
|
457
|
-
children:
|
|
458
|
-
}), /* @__PURE__ */
|
|
479
|
+
children: c("healthybowl.crops.fieldDetail.info.currentCrops", "Current Crops")
|
|
480
|
+
}), /* @__PURE__ */ l("p", {
|
|
459
481
|
className: "text-sm font-semibold text-text-primary",
|
|
460
|
-
children: (
|
|
482
|
+
children: (O.crops ?? []).length > 0 ? (O.crops ?? []).join(", ") : c("healthybowl.crops.fieldDetail.info.noneValue", "None")
|
|
461
483
|
})] })
|
|
462
484
|
]
|
|
463
485
|
})]
|
|
464
486
|
}),
|
|
465
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ u("div", {
|
|
466
488
|
className: "mt-6 border-t border-border-subtle pt-4",
|
|
467
|
-
children: [/* @__PURE__ */
|
|
489
|
+
children: [/* @__PURE__ */ l("span", {
|
|
468
490
|
className: "text-xs text-text-secondary",
|
|
469
|
-
children:
|
|
470
|
-
}), /* @__PURE__ */
|
|
491
|
+
children: c("healthybowl.crops.fieldDetail.info.gpsCoordinates", "GPS Coordinates")
|
|
492
|
+
}), /* @__PURE__ */ u("div", {
|
|
471
493
|
className: "mt-1 flex items-center gap-4",
|
|
472
|
-
children: [/* @__PURE__ */
|
|
494
|
+
children: [/* @__PURE__ */ u("span", {
|
|
473
495
|
className: "text-xs text-text-secondary",
|
|
474
496
|
children: [
|
|
475
|
-
|
|
497
|
+
c("healthybowl.crops.fieldDetail.info.latLabel", "Lat:"),
|
|
476
498
|
" ",
|
|
477
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ l("span", {
|
|
478
500
|
className: "font-mono text-sm text-text-primary",
|
|
479
|
-
children:
|
|
501
|
+
children: O.location?.lat ?? 0
|
|
480
502
|
})
|
|
481
503
|
]
|
|
482
|
-
}), /* @__PURE__ */
|
|
504
|
+
}), /* @__PURE__ */ u("span", {
|
|
483
505
|
className: "text-xs text-text-secondary",
|
|
484
506
|
children: [
|
|
485
|
-
|
|
507
|
+
c("healthybowl.crops.fieldDetail.info.lngLabel", "Lng:"),
|
|
486
508
|
" ",
|
|
487
|
-
/* @__PURE__ */
|
|
509
|
+
/* @__PURE__ */ l("span", {
|
|
488
510
|
className: "font-mono text-sm text-text-primary",
|
|
489
|
-
children:
|
|
511
|
+
children: O.location?.lng ?? 0
|
|
490
512
|
})
|
|
491
513
|
]
|
|
492
514
|
})]
|
|
@@ -494,453 +516,589 @@ var He = (e) => {
|
|
|
494
516
|
})
|
|
495
517
|
]
|
|
496
518
|
}),
|
|
497
|
-
/* @__PURE__ */
|
|
519
|
+
/* @__PURE__ */ u("div", {
|
|
498
520
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
499
521
|
children: [
|
|
500
|
-
/* @__PURE__ */
|
|
522
|
+
/* @__PURE__ */ u("div", {
|
|
501
523
|
className: "mb-4",
|
|
502
|
-
children: [/* @__PURE__ */
|
|
524
|
+
children: [/* @__PURE__ */ u("h3", {
|
|
503
525
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
504
526
|
children: [
|
|
505
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ l(Ne, { className: "h-4 w-4 text-success" }),
|
|
506
528
|
" ",
|
|
507
|
-
|
|
529
|
+
c("healthybowl.crops.fieldDetail.boundary.heading", "Field Boundary")
|
|
508
530
|
]
|
|
509
|
-
}), /* @__PURE__ */
|
|
531
|
+
}), /* @__PURE__ */ l("p", {
|
|
510
532
|
className: "mt-1 text-xs text-text-secondary",
|
|
511
|
-
children:
|
|
533
|
+
children: c("healthybowl.crops.fieldDetail.boundary.description", "Draw or import this field’s boundary on the satellite map. Saving updates the field area automatically.")
|
|
512
534
|
})]
|
|
513
535
|
}),
|
|
514
|
-
/* @__PURE__ */
|
|
515
|
-
fieldId:
|
|
516
|
-
unit:
|
|
517
|
-
center:
|
|
518
|
-
initialBoundary:
|
|
519
|
-
onSaved:
|
|
520
|
-
onAreaChange:
|
|
536
|
+
/* @__PURE__ */ l(se, {
|
|
537
|
+
fieldId: O.id,
|
|
538
|
+
unit: O.unit ?? "acres",
|
|
539
|
+
center: O.location,
|
|
540
|
+
initialBoundary: O.boundary,
|
|
541
|
+
onSaved: nt,
|
|
542
|
+
onAreaChange: Et
|
|
521
543
|
}),
|
|
522
|
-
/* @__PURE__ */
|
|
544
|
+
/* @__PURE__ */ u("div", {
|
|
523
545
|
className: "mt-5 border-t border-border-subtle pt-5",
|
|
524
546
|
children: [
|
|
525
|
-
/* @__PURE__ */
|
|
547
|
+
/* @__PURE__ */ u("div", {
|
|
526
548
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
527
|
-
children: [/* @__PURE__ */
|
|
549
|
+
children: [/* @__PURE__ */ u("h4", {
|
|
528
550
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
529
|
-
children: [
|
|
551
|
+
children: [c("healthybowl.crops.fieldDetail.capacity.heading", "Planting capacity"), jt && /* @__PURE__ */ l("span", {
|
|
530
552
|
className: "rounded-full bg-success/10 px-2 py-0.5 text-[11px] font-medium text-success",
|
|
531
|
-
children:
|
|
553
|
+
children: c("healthybowl.crops.fieldDetail.capacity.fromBoundary", "from drawn boundary")
|
|
532
554
|
})]
|
|
533
|
-
}), /* @__PURE__ */
|
|
534
|
-
label:
|
|
555
|
+
}), /* @__PURE__ */ l(i, {
|
|
556
|
+
label: H.label,
|
|
535
557
|
variant: "muted"
|
|
536
558
|
})]
|
|
537
559
|
}),
|
|
538
|
-
/* @__PURE__ */
|
|
560
|
+
/* @__PURE__ */ u("div", {
|
|
539
561
|
className: "mt-4 grid gap-3 md:grid-cols-2 xl:grid-cols-6",
|
|
540
562
|
children: [
|
|
541
|
-
/* @__PURE__ */
|
|
563
|
+
/* @__PURE__ */ u("div", {
|
|
542
564
|
className: "xl:col-span-2",
|
|
543
|
-
children: [/* @__PURE__ */
|
|
565
|
+
children: [/* @__PURE__ */ l("label", {
|
|
544
566
|
className: "text-xs font-medium text-text-secondary",
|
|
545
|
-
children:
|
|
546
|
-
}), /* @__PURE__ */
|
|
547
|
-
value:
|
|
548
|
-
onValueChange:
|
|
549
|
-
children: [/* @__PURE__ */
|
|
567
|
+
children: c("healthybowl.crops.fieldDetail.capacity.crop", "Crop")
|
|
568
|
+
}), /* @__PURE__ */ u(f, {
|
|
569
|
+
value: A,
|
|
570
|
+
onValueChange: Mt,
|
|
571
|
+
children: [/* @__PURE__ */ l(h, {
|
|
550
572
|
className: "mt-1 w-full",
|
|
551
|
-
children: /* @__PURE__ */
|
|
552
|
-
}), /* @__PURE__ */
|
|
573
|
+
children: /* @__PURE__ */ l(g, { placeholder: c("healthybowl.crops.fieldDetail.capacity.cropPlaceholder", "Select crop") })
|
|
574
|
+
}), /* @__PURE__ */ l(p, { children: B.map((e) => /* @__PURE__ */ l(m, {
|
|
553
575
|
value: e.id,
|
|
554
576
|
children: e.variety ? `${e.name} - ${e.variety}` : e.name
|
|
555
577
|
}, e.id)) })]
|
|
556
578
|
})]
|
|
557
579
|
}),
|
|
558
|
-
|
|
580
|
+
j.length > 0 && /* @__PURE__ */ u("div", {
|
|
559
581
|
className: "xl:col-span-2",
|
|
560
|
-
children: [/* @__PURE__ */
|
|
582
|
+
children: [/* @__PURE__ */ l("label", {
|
|
561
583
|
className: "text-xs font-medium text-text-secondary",
|
|
562
|
-
children:
|
|
563
|
-
}), /* @__PURE__ */
|
|
564
|
-
value:
|
|
565
|
-
onValueChange:
|
|
566
|
-
children: [/* @__PURE__ */
|
|
584
|
+
children: c("healthybowl.crops.fieldDetail.capacity.catalog", "Master Plant List")
|
|
585
|
+
}), /* @__PURE__ */ u(f, {
|
|
586
|
+
value: M || "none",
|
|
587
|
+
onValueChange: Nt,
|
|
588
|
+
children: [/* @__PURE__ */ l(h, {
|
|
567
589
|
className: "mt-1 w-full",
|
|
568
|
-
children: /* @__PURE__ */
|
|
569
|
-
}), /* @__PURE__ */
|
|
590
|
+
children: /* @__PURE__ */ l(g, { placeholder: c("healthybowl.crops.fieldDetail.capacity.catalogPlaceholder", "Fill spacing from catalog") })
|
|
591
|
+
}), /* @__PURE__ */ u(p, { children: [/* @__PURE__ */ l(m, {
|
|
570
592
|
value: "none",
|
|
571
|
-
children:
|
|
572
|
-
}),
|
|
593
|
+
children: c("healthybowl.crops.fieldDetail.capacity.catalogNone", "None")
|
|
594
|
+
}), j.map((e) => /* @__PURE__ */ l(m, {
|
|
573
595
|
value: e.id,
|
|
574
596
|
children: e.variety ? `${e.name} - ${e.variety}` : e.name
|
|
575
597
|
}, e.id))] })]
|
|
576
598
|
})]
|
|
577
599
|
}),
|
|
578
|
-
/* @__PURE__ */
|
|
579
|
-
label:
|
|
600
|
+
/* @__PURE__ */ l(y, {
|
|
601
|
+
label: c("healthybowl.crops.fieldDetail.capacity.plantSpacing", "Plant spacing"),
|
|
580
602
|
unit: "cm",
|
|
581
|
-
value:
|
|
603
|
+
value: N,
|
|
582
604
|
min: "1",
|
|
583
605
|
step: "1",
|
|
584
|
-
onChange:
|
|
606
|
+
onChange: P
|
|
585
607
|
}),
|
|
586
|
-
/* @__PURE__ */
|
|
587
|
-
label:
|
|
608
|
+
/* @__PURE__ */ l(y, {
|
|
609
|
+
label: c("healthybowl.crops.fieldDetail.capacity.rowSpacing", "Row spacing"),
|
|
588
610
|
unit: "cm",
|
|
589
|
-
value:
|
|
611
|
+
value: Ct,
|
|
590
612
|
min: "1",
|
|
591
613
|
step: "1",
|
|
592
|
-
onChange:
|
|
614
|
+
onChange: F
|
|
593
615
|
}),
|
|
594
|
-
/* @__PURE__ */
|
|
595
|
-
label:
|
|
616
|
+
/* @__PURE__ */ l(y, {
|
|
617
|
+
label: c("healthybowl.crops.fieldDetail.capacity.bedWidth", "Bed width"),
|
|
596
618
|
unit: "m",
|
|
597
|
-
value:
|
|
619
|
+
value: I,
|
|
598
620
|
min: "0.1",
|
|
599
621
|
step: "0.1",
|
|
600
|
-
onChange:
|
|
622
|
+
onChange: wt
|
|
601
623
|
}),
|
|
602
|
-
/* @__PURE__ */
|
|
603
|
-
label:
|
|
624
|
+
/* @__PURE__ */ l(y, {
|
|
625
|
+
label: c("healthybowl.crops.fieldDetail.capacity.pathWidth", "Path width"),
|
|
604
626
|
unit: "m",
|
|
605
|
-
value:
|
|
627
|
+
value: L,
|
|
606
628
|
min: "0",
|
|
607
629
|
step: "0.05",
|
|
608
|
-
onChange:
|
|
630
|
+
onChange: Tt
|
|
609
631
|
})
|
|
610
632
|
]
|
|
611
633
|
}),
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
634
|
+
W ? /* @__PURE__ */ u(We, { children: [
|
|
635
|
+
/* @__PURE__ */ u("div", {
|
|
636
|
+
className: "mt-4 grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-6",
|
|
637
|
+
children: [
|
|
638
|
+
/* @__PURE__ */ l(b, {
|
|
639
|
+
label: c("healthybowl.crops.fieldDetail.capacity.metrics.beds", "Beds"),
|
|
640
|
+
value: t(W.bedCount)
|
|
641
|
+
}),
|
|
642
|
+
/* @__PURE__ */ l(b, {
|
|
643
|
+
label: c("healthybowl.crops.fieldDetail.capacity.metrics.rowsPerBed", "Rows / bed"),
|
|
644
|
+
value: t(W.rowsPerBed)
|
|
645
|
+
}),
|
|
646
|
+
/* @__PURE__ */ l(b, {
|
|
647
|
+
label: c("healthybowl.crops.fieldDetail.capacity.metrics.plantsPerBed", "Plants / bed"),
|
|
648
|
+
value: t(W.plantsPerBed)
|
|
649
|
+
}),
|
|
650
|
+
/* @__PURE__ */ l(b, {
|
|
651
|
+
label: c("healthybowl.crops.fieldDetail.capacity.metrics.totalPlants", "Total plants"),
|
|
652
|
+
value: t(W.totalPlants)
|
|
653
|
+
}),
|
|
654
|
+
/* @__PURE__ */ l(b, {
|
|
655
|
+
label: c("healthybowl.crops.fieldDetail.capacity.metrics.seedlings", "Seedlings"),
|
|
656
|
+
value: t(W.seedlingTarget)
|
|
657
|
+
}),
|
|
658
|
+
/* @__PURE__ */ l(b, {
|
|
659
|
+
label: c("healthybowl.crops.fieldDetail.capacity.metrics.bedLength", "Bed length"),
|
|
660
|
+
value: v(W.bedLengthM),
|
|
661
|
+
unit: "m"
|
|
662
|
+
}),
|
|
663
|
+
/* @__PURE__ */ l(b, {
|
|
664
|
+
label: c("healthybowl.crops.fieldDetail.capacity.metrics.density", "Density"),
|
|
665
|
+
value: v(W.densityPlantsPerSqm, 2),
|
|
666
|
+
unit: c("healthybowl.crops.fieldDetail.capacity.metrics.densityUnit", "plants/m²")
|
|
667
|
+
})
|
|
668
|
+
]
|
|
669
|
+
}),
|
|
670
|
+
K && /* @__PURE__ */ u("div", {
|
|
671
|
+
className: "mt-5 border-t border-border-subtle pt-4",
|
|
672
|
+
children: [
|
|
673
|
+
/* @__PURE__ */ u("h5", {
|
|
674
|
+
className: "mb-3 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
675
|
+
children: [
|
|
676
|
+
/* @__PURE__ */ l(Fe, { className: "h-3.5 w-3.5 text-success" }),
|
|
677
|
+
c("healthybowl.crops.fieldDetail.seedRate.heading", "Seed rate"),
|
|
678
|
+
G && /* @__PURE__ */ l("span", {
|
|
679
|
+
className: "rounded-full bg-success/10 px-2 py-0.5 text-[11px] font-medium normal-case text-success",
|
|
680
|
+
children: c("healthybowl.crops.fieldDetail.seedRate.fromCatalog", "from catalog")
|
|
681
|
+
})
|
|
682
|
+
]
|
|
683
|
+
}),
|
|
684
|
+
/* @__PURE__ */ u("div", {
|
|
685
|
+
className: "grid grid-cols-2 gap-3 md:grid-cols-3",
|
|
686
|
+
children: [
|
|
687
|
+
/* @__PURE__ */ l(b, {
|
|
688
|
+
label: c("healthybowl.crops.fieldDetail.seedRate.seedNeeded", "Seed needed"),
|
|
689
|
+
value: K.seedGrams == null ? "—" : v(K.seedGrams, 2),
|
|
690
|
+
unit: K.seedGrams == null ? void 0 : "g"
|
|
691
|
+
}),
|
|
692
|
+
/* @__PURE__ */ l(b, {
|
|
693
|
+
label: c("healthybowl.crops.fieldDetail.seedRate.seedlings", "Seedlings to raise"),
|
|
694
|
+
value: t(K.seedlingsToRaise)
|
|
695
|
+
}),
|
|
696
|
+
/* @__PURE__ */ l(b, {
|
|
697
|
+
label: c("healthybowl.crops.fieldDetail.seedRate.trays", "Trays"),
|
|
698
|
+
value: K.trays == null ? "—" : t(K.trays)
|
|
699
|
+
})
|
|
700
|
+
]
|
|
701
|
+
}),
|
|
702
|
+
K.seedGrams == null && /* @__PURE__ */ l("p", {
|
|
703
|
+
className: "mt-3 text-xs text-text-secondary",
|
|
704
|
+
children: c("healthybowl.crops.fieldDetail.seedRate.noSeedsPerGram", "Set “seeds per gram” for this variety in the Master Plant List to calculate seed weight in grams.")
|
|
705
|
+
})
|
|
706
|
+
]
|
|
707
|
+
}),
|
|
708
|
+
/* @__PURE__ */ u("div", {
|
|
709
|
+
className: "mt-5 border-t border-border-subtle pt-4",
|
|
710
|
+
children: [/* @__PURE__ */ u("div", {
|
|
711
|
+
className: "flex flex-wrap items-center justify-between gap-2",
|
|
712
|
+
children: [/* @__PURE__ */ u("h5", {
|
|
713
|
+
className: "flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
714
|
+
children: [/* @__PURE__ */ l(Le, { className: "h-3.5 w-3.5 text-success" }), c("healthybowl.crops.fieldDetail.compare.heading", "Compare crops for this field")]
|
|
715
|
+
}), Y.length > 0 && /* @__PURE__ */ u("span", {
|
|
716
|
+
className: "text-xs text-text-secondary",
|
|
717
|
+
children: [
|
|
718
|
+
t(Y.length),
|
|
719
|
+
" ",
|
|
720
|
+
c("healthybowl.crops.fieldDetail.compare.varieties", "varieties")
|
|
721
|
+
]
|
|
722
|
+
})]
|
|
723
|
+
}), Y.length > 0 ? /* @__PURE__ */ u(We, { children: [
|
|
724
|
+
/* @__PURE__ */ l("p", {
|
|
725
|
+
className: "mt-1 text-xs text-text-secondary",
|
|
726
|
+
children: c("healthybowl.crops.fieldDetail.compare.description", "What each variety in your Master Plant List would need on this field, at the bed and path widths above.")
|
|
727
|
+
}),
|
|
728
|
+
/* @__PURE__ */ l("div", {
|
|
729
|
+
className: "mt-3 overflow-x-auto rounded-md border border-border-subtle",
|
|
730
|
+
children: /* @__PURE__ */ u("table", {
|
|
731
|
+
className: "w-full min-w-[680px] border-collapse text-sm",
|
|
732
|
+
children: [/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ u("tr", {
|
|
733
|
+
className: "border-b border-border-subtle bg-bg-sunken/60",
|
|
734
|
+
children: [
|
|
735
|
+
/* @__PURE__ */ l(x, {
|
|
736
|
+
label: c("healthybowl.crops.fieldDetail.compare.crop", "Crop"),
|
|
737
|
+
sortKey: "label",
|
|
738
|
+
activeKey: q,
|
|
739
|
+
direction: J,
|
|
740
|
+
onSort: X
|
|
741
|
+
}),
|
|
742
|
+
/* @__PURE__ */ l("th", {
|
|
743
|
+
scope: "col",
|
|
744
|
+
className: "whitespace-nowrap px-3 py-2 text-right text-xs font-medium text-text-secondary",
|
|
745
|
+
children: c("healthybowl.crops.fieldDetail.compare.spacing", "Spacing")
|
|
746
|
+
}),
|
|
747
|
+
/* @__PURE__ */ l("th", {
|
|
748
|
+
scope: "col",
|
|
749
|
+
className: "whitespace-nowrap px-3 py-2 text-right text-xs font-medium text-text-secondary",
|
|
750
|
+
children: c("healthybowl.crops.fieldDetail.compare.beds", "Beds")
|
|
751
|
+
}),
|
|
752
|
+
/* @__PURE__ */ l(x, {
|
|
753
|
+
label: c("healthybowl.crops.fieldDetail.compare.totalPlants", "Total plants"),
|
|
754
|
+
sortKey: "totalPlants",
|
|
755
|
+
activeKey: q,
|
|
756
|
+
direction: J,
|
|
757
|
+
onSort: X,
|
|
758
|
+
align: "right"
|
|
759
|
+
}),
|
|
760
|
+
/* @__PURE__ */ l(x, {
|
|
761
|
+
label: c("healthybowl.crops.fieldDetail.compare.seed", "Seed needed"),
|
|
762
|
+
sortKey: "seedGrams",
|
|
763
|
+
activeKey: q,
|
|
764
|
+
direction: J,
|
|
765
|
+
onSort: X,
|
|
766
|
+
align: "right"
|
|
767
|
+
}),
|
|
768
|
+
/* @__PURE__ */ l(x, {
|
|
769
|
+
label: c("healthybowl.crops.fieldDetail.compare.trays", "Trays"),
|
|
770
|
+
sortKey: "trays",
|
|
771
|
+
activeKey: q,
|
|
772
|
+
direction: J,
|
|
773
|
+
onSort: X,
|
|
774
|
+
align: "right"
|
|
775
|
+
}),
|
|
776
|
+
/* @__PURE__ */ l(x, {
|
|
777
|
+
label: c("healthybowl.crops.fieldDetail.compare.maturity", "Days to maturity"),
|
|
778
|
+
sortKey: "daysToMaturity",
|
|
779
|
+
activeKey: q,
|
|
780
|
+
direction: J,
|
|
781
|
+
onSort: X,
|
|
782
|
+
align: "right"
|
|
783
|
+
})
|
|
784
|
+
]
|
|
785
|
+
}) }), /* @__PURE__ */ l("tbody", { children: Y.map((e) => /* @__PURE__ */ u("tr", {
|
|
786
|
+
className: `border-b border-border-subtle last:border-b-0 ${G?.id === e.id ? "bg-success/5" : ""}`,
|
|
787
|
+
children: [
|
|
788
|
+
/* @__PURE__ */ u("td", {
|
|
789
|
+
className: "px-3 py-2",
|
|
790
|
+
children: [/* @__PURE__ */ l("span", {
|
|
791
|
+
className: "font-medium text-text-primary",
|
|
792
|
+
children: e.label
|
|
793
|
+
}), !e.spacingFromCatalog && /* @__PURE__ */ l("span", {
|
|
794
|
+
className: "ml-2 whitespace-nowrap rounded-full bg-bg-sunken px-1.5 py-0.5 text-[10px] text-text-secondary",
|
|
795
|
+
title: e.presetLabel,
|
|
796
|
+
children: c("healthybowl.crops.fieldDetail.compare.presetSpacing", "preset spacing")
|
|
797
|
+
})]
|
|
798
|
+
}),
|
|
799
|
+
/* @__PURE__ */ u("td", {
|
|
800
|
+
className: "whitespace-nowrap px-3 py-2 text-right tabular-nums text-text-secondary",
|
|
801
|
+
children: [
|
|
802
|
+
e.plantSpacingCm,
|
|
803
|
+
"×",
|
|
804
|
+
e.rowSpacingCm,
|
|
805
|
+
" cm"
|
|
806
|
+
]
|
|
807
|
+
}),
|
|
808
|
+
/* @__PURE__ */ l("td", {
|
|
809
|
+
className: "px-3 py-2 text-right tabular-nums text-text-secondary",
|
|
810
|
+
children: t(e.capacity.bedCount)
|
|
811
|
+
}),
|
|
812
|
+
/* @__PURE__ */ l("td", {
|
|
813
|
+
className: "px-3 py-2 text-right font-medium tabular-nums text-text-primary",
|
|
814
|
+
children: t(e.capacity.totalPlants)
|
|
815
|
+
}),
|
|
816
|
+
/* @__PURE__ */ l("td", {
|
|
817
|
+
className: "whitespace-nowrap px-3 py-2 text-right tabular-nums text-text-secondary",
|
|
818
|
+
children: e.seed.seedGrams == null ? "—" : `${v(e.seed.seedGrams, 2)} g`
|
|
819
|
+
}),
|
|
820
|
+
/* @__PURE__ */ l("td", {
|
|
821
|
+
className: "px-3 py-2 text-right tabular-nums text-text-secondary",
|
|
822
|
+
children: e.seed.trays == null ? "—" : t(e.seed.trays)
|
|
823
|
+
}),
|
|
824
|
+
/* @__PURE__ */ l("td", {
|
|
825
|
+
className: "px-3 py-2 text-right tabular-nums text-text-secondary",
|
|
826
|
+
children: e.daysToMaturity == null ? "—" : t(e.daysToMaturity)
|
|
827
|
+
})
|
|
828
|
+
]
|
|
829
|
+
}, e.id)) })]
|
|
675
830
|
})
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
})
|
|
682
|
-
|
|
683
|
-
|
|
831
|
+
}),
|
|
832
|
+
/* @__PURE__ */ l("p", {
|
|
833
|
+
className: "mt-2 text-xs text-text-secondary",
|
|
834
|
+
children: c("healthybowl.crops.fieldDetail.compare.footnote", "A dash means the variety has no seeds-per-gram recorded yet. “Preset spacing” means the figures use a crop-family default rather than spacing you have recorded.")
|
|
835
|
+
})
|
|
836
|
+
] }) : /* @__PURE__ */ l("p", {
|
|
837
|
+
className: "mt-3 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-xs text-text-secondary",
|
|
838
|
+
children: c("healthybowl.crops.fieldDetail.compare.empty", "Add varieties to your Master Plant List to compare beds and seed across crops for this field.")
|
|
839
|
+
})]
|
|
840
|
+
})
|
|
841
|
+
] }) : /* @__PURE__ */ l("p", {
|
|
684
842
|
className: "mt-4 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-sm text-text-secondary",
|
|
685
|
-
children:
|
|
843
|
+
children: c("healthybowl.crops.fieldDetail.capacity.empty", "Draw a boundary on the map above, or set this field’s area, to calculate beds and plants.")
|
|
686
844
|
})
|
|
687
845
|
]
|
|
688
846
|
})
|
|
689
847
|
]
|
|
690
848
|
}),
|
|
691
|
-
/* @__PURE__ */
|
|
849
|
+
/* @__PURE__ */ u("div", {
|
|
692
850
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
693
851
|
children: [
|
|
694
|
-
/* @__PURE__ */
|
|
852
|
+
/* @__PURE__ */ u("div", {
|
|
695
853
|
className: "mb-4",
|
|
696
|
-
children: [/* @__PURE__ */
|
|
854
|
+
children: [/* @__PURE__ */ u("h3", {
|
|
697
855
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
698
856
|
children: [
|
|
699
|
-
/* @__PURE__ */
|
|
857
|
+
/* @__PURE__ */ l(Fe, { className: "h-4 w-4 text-success" }),
|
|
700
858
|
" ",
|
|
701
|
-
|
|
859
|
+
c("healthybowl.crops.fieldDetail.succession.heading", "Succession planting")
|
|
702
860
|
]
|
|
703
|
-
}), /* @__PURE__ */
|
|
861
|
+
}), /* @__PURE__ */ l("p", {
|
|
704
862
|
className: "mt-1 text-xs text-text-secondary",
|
|
705
|
-
children:
|
|
863
|
+
children: c("healthybowl.crops.fieldDetail.succession.description", "Generate a series of staggered sowings for a steady, continuous harvest. Uses the crop and seed-rate above.")
|
|
706
864
|
})]
|
|
707
865
|
}),
|
|
708
|
-
/* @__PURE__ */
|
|
866
|
+
/* @__PURE__ */ u("div", {
|
|
709
867
|
className: "grid gap-3 md:grid-cols-2 xl:grid-cols-4",
|
|
710
868
|
children: [
|
|
711
|
-
/* @__PURE__ */
|
|
869
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
712
870
|
className: "text-xs font-medium text-text-secondary",
|
|
713
|
-
children:
|
|
714
|
-
}), /* @__PURE__ */
|
|
871
|
+
children: c("healthybowl.crops.fieldDetail.succession.startDate", "Start date")
|
|
872
|
+
}), /* @__PURE__ */ l("input", {
|
|
715
873
|
type: "date",
|
|
716
874
|
value: Z,
|
|
717
|
-
onChange: (e) =>
|
|
875
|
+
onChange: (e) => Vt(e.target.value),
|
|
718
876
|
className: "mt-1 h-10 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
719
877
|
})] }),
|
|
720
|
-
/* @__PURE__ */
|
|
721
|
-
label:
|
|
722
|
-
unit:
|
|
723
|
-
value:
|
|
878
|
+
/* @__PURE__ */ l(y, {
|
|
879
|
+
label: c("healthybowl.crops.fieldDetail.succession.interval", "Interval"),
|
|
880
|
+
unit: c("healthybowl.crops.fieldDetail.succession.days", "days"),
|
|
881
|
+
value: Ht,
|
|
724
882
|
min: "1",
|
|
725
883
|
step: "1",
|
|
726
|
-
onChange:
|
|
884
|
+
onChange: Ut
|
|
727
885
|
}),
|
|
728
|
-
/* @__PURE__ */
|
|
729
|
-
label:
|
|
730
|
-
unit:
|
|
731
|
-
value:
|
|
886
|
+
/* @__PURE__ */ l(y, {
|
|
887
|
+
label: c("healthybowl.crops.fieldDetail.succession.count", "Number of sowings"),
|
|
888
|
+
unit: c("healthybowl.crops.fieldDetail.succession.sowings", "sowings"),
|
|
889
|
+
value: Wt,
|
|
732
890
|
min: "1",
|
|
733
891
|
step: "1",
|
|
734
|
-
onChange:
|
|
892
|
+
onChange: Gt
|
|
735
893
|
}),
|
|
736
|
-
|
|
894
|
+
Rt.length > 0 && /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
737
895
|
className: "text-xs font-medium text-text-secondary",
|
|
738
|
-
children:
|
|
739
|
-
}), /* @__PURE__ */
|
|
740
|
-
value:
|
|
741
|
-
onValueChange: (e) =>
|
|
742
|
-
children: [/* @__PURE__ */
|
|
896
|
+
children: c("healthybowl.crops.fieldDetail.succession.bed", "Bed (optional)")
|
|
897
|
+
}), /* @__PURE__ */ u(f, {
|
|
898
|
+
value: Kt || "none",
|
|
899
|
+
onValueChange: (e) => qt(e === "none" ? "" : e),
|
|
900
|
+
children: [/* @__PURE__ */ l(h, {
|
|
743
901
|
className: "mt-1 w-full",
|
|
744
|
-
children: /* @__PURE__ */
|
|
745
|
-
}), /* @__PURE__ */
|
|
902
|
+
children: /* @__PURE__ */ l(g, { placeholder: c("healthybowl.crops.fieldDetail.succession.bedPlaceholder", "No specific bed") })
|
|
903
|
+
}), /* @__PURE__ */ u(p, { children: [/* @__PURE__ */ l(m, {
|
|
746
904
|
value: "none",
|
|
747
|
-
children:
|
|
748
|
-
}),
|
|
905
|
+
children: c("healthybowl.crops.fieldDetail.succession.bedNone", "No specific bed")
|
|
906
|
+
}), Rt.map((e) => /* @__PURE__ */ l(m, {
|
|
749
907
|
value: e.id,
|
|
750
908
|
children: e.name
|
|
751
909
|
}, e.id))] })]
|
|
752
910
|
})] })
|
|
753
911
|
]
|
|
754
912
|
}),
|
|
755
|
-
/* @__PURE__ */
|
|
913
|
+
/* @__PURE__ */ u("div", {
|
|
756
914
|
className: "mt-4 flex flex-wrap items-center justify-between gap-3",
|
|
757
|
-
children: [/* @__PURE__ */
|
|
915
|
+
children: [/* @__PURE__ */ l("p", {
|
|
758
916
|
className: "text-xs text-text-secondary",
|
|
759
|
-
children:
|
|
760
|
-
}), /* @__PURE__ */
|
|
761
|
-
onClick:
|
|
762
|
-
disabled:
|
|
763
|
-
children: [/* @__PURE__ */
|
|
917
|
+
children: V ? c("healthybowl.crops.fieldDetail.succession.forCrop", "For: {{crop}}", { crop: V.variety ? `${V.name} - ${V.variety}` : V.name }) : c("healthybowl.crops.fieldDetail.succession.noCrop", "Select a crop in the capacity planner above.")
|
|
918
|
+
}), /* @__PURE__ */ u(d, {
|
|
919
|
+
onClick: Qt,
|
|
920
|
+
disabled: Jt,
|
|
921
|
+
children: [/* @__PURE__ */ l(Pe, { className: "h-4 w-4" }), Jt ? c("healthybowl.crops.fieldDetail.succession.generating", "Generating...") : c("healthybowl.crops.fieldDetail.succession.generate", "Generate schedule")]
|
|
764
922
|
})]
|
|
765
923
|
}),
|
|
766
|
-
|
|
924
|
+
Xt.length > 0 ? /* @__PURE__ */ l("div", {
|
|
767
925
|
className: "mt-5 space-y-5 border-t border-border-subtle pt-5",
|
|
768
|
-
children:
|
|
926
|
+
children: Xt.map(([n, r]) => /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("div", {
|
|
769
927
|
className: "mb-2 flex items-center justify-between",
|
|
770
|
-
children: [/* @__PURE__ */
|
|
928
|
+
children: [/* @__PURE__ */ l("h4", {
|
|
771
929
|
className: "text-sm font-semibold text-text-primary",
|
|
772
|
-
children: r[0] ?
|
|
773
|
-
}), /* @__PURE__ */
|
|
930
|
+
children: r[0] ? Zt(r[0]) : c("healthybowl.crops.fieldDetail.succession.series", "Succession series")
|
|
931
|
+
}), /* @__PURE__ */ l("span", {
|
|
774
932
|
className: "text-xs text-text-secondary",
|
|
775
|
-
children:
|
|
933
|
+
children: c("healthybowl.crops.fieldDetail.succession.sowingCount", "{{count}} sowings", { count: r.length })
|
|
776
934
|
})]
|
|
777
|
-
}), /* @__PURE__ */
|
|
935
|
+
}), /* @__PURE__ */ l("div", {
|
|
778
936
|
className: "space-y-2",
|
|
779
|
-
children: r.map((n, r) => /* @__PURE__ */
|
|
937
|
+
children: r.map((n, r) => /* @__PURE__ */ u("div", {
|
|
780
938
|
className: "flex items-center justify-between rounded-md border border-border-subtle p-3",
|
|
781
|
-
children: [/* @__PURE__ */
|
|
939
|
+
children: [/* @__PURE__ */ u("div", {
|
|
782
940
|
className: "flex items-center gap-3",
|
|
783
|
-
children: [/* @__PURE__ */
|
|
941
|
+
children: [/* @__PURE__ */ l("div", {
|
|
784
942
|
className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-success/10 text-xs font-semibold text-success",
|
|
785
943
|
children: (n.successionIndex ?? r) + 1
|
|
786
|
-
}), /* @__PURE__ */
|
|
944
|
+
}), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("p", {
|
|
787
945
|
className: "text-sm font-medium text-text-primary",
|
|
788
946
|
children: [
|
|
789
|
-
|
|
947
|
+
c("healthybowl.crops.fieldDetail.succession.sowingLabel", "Sowing {{n}}", { n: (n.successionIndex ?? r) + 1 }),
|
|
790
948
|
" ",
|
|
791
949
|
"— ",
|
|
792
950
|
e(n.sowDate ?? n.startDate)
|
|
793
951
|
]
|
|
794
|
-
}), n.seedlingsToRaise != null && /* @__PURE__ */
|
|
952
|
+
}), n.seedlingsToRaise != null && /* @__PURE__ */ l("p", {
|
|
795
953
|
className: "text-xs text-text-secondary",
|
|
796
|
-
children:
|
|
954
|
+
children: c("healthybowl.crops.fieldDetail.succession.sowingMeta", "{{seedlings}} seedlings{{grams}}", {
|
|
797
955
|
seedlings: t(n.seedlingsToRaise),
|
|
798
|
-
grams: n.seedGrams == null ? "" : ` · ${
|
|
956
|
+
grams: n.seedGrams == null ? "" : ` · ${v(n.seedGrams, 2)} g seed`
|
|
799
957
|
})
|
|
800
958
|
})] })]
|
|
801
|
-
}), /* @__PURE__ */
|
|
959
|
+
}), /* @__PURE__ */ l(d, {
|
|
802
960
|
variant: "ghost",
|
|
803
961
|
size: "icon-sm",
|
|
804
|
-
onClick: () => void
|
|
805
|
-
"aria-label":
|
|
962
|
+
onClick: () => void $t(n),
|
|
963
|
+
"aria-label": c("healthybowl.common.delete", "Delete"),
|
|
806
964
|
className: "text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text",
|
|
807
|
-
children: /* @__PURE__ */
|
|
965
|
+
children: /* @__PURE__ */ l(ze, { className: "h-4 w-4" })
|
|
808
966
|
})]
|
|
809
967
|
}, n.id))
|
|
810
968
|
})] }, n))
|
|
811
|
-
}) : /* @__PURE__ */
|
|
969
|
+
}) : /* @__PURE__ */ l("p", {
|
|
812
970
|
className: "mt-5 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-sm text-text-secondary",
|
|
813
|
-
children:
|
|
971
|
+
children: c("healthybowl.crops.fieldDetail.succession.empty", "No succession schedules yet. Set a start date, interval and number of sowings, then generate a series.")
|
|
814
972
|
})
|
|
815
973
|
]
|
|
816
974
|
}),
|
|
817
|
-
/* @__PURE__ */
|
|
975
|
+
/* @__PURE__ */ u("div", {
|
|
818
976
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
819
|
-
children: [/* @__PURE__ */
|
|
977
|
+
children: [/* @__PURE__ */ u("h3", {
|
|
820
978
|
className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
821
979
|
children: [
|
|
822
|
-
/* @__PURE__ */
|
|
980
|
+
/* @__PURE__ */ l(Me, { className: "h-4 w-4 text-success" }),
|
|
823
981
|
" ",
|
|
824
|
-
|
|
982
|
+
c("healthybowl.crops.fieldDetail.currentCrops.heading", "Current Crops")
|
|
825
983
|
]
|
|
826
|
-
}),
|
|
984
|
+
}), z.length > 0 ? /* @__PURE__ */ l("div", {
|
|
827
985
|
className: "flex flex-col gap-3",
|
|
828
|
-
children:
|
|
986
|
+
children: z.map((e) => /* @__PURE__ */ u("div", {
|
|
829
987
|
onClick: () => C(w(`crops/${e.id}`)),
|
|
830
988
|
className: "flex cursor-pointer items-center justify-between rounded-md border border-border-subtle p-3 transition-colors hover:bg-bg-sunken/50",
|
|
831
|
-
children: [/* @__PURE__ */
|
|
832
|
-
/* @__PURE__ */
|
|
989
|
+
children: [/* @__PURE__ */ u("div", { children: [
|
|
990
|
+
/* @__PURE__ */ l("span", {
|
|
833
991
|
className: "text-sm font-medium text-text-primary",
|
|
834
992
|
children: e.name
|
|
835
993
|
}),
|
|
836
|
-
/* @__PURE__ */
|
|
994
|
+
/* @__PURE__ */ l("span", {
|
|
837
995
|
className: "ml-2 text-xs text-text-secondary",
|
|
838
996
|
children: e.variety
|
|
839
997
|
}),
|
|
840
|
-
/* @__PURE__ */
|
|
998
|
+
/* @__PURE__ */ u("div", {
|
|
841
999
|
className: "mt-1 flex items-center gap-2",
|
|
842
|
-
children: [/* @__PURE__ */
|
|
1000
|
+
children: [/* @__PURE__ */ l("div", {
|
|
843
1001
|
className: "h-1.5 w-24 rounded-full bg-bg-sunken",
|
|
844
|
-
children: /* @__PURE__ */
|
|
1002
|
+
children: /* @__PURE__ */ l("div", {
|
|
845
1003
|
className: "h-1.5 rounded-full bg-action-primary-bg",
|
|
846
1004
|
style: { width: `${e.progress}%` }
|
|
847
1005
|
})
|
|
848
|
-
}), /* @__PURE__ */
|
|
1006
|
+
}), /* @__PURE__ */ u("span", {
|
|
849
1007
|
className: "text-xs text-text-secondary",
|
|
850
1008
|
children: [e.progress, "%"]
|
|
851
1009
|
})]
|
|
852
1010
|
})
|
|
853
|
-
] }), /* @__PURE__ */
|
|
1011
|
+
] }), /* @__PURE__ */ u("div", {
|
|
854
1012
|
className: "flex items-center gap-2",
|
|
855
|
-
children: [/* @__PURE__ */
|
|
1013
|
+
children: [/* @__PURE__ */ l(i, {
|
|
856
1014
|
label: e.growthStage,
|
|
857
1015
|
variant: "info"
|
|
858
|
-
}), /* @__PURE__ */
|
|
1016
|
+
}), /* @__PURE__ */ u("span", {
|
|
859
1017
|
className: "text-xs text-text-secondary",
|
|
860
1018
|
children: [e.daysToHarvest, "d"]
|
|
861
1019
|
})]
|
|
862
1020
|
})]
|
|
863
1021
|
}, e.id))
|
|
864
|
-
}) : /* @__PURE__ */
|
|
1022
|
+
}) : /* @__PURE__ */ l("p", {
|
|
865
1023
|
className: "text-sm text-text-secondary",
|
|
866
|
-
children:
|
|
1024
|
+
children: c("healthybowl.crops.fieldDetail.currentCrops.empty", "No crops currently planted.")
|
|
867
1025
|
})]
|
|
868
1026
|
}),
|
|
869
|
-
Q && /* @__PURE__ */
|
|
1027
|
+
Q && /* @__PURE__ */ u("div", {
|
|
870
1028
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
871
1029
|
children: [
|
|
872
|
-
/* @__PURE__ */
|
|
1030
|
+
/* @__PURE__ */ u("div", {
|
|
873
1031
|
className: "mb-4 flex items-center justify-between",
|
|
874
|
-
children: [/* @__PURE__ */
|
|
1032
|
+
children: [/* @__PURE__ */ u("h3", {
|
|
875
1033
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
876
1034
|
children: [
|
|
877
|
-
/* @__PURE__ */
|
|
1035
|
+
/* @__PURE__ */ l(Ce, { className: "h-4 w-4 text-warning" }),
|
|
878
1036
|
" ",
|
|
879
|
-
|
|
1037
|
+
c("healthybowl.crops.fieldDetail.soilHealth.heading", "Soil Health")
|
|
880
1038
|
]
|
|
881
|
-
}), /* @__PURE__ */
|
|
1039
|
+
}), /* @__PURE__ */ l(i, {
|
|
882
1040
|
label: (Q.status ?? "unknown").replace("_", " "),
|
|
883
|
-
variant:
|
|
1041
|
+
variant: qe(Q.status ?? "unknown")
|
|
884
1042
|
})]
|
|
885
1043
|
}),
|
|
886
|
-
/* @__PURE__ */
|
|
1044
|
+
/* @__PURE__ */ l("div", {
|
|
887
1045
|
className: "grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-6",
|
|
888
1046
|
children: [
|
|
889
1047
|
{
|
|
890
1048
|
key: "pH",
|
|
891
|
-
label:
|
|
1049
|
+
label: c("healthybowl.crops.fieldDetail.soilHealth.metrics.ph", "pH"),
|
|
892
1050
|
value: Q.ph.toString(),
|
|
893
1051
|
good: Q.ph >= 6 && Q.ph <= 7.5
|
|
894
1052
|
},
|
|
895
1053
|
{
|
|
896
1054
|
key: "Nitrogen",
|
|
897
|
-
label:
|
|
1055
|
+
label: c("healthybowl.crops.fieldDetail.soilHealth.metrics.nitrogen", "Nitrogen"),
|
|
898
1056
|
value: `${Q.nitrogen} ppm`,
|
|
899
1057
|
good: Q.nitrogen >= 30
|
|
900
1058
|
},
|
|
901
1059
|
{
|
|
902
1060
|
key: "Phosphorus",
|
|
903
|
-
label:
|
|
1061
|
+
label: c("healthybowl.crops.fieldDetail.soilHealth.metrics.phosphorus", "Phosphorus"),
|
|
904
1062
|
value: `${Q.phosphorus} ppm`,
|
|
905
1063
|
good: Q.phosphorus >= 25
|
|
906
1064
|
},
|
|
907
1065
|
{
|
|
908
1066
|
key: "Potassium",
|
|
909
|
-
label:
|
|
1067
|
+
label: c("healthybowl.crops.fieldDetail.soilHealth.metrics.potassium", "Potassium"),
|
|
910
1068
|
value: `${Q.potassium} ppm`,
|
|
911
1069
|
good: Q.potassium >= 150
|
|
912
1070
|
},
|
|
913
1071
|
{
|
|
914
1072
|
key: "Organic Matter",
|
|
915
|
-
label:
|
|
1073
|
+
label: c("healthybowl.crops.fieldDetail.soilHealth.metrics.organicMatter", "Organic Matter"),
|
|
916
1074
|
value: `${Q.organicMatter}%`,
|
|
917
1075
|
good: Q.organicMatter >= 3
|
|
918
1076
|
},
|
|
919
1077
|
{
|
|
920
1078
|
key: "Moisture",
|
|
921
|
-
label:
|
|
1079
|
+
label: c("healthybowl.crops.fieldDetail.soilHealth.metrics.moisture", "Moisture"),
|
|
922
1080
|
value: `${Q.moisture}%`,
|
|
923
1081
|
good: Q.moisture >= 20 && Q.moisture <= 40
|
|
924
1082
|
}
|
|
925
|
-
].map(({ key: e, label: t, value: n, good: r }) => /* @__PURE__ */
|
|
1083
|
+
].map(({ key: e, label: t, value: n, good: r }) => /* @__PURE__ */ u("div", {
|
|
926
1084
|
className: "text-center",
|
|
927
|
-
children: [/* @__PURE__ */
|
|
1085
|
+
children: [/* @__PURE__ */ l("span", {
|
|
928
1086
|
className: "text-xs text-text-secondary",
|
|
929
1087
|
children: t
|
|
930
|
-
}), /* @__PURE__ */
|
|
1088
|
+
}), /* @__PURE__ */ l("p", {
|
|
931
1089
|
className: `text-sm font-semibold ${r ? "text-success" : "text-warning"}`,
|
|
932
1090
|
children: n
|
|
933
1091
|
})]
|
|
934
1092
|
}, e))
|
|
935
1093
|
}),
|
|
936
|
-
Q.recommendations.length > 0 && /* @__PURE__ */
|
|
1094
|
+
Q.recommendations.length > 0 && /* @__PURE__ */ u("div", {
|
|
937
1095
|
className: "mt-4 border-t border-border-subtle pt-4",
|
|
938
|
-
children: [/* @__PURE__ */
|
|
1096
|
+
children: [/* @__PURE__ */ l("h4", {
|
|
939
1097
|
className: "mb-2 text-xs font-medium text-text-secondary",
|
|
940
|
-
children:
|
|
941
|
-
}), /* @__PURE__ */
|
|
1098
|
+
children: c("healthybowl.crops.fieldDetail.soilHealth.recommendations", "Recommendations")
|
|
1099
|
+
}), /* @__PURE__ */ l("ul", {
|
|
942
1100
|
className: "space-y-1",
|
|
943
|
-
children: Q.recommendations.map((e, t) => /* @__PURE__ */
|
|
1101
|
+
children: Q.recommendations.map((e, t) => /* @__PURE__ */ u("li", {
|
|
944
1102
|
className: "text-xs text-text-primary",
|
|
945
1103
|
children: ["- ", e]
|
|
946
1104
|
}, t))
|
|
@@ -948,26 +1106,26 @@ var He = (e) => {
|
|
|
948
1106
|
})
|
|
949
1107
|
]
|
|
950
1108
|
}),
|
|
951
|
-
/* @__PURE__ */
|
|
1109
|
+
/* @__PURE__ */ u("div", {
|
|
952
1110
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
953
|
-
children: [/* @__PURE__ */
|
|
1111
|
+
children: [/* @__PURE__ */ u("h3", {
|
|
954
1112
|
className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
955
1113
|
children: [
|
|
956
|
-
/* @__PURE__ */
|
|
1114
|
+
/* @__PURE__ */ l(Ee, { className: "h-4 w-4 text-info" }),
|
|
957
1115
|
" ",
|
|
958
|
-
|
|
1116
|
+
c("healthybowl.crops.fieldDetail.cropHistory.heading", "Crop History")
|
|
959
1117
|
]
|
|
960
|
-
}), /* @__PURE__ */
|
|
1118
|
+
}), /* @__PURE__ */ l("div", {
|
|
961
1119
|
className: "space-y-3",
|
|
962
|
-
children:
|
|
1120
|
+
children: tn.map((e, t) => /* @__PURE__ */ u("div", {
|
|
963
1121
|
className: "flex items-center justify-between rounded-md border border-border-subtle p-3",
|
|
964
|
-
children: [/* @__PURE__ */
|
|
1122
|
+
children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
|
|
965
1123
|
className: "text-sm font-medium text-text-primary",
|
|
966
1124
|
children: e.crop
|
|
967
|
-
}), /* @__PURE__ */
|
|
1125
|
+
}), /* @__PURE__ */ l("p", {
|
|
968
1126
|
className: "text-xs text-text-secondary",
|
|
969
1127
|
children: e.season
|
|
970
|
-
})] }), /* @__PURE__ */
|
|
1128
|
+
})] }), /* @__PURE__ */ l(i, {
|
|
971
1129
|
label: e.status,
|
|
972
1130
|
variant: e.status === "active" ? "success" : "muted"
|
|
973
1131
|
})]
|
|
@@ -975,87 +1133,87 @@ var He = (e) => {
|
|
|
975
1133
|
})]
|
|
976
1134
|
})
|
|
977
1135
|
]
|
|
978
|
-
}), /* @__PURE__ */
|
|
1136
|
+
}), /* @__PURE__ */ u("div", {
|
|
979
1137
|
className: "space-y-6",
|
|
980
1138
|
children: [
|
|
981
|
-
/* @__PURE__ */
|
|
1139
|
+
/* @__PURE__ */ u("div", {
|
|
982
1140
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
983
|
-
children: [/* @__PURE__ */
|
|
1141
|
+
children: [/* @__PURE__ */ u("h3", {
|
|
984
1142
|
className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
985
1143
|
children: [
|
|
986
|
-
/* @__PURE__ */
|
|
1144
|
+
/* @__PURE__ */ l(Oe, { className: "h-4 w-4 text-info" }),
|
|
987
1145
|
" ",
|
|
988
|
-
|
|
1146
|
+
c("healthybowl.crops.fieldDetail.weather.heading", "Current Conditions")
|
|
989
1147
|
]
|
|
990
|
-
}), /* @__PURE__ */
|
|
1148
|
+
}), /* @__PURE__ */ u("div", {
|
|
991
1149
|
className: "space-y-3",
|
|
992
1150
|
children: [
|
|
993
|
-
/* @__PURE__ */
|
|
1151
|
+
/* @__PURE__ */ u("div", {
|
|
994
1152
|
className: "flex items-center justify-between",
|
|
995
|
-
children: [/* @__PURE__ */
|
|
1153
|
+
children: [/* @__PURE__ */ u("span", {
|
|
996
1154
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
997
1155
|
children: [
|
|
998
|
-
/* @__PURE__ */
|
|
1156
|
+
/* @__PURE__ */ l(Re, { className: "h-3.5 w-3.5" }),
|
|
999
1157
|
" ",
|
|
1000
|
-
|
|
1158
|
+
c("healthybowl.crops.fieldDetail.weather.temperature", "Temperature")
|
|
1001
1159
|
]
|
|
1002
|
-
}), /* @__PURE__ */
|
|
1160
|
+
}), /* @__PURE__ */ u("span", {
|
|
1003
1161
|
className: "text-sm font-medium text-text-primary",
|
|
1004
1162
|
children: [$.current.temperature, "°C"]
|
|
1005
1163
|
})]
|
|
1006
1164
|
}),
|
|
1007
|
-
/* @__PURE__ */
|
|
1165
|
+
/* @__PURE__ */ u("div", {
|
|
1008
1166
|
className: "flex items-center justify-between",
|
|
1009
|
-
children: [/* @__PURE__ */
|
|
1167
|
+
children: [/* @__PURE__ */ u("span", {
|
|
1010
1168
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1011
1169
|
children: [
|
|
1012
|
-
/* @__PURE__ */
|
|
1170
|
+
/* @__PURE__ */ l(ke, { className: "h-3.5 w-3.5" }),
|
|
1013
1171
|
" ",
|
|
1014
|
-
|
|
1172
|
+
c("healthybowl.crops.fieldDetail.weather.humidity", "Humidity")
|
|
1015
1173
|
]
|
|
1016
|
-
}), /* @__PURE__ */
|
|
1174
|
+
}), /* @__PURE__ */ u("span", {
|
|
1017
1175
|
className: "text-sm font-medium text-text-primary",
|
|
1018
1176
|
children: [$.current.humidity, "%"]
|
|
1019
1177
|
})]
|
|
1020
1178
|
}),
|
|
1021
|
-
/* @__PURE__ */
|
|
1179
|
+
/* @__PURE__ */ u("div", {
|
|
1022
1180
|
className: "flex items-center justify-between",
|
|
1023
|
-
children: [/* @__PURE__ */
|
|
1181
|
+
children: [/* @__PURE__ */ u("span", {
|
|
1024
1182
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1025
1183
|
children: [
|
|
1026
|
-
/* @__PURE__ */
|
|
1184
|
+
/* @__PURE__ */ l(Ve, { className: "h-3.5 w-3.5" }),
|
|
1027
1185
|
" ",
|
|
1028
|
-
|
|
1186
|
+
c("healthybowl.crops.fieldDetail.weather.wind", "Wind")
|
|
1029
1187
|
]
|
|
1030
|
-
}), /* @__PURE__ */
|
|
1188
|
+
}), /* @__PURE__ */ u("span", {
|
|
1031
1189
|
className: "text-sm font-medium text-text-primary",
|
|
1032
1190
|
children: [$.current.windSpeed, " km/h"]
|
|
1033
1191
|
})]
|
|
1034
1192
|
}),
|
|
1035
|
-
/* @__PURE__ */
|
|
1193
|
+
/* @__PURE__ */ u("div", {
|
|
1036
1194
|
className: "flex items-center justify-between",
|
|
1037
|
-
children: [/* @__PURE__ */
|
|
1195
|
+
children: [/* @__PURE__ */ u("span", {
|
|
1038
1196
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1039
1197
|
children: [
|
|
1040
|
-
/* @__PURE__ */
|
|
1198
|
+
/* @__PURE__ */ l(Ie, { className: "h-3.5 w-3.5" }),
|
|
1041
1199
|
" ",
|
|
1042
|
-
|
|
1200
|
+
c("healthybowl.crops.fieldDetail.weather.uvIndex", "UV Index")
|
|
1043
1201
|
]
|
|
1044
|
-
}), /* @__PURE__ */
|
|
1202
|
+
}), /* @__PURE__ */ l("span", {
|
|
1045
1203
|
className: "text-sm font-medium text-text-primary",
|
|
1046
1204
|
children: $.current.uvIndex
|
|
1047
1205
|
})]
|
|
1048
1206
|
}),
|
|
1049
|
-
/* @__PURE__ */
|
|
1207
|
+
/* @__PURE__ */ u("div", {
|
|
1050
1208
|
className: "flex items-center justify-between",
|
|
1051
|
-
children: [/* @__PURE__ */
|
|
1209
|
+
children: [/* @__PURE__ */ u("span", {
|
|
1052
1210
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1053
1211
|
children: [
|
|
1054
|
-
/* @__PURE__ */
|
|
1212
|
+
/* @__PURE__ */ l(je, { className: "h-3.5 w-3.5" }),
|
|
1055
1213
|
" ",
|
|
1056
|
-
|
|
1214
|
+
c("healthybowl.crops.fieldDetail.weather.visibility", "Visibility")
|
|
1057
1215
|
]
|
|
1058
|
-
}), /* @__PURE__ */
|
|
1216
|
+
}), /* @__PURE__ */ u("span", {
|
|
1059
1217
|
className: "text-sm font-medium text-text-primary",
|
|
1060
1218
|
children: [$.current.visibility, " km"]
|
|
1061
1219
|
})]
|
|
@@ -1063,75 +1221,75 @@ var He = (e) => {
|
|
|
1063
1221
|
]
|
|
1064
1222
|
})]
|
|
1065
1223
|
}),
|
|
1066
|
-
/* @__PURE__ */
|
|
1224
|
+
/* @__PURE__ */ u("div", {
|
|
1067
1225
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
1068
|
-
children: [/* @__PURE__ */
|
|
1226
|
+
children: [/* @__PURE__ */ l("h3", {
|
|
1069
1227
|
className: "mb-4 text-sm font-semibold text-text-primary",
|
|
1070
|
-
children:
|
|
1071
|
-
}), /* @__PURE__ */
|
|
1228
|
+
children: c("healthybowl.crops.fieldDetail.quickActions.heading", "Quick Actions")
|
|
1229
|
+
}), /* @__PURE__ */ u("div", {
|
|
1072
1230
|
className: "space-y-2",
|
|
1073
1231
|
children: [
|
|
1074
|
-
/* @__PURE__ */
|
|
1232
|
+
/* @__PURE__ */ u(d, {
|
|
1075
1233
|
variant: "outline",
|
|
1076
1234
|
onClick: () => C(w("weather")),
|
|
1077
1235
|
className: "w-full justify-start",
|
|
1078
1236
|
children: [
|
|
1079
|
-
/* @__PURE__ */
|
|
1237
|
+
/* @__PURE__ */ l(Ie, { className: "h-4 w-4 text-text-secondary" }),
|
|
1080
1238
|
" ",
|
|
1081
|
-
|
|
1239
|
+
c("healthybowl.crops.fieldDetail.quickActions.weatherData", "Weather Data")
|
|
1082
1240
|
]
|
|
1083
1241
|
}),
|
|
1084
|
-
/* @__PURE__ */
|
|
1242
|
+
/* @__PURE__ */ u(d, {
|
|
1085
1243
|
variant: "outline",
|
|
1086
1244
|
onClick: () => C(w("soil-health")),
|
|
1087
1245
|
className: "w-full justify-start",
|
|
1088
1246
|
children: [
|
|
1089
|
-
/* @__PURE__ */
|
|
1247
|
+
/* @__PURE__ */ l(Te, { className: "h-4 w-4 text-text-secondary" }),
|
|
1090
1248
|
" ",
|
|
1091
|
-
|
|
1249
|
+
c("healthybowl.crops.fieldDetail.quickActions.soilAnalysis", "Soil Analysis")
|
|
1092
1250
|
]
|
|
1093
1251
|
}),
|
|
1094
|
-
/* @__PURE__ */
|
|
1252
|
+
/* @__PURE__ */ u(d, {
|
|
1095
1253
|
variant: "outline",
|
|
1096
1254
|
onClick: () => C(w("crops")),
|
|
1097
1255
|
className: "w-full justify-start",
|
|
1098
1256
|
children: [
|
|
1099
|
-
/* @__PURE__ */
|
|
1257
|
+
/* @__PURE__ */ l(Be, { className: "h-4 w-4 text-text-secondary" }),
|
|
1100
1258
|
" ",
|
|
1101
|
-
|
|
1259
|
+
c("healthybowl.crops.fieldDetail.quickActions.cropHistory", "Crop History")
|
|
1102
1260
|
]
|
|
1103
1261
|
}),
|
|
1104
|
-
/* @__PURE__ */
|
|
1262
|
+
/* @__PURE__ */ u(d, {
|
|
1105
1263
|
variant: "outline",
|
|
1106
1264
|
onClick: () => C(w("analytics")),
|
|
1107
1265
|
className: "w-full justify-start",
|
|
1108
1266
|
children: [
|
|
1109
|
-
/* @__PURE__ */
|
|
1267
|
+
/* @__PURE__ */ l(Ce, { className: "h-4 w-4 text-text-secondary" }),
|
|
1110
1268
|
" ",
|
|
1111
|
-
|
|
1269
|
+
c("healthybowl.crops.fieldDetail.quickActions.generateReport", "Generate Report")
|
|
1112
1270
|
]
|
|
1113
1271
|
})
|
|
1114
1272
|
]
|
|
1115
1273
|
})]
|
|
1116
1274
|
}),
|
|
1117
|
-
/* @__PURE__ */
|
|
1275
|
+
/* @__PURE__ */ u("div", {
|
|
1118
1276
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
1119
|
-
children: [/* @__PURE__ */
|
|
1277
|
+
children: [/* @__PURE__ */ l("h3", {
|
|
1120
1278
|
className: "mb-4 text-sm font-semibold text-text-primary",
|
|
1121
|
-
children:
|
|
1122
|
-
}), /* @__PURE__ */
|
|
1279
|
+
children: c("healthybowl.crops.fieldDetail.recentActivity.heading", "Recent Activity")
|
|
1280
|
+
}), /* @__PURE__ */ l("div", {
|
|
1123
1281
|
className: "space-y-4",
|
|
1124
|
-
children:
|
|
1282
|
+
children: en.map((t, n) => /* @__PURE__ */ u("div", {
|
|
1125
1283
|
className: "flex gap-3",
|
|
1126
|
-
children: [/* @__PURE__ */
|
|
1284
|
+
children: [/* @__PURE__ */ u("div", {
|
|
1127
1285
|
className: "relative flex flex-col items-center",
|
|
1128
|
-
children: [/* @__PURE__ */
|
|
1129
|
-
}), /* @__PURE__ */
|
|
1286
|
+
children: [/* @__PURE__ */ l("div", { className: "h-2 w-2 rounded-full bg-action-primary-bg" }), n < en.length - 1 && /* @__PURE__ */ l("div", { className: "w-0.5 flex-1 bg-border" })]
|
|
1287
|
+
}), /* @__PURE__ */ u("div", {
|
|
1130
1288
|
className: "pb-4",
|
|
1131
|
-
children: [/* @__PURE__ */
|
|
1289
|
+
children: [/* @__PURE__ */ l("p", {
|
|
1132
1290
|
className: "text-sm text-text-primary",
|
|
1133
1291
|
children: t.action
|
|
1134
|
-
}), /* @__PURE__ */
|
|
1292
|
+
}), /* @__PURE__ */ l("p", {
|
|
1135
1293
|
className: "text-xs text-text-secondary",
|
|
1136
1294
|
children: e(t.date)
|
|
1137
1295
|
})]
|
|
@@ -1142,163 +1300,179 @@ var He = (e) => {
|
|
|
1142
1300
|
]
|
|
1143
1301
|
})]
|
|
1144
1302
|
}),
|
|
1145
|
-
/* @__PURE__ */
|
|
1146
|
-
open:
|
|
1303
|
+
/* @__PURE__ */ l(ae, {
|
|
1304
|
+
open: ot,
|
|
1147
1305
|
onClose: () => E(!1),
|
|
1148
|
-
title:
|
|
1149
|
-
description:
|
|
1306
|
+
title: c("healthybowl.crops.fieldDetail.editModal.title", "Edit Field"),
|
|
1307
|
+
description: c("healthybowl.crops.fieldDetail.editModal.description", "Update details for {{name}}", { name: O.name }),
|
|
1150
1308
|
size: "lg",
|
|
1151
|
-
footer: /* @__PURE__ */
|
|
1309
|
+
footer: /* @__PURE__ */ u(We, { children: [/* @__PURE__ */ l(d, {
|
|
1152
1310
|
variant: "outline",
|
|
1153
1311
|
onClick: () => E(!1),
|
|
1154
|
-
children:
|
|
1155
|
-
}), /* @__PURE__ */
|
|
1156
|
-
onClick:
|
|
1157
|
-
disabled:
|
|
1158
|
-
children:
|
|
1312
|
+
children: c("healthybowl.common.cancel", "Cancel")
|
|
1313
|
+
}), /* @__PURE__ */ l(d, {
|
|
1314
|
+
onClick: Ot,
|
|
1315
|
+
disabled: st,
|
|
1316
|
+
children: st ? c("healthybowl.crops.fieldDetail.editModal.saving", "Saving...") : c("healthybowl.crops.fieldDetail.editModal.saveChanges", "Save Changes")
|
|
1159
1317
|
})] }),
|
|
1160
|
-
children: /* @__PURE__ */
|
|
1318
|
+
children: /* @__PURE__ */ u("div", {
|
|
1161
1319
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
1162
1320
|
children: [
|
|
1163
|
-
/* @__PURE__ */
|
|
1321
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
1164
1322
|
className: "text-sm font-medium text-text-primary",
|
|
1165
|
-
children:
|
|
1166
|
-
}), /* @__PURE__ */
|
|
1323
|
+
children: c("healthybowl.crops.fieldDetail.form.fieldName.label", "Field Name *")
|
|
1324
|
+
}), /* @__PURE__ */ l("input", {
|
|
1167
1325
|
type: "text",
|
|
1168
|
-
value:
|
|
1169
|
-
onChange: (e) =>
|
|
1326
|
+
value: k,
|
|
1327
|
+
onChange: (e) => ct(e.target.value),
|
|
1170
1328
|
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)]"
|
|
1171
1329
|
})] }),
|
|
1172
|
-
/* @__PURE__ */
|
|
1330
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
1173
1331
|
className: "text-sm font-medium text-text-primary",
|
|
1174
|
-
children:
|
|
1175
|
-
}), /* @__PURE__ */
|
|
1332
|
+
children: c("healthybowl.crops.fieldDetail.form.area.label", "Area *")
|
|
1333
|
+
}), /* @__PURE__ */ l("input", {
|
|
1176
1334
|
type: "number",
|
|
1177
1335
|
min: 0,
|
|
1178
|
-
value:
|
|
1179
|
-
onChange: (e) =>
|
|
1336
|
+
value: lt,
|
|
1337
|
+
onChange: (e) => ut(e.target.value),
|
|
1180
1338
|
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)]"
|
|
1181
1339
|
})] }),
|
|
1182
|
-
/* @__PURE__ */
|
|
1340
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
1183
1341
|
className: "text-sm font-medium text-text-primary",
|
|
1184
|
-
children:
|
|
1185
|
-
}), /* @__PURE__ */
|
|
1186
|
-
value:
|
|
1187
|
-
onValueChange: (e) =>
|
|
1188
|
-
children: [/* @__PURE__ */
|
|
1342
|
+
children: c("healthybowl.crops.fieldDetail.form.unit.label", "Unit")
|
|
1343
|
+
}), /* @__PURE__ */ u(f, {
|
|
1344
|
+
value: dt,
|
|
1345
|
+
onValueChange: (e) => ft(e),
|
|
1346
|
+
children: [/* @__PURE__ */ l(h, {
|
|
1189
1347
|
className: "mt-1 w-full",
|
|
1190
|
-
children: /* @__PURE__ */
|
|
1191
|
-
}), /* @__PURE__ */
|
|
1348
|
+
children: /* @__PURE__ */ l(g, {})
|
|
1349
|
+
}), /* @__PURE__ */ u(p, { children: [/* @__PURE__ */ l(m, {
|
|
1192
1350
|
value: "acres",
|
|
1193
|
-
children:
|
|
1194
|
-
}), /* @__PURE__ */
|
|
1351
|
+
children: c("healthybowl.crops.fieldDetail.form.unit.options.acres", "Acres")
|
|
1352
|
+
}), /* @__PURE__ */ l(m, {
|
|
1195
1353
|
value: "hectares",
|
|
1196
|
-
children:
|
|
1354
|
+
children: c("healthybowl.crops.fieldDetail.form.unit.options.hectares", "Hectares")
|
|
1197
1355
|
})] })]
|
|
1198
1356
|
})] }),
|
|
1199
|
-
/* @__PURE__ */
|
|
1357
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
1200
1358
|
className: "text-sm font-medium text-text-primary",
|
|
1201
|
-
children:
|
|
1202
|
-
}), /* @__PURE__ */
|
|
1203
|
-
value:
|
|
1204
|
-
onValueChange:
|
|
1205
|
-
children: [/* @__PURE__ */
|
|
1359
|
+
children: c("healthybowl.crops.fieldDetail.form.status.label", "Status")
|
|
1360
|
+
}), /* @__PURE__ */ u(f, {
|
|
1361
|
+
value: _t,
|
|
1362
|
+
onValueChange: vt,
|
|
1363
|
+
children: [/* @__PURE__ */ l(h, {
|
|
1206
1364
|
className: "mt-1 w-full",
|
|
1207
|
-
children: /* @__PURE__ */
|
|
1208
|
-
}), /* @__PURE__ */
|
|
1209
|
-
/* @__PURE__ */
|
|
1365
|
+
children: /* @__PURE__ */ l(g, {})
|
|
1366
|
+
}), /* @__PURE__ */ u(p, { children: [
|
|
1367
|
+
/* @__PURE__ */ l(m, {
|
|
1210
1368
|
value: "active",
|
|
1211
|
-
children:
|
|
1369
|
+
children: c("healthybowl.crops.fieldDetail.form.status.options.active", "Active")
|
|
1212
1370
|
}),
|
|
1213
|
-
/* @__PURE__ */
|
|
1371
|
+
/* @__PURE__ */ l(m, {
|
|
1214
1372
|
value: "preparation",
|
|
1215
|
-
children:
|
|
1373
|
+
children: c("healthybowl.crops.fieldDetail.form.status.options.preparation", "Preparation")
|
|
1216
1374
|
}),
|
|
1217
|
-
/* @__PURE__ */
|
|
1375
|
+
/* @__PURE__ */ l(m, {
|
|
1218
1376
|
value: "fallow",
|
|
1219
|
-
children:
|
|
1377
|
+
children: c("healthybowl.crops.fieldDetail.form.status.options.fallow", "Fallow")
|
|
1220
1378
|
})
|
|
1221
1379
|
] })]
|
|
1222
1380
|
})] }),
|
|
1223
|
-
/* @__PURE__ */
|
|
1381
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
1224
1382
|
className: "text-sm font-medium text-text-primary",
|
|
1225
|
-
children:
|
|
1226
|
-
}), /* @__PURE__ */
|
|
1383
|
+
children: c("healthybowl.crops.fieldDetail.form.soilType.label", "Soil Type")
|
|
1384
|
+
}), /* @__PURE__ */ l("input", {
|
|
1227
1385
|
type: "text",
|
|
1228
|
-
value:
|
|
1229
|
-
onChange: (e) =>
|
|
1386
|
+
value: pt,
|
|
1387
|
+
onChange: (e) => mt(e.target.value),
|
|
1230
1388
|
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)]"
|
|
1231
1389
|
})] }),
|
|
1232
|
-
/* @__PURE__ */
|
|
1390
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
1233
1391
|
className: "text-sm font-medium text-text-primary",
|
|
1234
|
-
children:
|
|
1235
|
-
}), /* @__PURE__ */
|
|
1392
|
+
children: c("healthybowl.crops.fieldDetail.form.irrigationType.label", "Irrigation Type")
|
|
1393
|
+
}), /* @__PURE__ */ l("input", {
|
|
1236
1394
|
type: "text",
|
|
1237
|
-
value:
|
|
1238
|
-
onChange: (e) =>
|
|
1395
|
+
value: ht,
|
|
1396
|
+
onChange: (e) => gt(e.target.value),
|
|
1239
1397
|
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)]"
|
|
1240
1398
|
})] }),
|
|
1241
|
-
/* @__PURE__ */
|
|
1399
|
+
/* @__PURE__ */ l("div", {
|
|
1242
1400
|
className: "sm:col-span-2",
|
|
1243
|
-
children: /* @__PURE__ */
|
|
1401
|
+
children: /* @__PURE__ */ u("label", {
|
|
1244
1402
|
className: "flex cursor-pointer items-center gap-2 text-sm font-medium text-text-primary",
|
|
1245
|
-
children: [/* @__PURE__ */
|
|
1403
|
+
children: [/* @__PURE__ */ l("input", {
|
|
1246
1404
|
type: "checkbox",
|
|
1247
|
-
checked:
|
|
1248
|
-
onChange: (e) =>
|
|
1405
|
+
checked: yt,
|
|
1406
|
+
onChange: (e) => bt(e.target.checked),
|
|
1249
1407
|
className: "h-4 w-4 rounded border-border-subtle text-primary focus:ring-[var(--color-focus-ring)]"
|
|
1250
|
-
}),
|
|
1408
|
+
}), c("healthybowl.crops.fieldDetail.form.organicCertified.label", "Organic Certified")]
|
|
1251
1409
|
})
|
|
1252
1410
|
})
|
|
1253
1411
|
]
|
|
1254
1412
|
})
|
|
1255
1413
|
}),
|
|
1256
|
-
/* @__PURE__ */
|
|
1257
|
-
toasts:
|
|
1258
|
-
onDismiss:
|
|
1414
|
+
/* @__PURE__ */ l(te, {
|
|
1415
|
+
toasts: it,
|
|
1416
|
+
onDismiss: at
|
|
1259
1417
|
})
|
|
1260
1418
|
]
|
|
1261
|
-
}) : /* @__PURE__ */
|
|
1262
|
-
title:
|
|
1263
|
-
children:
|
|
1264
|
-
title:
|
|
1265
|
-
description:
|
|
1266
|
-
action: /* @__PURE__ */
|
|
1419
|
+
}) : /* @__PURE__ */ l(r, {
|
|
1420
|
+
title: c("healthybowl.crops.fieldDetail.notFound.pageTitle", "Field Not Found"),
|
|
1421
|
+
children: $e.crops ? /* @__PURE__ */ l(ie, {}) : Qe.crops ? /* @__PURE__ */ l(a, { onRetry: nt }) : /* @__PURE__ */ l(ee, {
|
|
1422
|
+
title: c("healthybowl.crops.fieldDetail.notFound.title", "Field not found"),
|
|
1423
|
+
description: c("healthybowl.crops.fieldDetail.notFound.description", "The field you are looking for does not exist."),
|
|
1424
|
+
action: /* @__PURE__ */ l(d, {
|
|
1267
1425
|
onClick: () => C(w("crops/fields")),
|
|
1268
|
-
children:
|
|
1426
|
+
children: c("healthybowl.crops.fieldDetail.actions.backToFields", "Back to Fields")
|
|
1269
1427
|
})
|
|
1270
1428
|
})
|
|
1271
1429
|
});
|
|
1272
|
-
}, y = ({ label: e, unit: t, value: n, min: r, step: i, onChange: ee }) => /* @__PURE__ */
|
|
1430
|
+
}, y = ({ label: e, unit: t, value: n, min: r, step: i, onChange: ee }) => /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
1273
1431
|
className: "text-xs font-medium text-text-secondary",
|
|
1274
1432
|
children: e
|
|
1275
|
-
}), /* @__PURE__ */
|
|
1433
|
+
}), /* @__PURE__ */ u("div", {
|
|
1276
1434
|
className: "relative mt-1",
|
|
1277
|
-
children: [/* @__PURE__ */
|
|
1435
|
+
children: [/* @__PURE__ */ l("input", {
|
|
1278
1436
|
type: "number",
|
|
1279
1437
|
value: n,
|
|
1280
1438
|
min: r,
|
|
1281
1439
|
step: i,
|
|
1282
1440
|
onChange: (e) => ee(e.target.value),
|
|
1283
1441
|
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)]"
|
|
1284
|
-
}), /* @__PURE__ */
|
|
1442
|
+
}), /* @__PURE__ */ l("span", {
|
|
1285
1443
|
className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-xs text-text-secondary",
|
|
1286
1444
|
children: t
|
|
1287
1445
|
})]
|
|
1288
|
-
})] }), b = ({ label: e, value: t, unit: n }) => /* @__PURE__ */
|
|
1446
|
+
})] }), b = ({ label: e, value: t, unit: n }) => /* @__PURE__ */ u("div", {
|
|
1289
1447
|
className: "min-w-0 rounded-md border border-border-subtle bg-bg-sunken/60 p-3",
|
|
1290
|
-
children: [/* @__PURE__ */
|
|
1448
|
+
children: [/* @__PURE__ */ l("span", {
|
|
1291
1449
|
className: "block truncate text-xs text-text-secondary",
|
|
1292
1450
|
children: e
|
|
1293
|
-
}), /* @__PURE__ */
|
|
1451
|
+
}), /* @__PURE__ */ u("p", {
|
|
1294
1452
|
className: "mt-1 text-lg font-semibold text-text-primary",
|
|
1295
|
-
children: [t, n && /* @__PURE__ */
|
|
1453
|
+
children: [t, n && /* @__PURE__ */ l("span", {
|
|
1296
1454
|
className: "ml-1 text-xs font-medium text-text-secondary",
|
|
1297
1455
|
children: n
|
|
1298
1456
|
})]
|
|
1299
1457
|
})]
|
|
1300
|
-
})
|
|
1458
|
+
}), x = ({ label: e, sortKey: t, activeKey: n, direction: r, onSort: i, align: ee = "left" }) => {
|
|
1459
|
+
let a = n === t;
|
|
1460
|
+
return /* @__PURE__ */ l("th", {
|
|
1461
|
+
scope: "col",
|
|
1462
|
+
"aria-sort": a ? r === "asc" ? "ascending" : "descending" : "none",
|
|
1463
|
+
className: `whitespace-nowrap px-3 py-2 text-xs font-medium ${ee === "right" ? "text-right" : "text-left"}`,
|
|
1464
|
+
children: /* @__PURE__ */ u("button", {
|
|
1465
|
+
type: "button",
|
|
1466
|
+
onClick: () => i(t),
|
|
1467
|
+
className: `inline-flex items-center gap-1 rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] ${a ? "text-text-primary" : "text-text-secondary hover:text-text-primary"}`,
|
|
1468
|
+
children: [e, a && l(r === "asc" ? De : c, {
|
|
1469
|
+
className: "h-3 w-3",
|
|
1470
|
+
"aria-hidden": "true"
|
|
1471
|
+
})]
|
|
1472
|
+
})
|
|
1473
|
+
});
|
|
1474
|
+
};
|
|
1301
1475
|
//#endregion
|
|
1302
|
-
export {
|
|
1476
|
+
export { Ye as FieldDetailsPage };
|
|
1303
1477
|
|
|
1304
1478
|
//# sourceMappingURL=FieldDetailsPage.js.map
|