@burdenoff/microfe-healthybowl 2026.1124.1 → 2026.1125.2
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/components/BedLayoutGrid.js +36 -36
- package/dist/healthybowl/components/HBEntityImages.js +18 -17
- package/dist/healthybowl/offline/OfflineStatusPill.js +24 -23
- package/dist/healthybowl/pages/ai/FarmAttentionPage.js +37 -37
- package/dist/healthybowl/pages/compliance/CertificationStandardDetailPage.js +132 -132
- package/dist/healthybowl/pages/compliance/ComplianceAlertsPage.js +131 -131
- package/dist/healthybowl/pages/compliance/ComplianceOverviewPage.js +107 -107
- package/dist/healthybowl/pages/field-capture/CaptureObservationForm.js +105 -105
- package/dist/healthybowl/pages/field-capture/ConflictReviewPage.js +34 -34
- package/dist/healthybowl/pages/financial/BankReconciliationPage.js +150 -146
- package/dist/healthybowl/pages/government-schemes/SchemeAdminPage.js +136 -136
- package/dist/healthybowl/pages/irrigation/IrrigationPage.js +313 -313
- package/dist/healthybowl/pages/livestock/WithdrawalAlertsPage.js +78 -78
- package/dist/healthybowl/pages/marketplace/ShipmentTrackingPanel.js +49 -49
- package/dist/healthybowl/pages/nursery/NurseryProvenancePage.js +366 -366
- package/dist/healthybowl/pages/pest-management/AiPestDetectionPage.js +148 -148
- package/dist/healthybowl/pages/satellite/SatelliteCropHealthPage.js +84 -76
- package/dist/healthybowl/pages/satellite/SatelliteFieldDetailPage.js +112 -108
- package/dist/healthybowl/pages/sustainability/CarbonGhgPage.js +181 -181
- package/dist/healthybowl/pages/terrace/JournalEntryModal.js +5 -5
- package/dist/healthybowl/pages/traceability/PrintLabelDialog.js +48 -48
- package/dist/healthybowl/pages/traceability/QRCodesPage.js +117 -117
- package/dist/healthybowl/pages/traceability/TracePortalSettingsPage.js +88 -88
- package/dist/healthybowl/pages/weather/WeatherAlertRulesPage.js +10 -10
- package/dist/healthybowl/pages/weather/WeatherHistoryPage.js +136 -136
- package/dist/healthybowl/pages/weather/WeatherOverviewPage.js +7 -7
- package/dist/healthybowl/pages/weather/WeatherSettingsPage.js +97 -97
- package/dist/healthybowl/public/PublicSeedLotPage.js +19 -15
- package/dist/healthybowl/public/PublicTracePage.js +18 -14
- package/package.json +2 -2
|
@@ -6,9 +6,9 @@ import { pickerRecordLabel as i } from "../utils/cropPicker.js";
|
|
|
6
6
|
import { CropPicker as a } from "./CropPicker.js";
|
|
7
7
|
import { useId as o, useMemo as s, useState as c } from "react";
|
|
8
8
|
import { useI18n as l } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
9
|
-
import { LayoutGrid as u
|
|
10
|
-
import { jsx as
|
|
11
|
-
import { Button as
|
|
9
|
+
import { LayoutGrid as u } from "lucide-react";
|
|
10
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
11
|
+
import { Button as p, EmptyState as m, SpinnerIcon as h, useGlassEmptyStates as g } from "@burdenoff/fe-libs/ui";
|
|
12
12
|
import { gql as _ } from "@apollo/client";
|
|
13
13
|
import { useMutation as v } from "@apollo/client/react";
|
|
14
14
|
// src/healthybowl/components/BedLayoutGrid.tsx
|
|
@@ -40,42 +40,42 @@ function x(e, t) {
|
|
|
40
40
|
}
|
|
41
41
|
var S = "__bed-unassigned__";
|
|
42
42
|
function C({ bed: e, crops: t, loadedCrop: n, saving: s, onAssign: c }) {
|
|
43
|
-
let { t: u } = l(),
|
|
44
|
-
return /* @__PURE__ */
|
|
43
|
+
let { t: u } = l(), p = o(), { crop: m, loading: h, error: g } = r(e.cropId, { skip: !!n }), _ = n ?? m, v = u("healthybowl.crops.fieldDetail.beds.recordedCrop", "Recorded crop ({{id}})", { id: e.cropId ?? "" }), y = _ ? i(_) : e.cropId ? h ? u("healthybowl.crops.fieldDetail.beds.recordedLoading", "Recorded crop ({{id}}) — loading…", { id: e.cropId }) : g ? u("healthybowl.crops.fieldDetail.beds.recordedError", "Recorded crop ({{id}}) — details could not be loaded", { id: e.cropId }) : u("healthybowl.crops.fieldDetail.beds.recordedUnavailable", "Recorded crop ({{id}}) — unavailable", { id: e.cropId }) : u("healthybowl.crops.fieldDetail.beds.unassigned", "Unassigned");
|
|
44
|
+
return /* @__PURE__ */ f("article", {
|
|
45
45
|
role: "listitem",
|
|
46
46
|
className: `rounded-lg border p-4 ${x(e.status, !!e.cropId)}`,
|
|
47
47
|
children: [
|
|
48
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ f("div", {
|
|
49
49
|
className: "flex items-start justify-between gap-2",
|
|
50
|
-
children: [/* @__PURE__ */
|
|
50
|
+
children: [/* @__PURE__ */ d("h3", {
|
|
51
51
|
className: "font-semibold text-text-primary",
|
|
52
52
|
children: e.name
|
|
53
|
-
}), /* @__PURE__ */
|
|
53
|
+
}), /* @__PURE__ */ d("span", {
|
|
54
54
|
className: "rounded-full bg-bg-surface px-2 py-1 text-xs capitalize text-text-secondary",
|
|
55
55
|
children: e.status ?? "ready to sow"
|
|
56
56
|
})]
|
|
57
57
|
}),
|
|
58
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ f("dl", {
|
|
59
59
|
className: "mt-3 grid grid-cols-2 gap-2 text-sm",
|
|
60
60
|
children: [
|
|
61
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("dt", {
|
|
62
62
|
className: "text-text-secondary",
|
|
63
63
|
children: u("healthybowl.crops.fieldDetail.beds.crop", "Crop")
|
|
64
|
-
}), /* @__PURE__ */
|
|
64
|
+
}), /* @__PURE__ */ d("dd", {
|
|
65
65
|
className: "font-medium text-text-primary",
|
|
66
66
|
children: y
|
|
67
67
|
})] }),
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("dt", {
|
|
69
69
|
className: "text-text-secondary",
|
|
70
70
|
children: u("healthybowl.crops.fieldDetail.beds.plants", "Plants")
|
|
71
|
-
}), /* @__PURE__ */
|
|
71
|
+
}), /* @__PURE__ */ d("dd", {
|
|
72
72
|
className: "font-medium text-text-primary",
|
|
73
73
|
children: e.plantCount ?? "—"
|
|
74
74
|
})] }),
|
|
75
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("dt", {
|
|
76
76
|
className: "text-text-secondary",
|
|
77
77
|
children: u("healthybowl.crops.fieldDetail.beds.area", "Area")
|
|
78
|
-
}), /* @__PURE__ */
|
|
78
|
+
}), /* @__PURE__ */ f("dd", {
|
|
79
79
|
className: "font-medium text-text-primary",
|
|
80
80
|
children: [
|
|
81
81
|
e.area ?? "—",
|
|
@@ -85,14 +85,14 @@ function C({ bed: e, crops: t, loadedCrop: n, saving: s, onAssign: c }) {
|
|
|
85
85
|
})] })
|
|
86
86
|
]
|
|
87
87
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ f("div", {
|
|
89
89
|
className: "mt-4",
|
|
90
|
-
children: [/* @__PURE__ */
|
|
91
|
-
htmlFor:
|
|
90
|
+
children: [/* @__PURE__ */ d("label", {
|
|
91
|
+
htmlFor: p,
|
|
92
92
|
className: "block text-xs font-medium text-text-secondary",
|
|
93
93
|
children: u("healthybowl.crops.fieldDetail.beds.assign", "Assign crop")
|
|
94
|
-
}), /* @__PURE__ */
|
|
95
|
-
id:
|
|
94
|
+
}), /* @__PURE__ */ d(a, {
|
|
95
|
+
id: p,
|
|
96
96
|
value: e.cropId ?? S,
|
|
97
97
|
onValueChange: (t) => void c(e, t === S ? "" : t),
|
|
98
98
|
options: t,
|
|
@@ -136,56 +136,56 @@ function w({ fieldId: r, crops: i }) {
|
|
|
136
136
|
w(null);
|
|
137
137
|
}
|
|
138
138
|
};
|
|
139
|
-
return /* @__PURE__ */
|
|
139
|
+
return /* @__PURE__ */ f("section", {
|
|
140
140
|
"aria-labelledby": "healthy-bowl-bed-layout-heading",
|
|
141
141
|
className: "rounded-xl border border-border-seam bg-bg-surface p-6",
|
|
142
|
-
children: [/* @__PURE__ */
|
|
142
|
+
children: [/* @__PURE__ */ f("div", {
|
|
143
143
|
className: "mb-4 flex items-start justify-between gap-4",
|
|
144
|
-
children: [/* @__PURE__ */
|
|
144
|
+
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("div", {
|
|
145
145
|
className: "flex items-center gap-2",
|
|
146
|
-
children: [/* @__PURE__ */
|
|
146
|
+
children: [/* @__PURE__ */ d(u, {
|
|
147
147
|
className: "h-5 w-5 text-action-primary",
|
|
148
148
|
"aria-hidden": "true"
|
|
149
|
-
}), /* @__PURE__ */
|
|
149
|
+
}), /* @__PURE__ */ d("h2", {
|
|
150
150
|
id: "healthy-bowl-bed-layout-heading",
|
|
151
151
|
className: "text-base font-semibold text-text-primary",
|
|
152
152
|
children: a("healthybowl.crops.fieldDetail.beds.title", "Bed layout")
|
|
153
153
|
})]
|
|
154
|
-
}), /* @__PURE__ */
|
|
154
|
+
}), /* @__PURE__ */ d("p", {
|
|
155
155
|
className: "mt-1 text-sm text-text-secondary",
|
|
156
156
|
children: a("healthybowl.crops.fieldDetail.beds.description", "See every saved bed, its crop, status and planting capacity.")
|
|
157
|
-
})] }), /* @__PURE__ */
|
|
157
|
+
})] }), /* @__PURE__ */ d(p, {
|
|
158
158
|
variant: "outline",
|
|
159
159
|
size: "sm",
|
|
160
160
|
onClick: () => void k(),
|
|
161
161
|
disabled: D,
|
|
162
|
-
children: D ? /* @__PURE__ */
|
|
162
|
+
children: D ? /* @__PURE__ */ d(h, { className: "h-4 w-4 animate-spin" }) : a("healthybowl.common.refresh", "Refresh")
|
|
163
163
|
})]
|
|
164
|
-
}), D && j.length === 0 ? /* @__PURE__ */
|
|
164
|
+
}), D && j.length === 0 ? /* @__PURE__ */ d("div", {
|
|
165
165
|
className: "py-8 text-center text-sm text-text-secondary",
|
|
166
166
|
children: a("healthybowl.common.loading", "Loading…")
|
|
167
|
-
}) : O ? /* @__PURE__ */
|
|
167
|
+
}) : O ? /* @__PURE__ */ d("div", {
|
|
168
168
|
className: "rounded-lg border border-error/40 bg-error/10 p-4 text-sm text-error",
|
|
169
169
|
children: a("healthybowl.crops.fieldDetail.beds.error", "Beds could not be loaded. Try again.")
|
|
170
|
-
}) : j.length === 0 ? o ? /* @__PURE__ */
|
|
170
|
+
}) : j.length === 0 ? o ? /* @__PURE__ */ d(m, {
|
|
171
171
|
illustration: "plants",
|
|
172
172
|
size: "panel",
|
|
173
173
|
title: a("healthybowl.crops.fieldDetail.beds.empty.title", "No beds saved yet"),
|
|
174
174
|
description: a("healthybowl.crops.fieldDetail.beds.empty.description", "Generate and save a bed layout from the Field Map page.")
|
|
175
|
-
}) : /* @__PURE__ */
|
|
175
|
+
}) : /* @__PURE__ */ f("div", {
|
|
176
176
|
className: "rounded-lg border border-dashed border-border-seam p-8 text-center",
|
|
177
|
-
children: [/* @__PURE__ */
|
|
177
|
+
children: [/* @__PURE__ */ d("p", {
|
|
178
178
|
className: "font-medium text-text-primary",
|
|
179
179
|
children: a("healthybowl.crops.fieldDetail.beds.empty.title", "No beds saved yet")
|
|
180
|
-
}), /* @__PURE__ */
|
|
180
|
+
}), /* @__PURE__ */ d("p", {
|
|
181
181
|
className: "mt-1 text-sm text-text-secondary",
|
|
182
182
|
children: a("healthybowl.crops.fieldDetail.beds.empty.description", "Generate and save a bed layout from the Field Map page.")
|
|
183
183
|
})]
|
|
184
|
-
}) : /* @__PURE__ */
|
|
184
|
+
}) : /* @__PURE__ */ d("div", {
|
|
185
185
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3",
|
|
186
186
|
role: "list",
|
|
187
187
|
"aria-label": a("healthybowl.crops.fieldDetail.beds.listLabel", "Saved beds"),
|
|
188
|
-
children: j.map((e) => /* @__PURE__ */
|
|
188
|
+
children: j.map((e) => /* @__PURE__ */ d(C, {
|
|
189
189
|
bed: e,
|
|
190
190
|
crops: i,
|
|
191
191
|
loadedCrop: e.cropId ? M.get(e.cropId) : void 0,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { cn as e } from "../utils/helpers.js";
|
|
2
2
|
import { useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
|
|
3
|
-
import { ImagePlus as a,
|
|
4
|
-
import { jsx as
|
|
3
|
+
import { ImagePlus as a, X as o } from "lucide-react";
|
|
4
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
5
|
+
import { SpinnerIcon as l } from "@burdenoff/fe-libs/ui";
|
|
5
6
|
import { gql as u } from "@apollo/client";
|
|
6
7
|
import { useApolloClient as d } from "@apollo/client/react";
|
|
7
8
|
import { useSaveToFiles as f } from "@burdenoff/fe-libs/storage";
|
|
@@ -67,15 +68,15 @@ var p = u`
|
|
|
67
68
|
v,
|
|
68
69
|
m
|
|
69
70
|
]), A = t((e) => m(u.filter((t) => t !== e)), [u, m]);
|
|
70
|
-
if (_) return u.length === 0 ? null : /* @__PURE__ */
|
|
71
|
+
if (_) return u.length === 0 ? null : /* @__PURE__ */ s("div", {
|
|
71
72
|
className: e("flex flex-wrap gap-2", y),
|
|
72
|
-
children: u.map((e) => /* @__PURE__ */
|
|
73
|
+
children: u.map((e) => /* @__PURE__ */ s(h, { url: w[e] }, e))
|
|
73
74
|
});
|
|
74
75
|
let j = u.length >= v;
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
+
return /* @__PURE__ */ c("div", {
|
|
76
77
|
className: e("space-y-2", y),
|
|
77
78
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ s("input", {
|
|
79
80
|
ref: C,
|
|
80
81
|
type: "file",
|
|
81
82
|
accept: "image/*",
|
|
@@ -83,42 +84,42 @@ var p = u`
|
|
|
83
84
|
className: "hidden",
|
|
84
85
|
onChange: k
|
|
85
86
|
}),
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ c("div", {
|
|
87
88
|
className: "flex flex-wrap gap-2",
|
|
88
|
-
children: [u.map((e) => /* @__PURE__ */
|
|
89
|
+
children: [u.map((e) => /* @__PURE__ */ c("div", {
|
|
89
90
|
className: "group relative",
|
|
90
|
-
children: [/* @__PURE__ */
|
|
91
|
+
children: [/* @__PURE__ */ s(h, { url: w[e] }), /* @__PURE__ */ s("button", {
|
|
91
92
|
type: "button",
|
|
92
93
|
onClick: () => A(e),
|
|
93
94
|
"aria-label": "Remove image",
|
|
94
95
|
className: "absolute -end-1.5 -top-1.5 flex h-5 w-5 items-center justify-center rounded-full border border-border-subtle bg-bg-surface text-text-secondary shadow-sm hover:text-status-error-text",
|
|
95
|
-
children: /* @__PURE__ */
|
|
96
|
+
children: /* @__PURE__ */ s(o, { className: "h-3 w-3" })
|
|
96
97
|
})]
|
|
97
|
-
}, e)), !j && /* @__PURE__ */
|
|
98
|
+
}, e)), !j && /* @__PURE__ */ c("button", {
|
|
98
99
|
type: "button",
|
|
99
100
|
onClick: () => C.current?.click(),
|
|
100
101
|
disabled: S,
|
|
101
102
|
className: "flex h-16 w-16 flex-col items-center justify-center gap-1 rounded-md border border-dashed border-border-subtle bg-bg-surface text-text-secondary hover:bg-bg-sunken/50 disabled:opacity-60",
|
|
102
|
-
children: [S ? /* @__PURE__ */
|
|
103
|
+
children: [S ? /* @__PURE__ */ s(l, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ s(a, { className: "h-4 w-4" }), /* @__PURE__ */ s("span", {
|
|
103
104
|
className: "text-[10px]",
|
|
104
105
|
children: S ? "Uploading…" : "Add"
|
|
105
106
|
})]
|
|
106
107
|
})]
|
|
107
108
|
}),
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ s("p", {
|
|
109
110
|
className: "text-xs text-text-secondary",
|
|
110
111
|
children: j ? `Maximum of ${v} images reached.` : `Upload images (stored securely in your workspace Files). ${u.length}/${v} added.`
|
|
111
112
|
}),
|
|
112
|
-
E && /* @__PURE__ */
|
|
113
|
+
E && /* @__PURE__ */ s("p", {
|
|
113
114
|
className: "text-xs text-status-error-text",
|
|
114
115
|
children: E
|
|
115
116
|
})
|
|
116
117
|
]
|
|
117
118
|
});
|
|
118
|
-
}, h = ({ url: e }) => e === void 0 ? /* @__PURE__ */
|
|
119
|
+
}, h = ({ url: e }) => e === void 0 ? /* @__PURE__ */ s("div", { className: "h-16 w-16 animate-pulse rounded-md border border-border-subtle bg-bg-sunken" }) : e === null ? /* @__PURE__ */ s("div", {
|
|
119
120
|
className: "flex h-16 w-16 items-center justify-center rounded-md border border-border-subtle bg-bg-sunken text-text-secondary",
|
|
120
|
-
children: /* @__PURE__ */
|
|
121
|
-
}) : /* @__PURE__ */
|
|
121
|
+
children: /* @__PURE__ */ s(a, { className: "h-4 w-4" })
|
|
122
|
+
}) : /* @__PURE__ */ s("img", {
|
|
122
123
|
src: e,
|
|
123
124
|
alt: "Entity",
|
|
124
125
|
className: "h-16 w-16 rounded-md border border-border-subtle object-cover",
|
|
@@ -6,42 +6,43 @@ import { useI18n as i } from "@burdenoff/fe-libs/shared/providers/shell/I18nProv
|
|
|
6
6
|
import { AlertTriangle as a, CheckCircle2 as o, RefreshCw as s, Wifi as c, WifiOff as l } from "lucide-react";
|
|
7
7
|
import { Link as u } from "react-router";
|
|
8
8
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
|
+
import { SpinnerIcon as p } from "@burdenoff/fe-libs/ui";
|
|
9
10
|
// src/healthybowl/offline/OfflineStatusPill.tsx
|
|
10
|
-
var
|
|
11
|
-
let { buildPath:
|
|
12
|
-
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
let
|
|
11
|
+
var m = ({ inline: m, compact: h, className: g }) => {
|
|
12
|
+
let { buildPath: _ } = n(), { t: v } = i(), { online: y, syncing: b, queuedCount: x, conflictCount: S, needsReviewCount: C, lastSyncedAt: w, storageBlocked: T, syncNow: E } = e(), D = !y, O = x > 0, k = "ok";
|
|
13
|
+
D ? k = "offline" : (T || O || S > 0 || C > 0) && (k = "warning");
|
|
14
|
+
let A = k === "offline" || k === "warning" ? "bg-status-warning-bg-subtle text-status-warning-text border-status-warning-border" : "bg-status-success-bg-subtle text-status-success-text border-status-success-border", j = T ? a : D ? l : S > 0 || C > 0 ? a : O ? c : o, M;
|
|
15
|
+
M = T ? v("healthybowl.offline.pill.storageBlocked", "Close other HealthyBowl tabs · offline storage is finishing an update") : D ? O ? `Offline — ${x} record${x > 1 ? "s" : ""} queued` : "Offline — working locally" : b ? "Online — syncing…" : S > 0 ? `Online — ${S} conflict${S > 1 ? "s" : ""} to review` : O ? `Online — ${x} record${x > 1 ? "s" : ""} queued` : C > 0 ? C === 1 ? v("healthybowl.offline.pill.needsReviewOne", "Online — 1 record to review") : v("healthybowl.offline.pill.needsReviewMany", "Online — {{count}} records to review", { count: C }) : w ? `Online — all synced · last synced ${t(w)}` : "Online — all synced";
|
|
16
|
+
let N = /* @__PURE__ */ f("button", {
|
|
16
17
|
type: "button",
|
|
17
|
-
onClick: () => void
|
|
18
|
-
disabled:
|
|
19
|
-
title:
|
|
20
|
-
className: `shrink-0 items-center gap-1.5 rounded-lg bg-bg-surface px-2.5 py-1 text-xs font-semibold text-text-primary shadow-sm ring-1 ring-border-subtle transition hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-50 ${
|
|
21
|
-
children: [/* @__PURE__ */ d(
|
|
18
|
+
onClick: () => void E({ manual: !0 }),
|
|
19
|
+
disabled: b || !y,
|
|
20
|
+
title: y ? "Sync now" : "Reconnect to sync",
|
|
21
|
+
className: `shrink-0 items-center gap-1.5 rounded-lg bg-bg-surface px-2.5 py-1 text-xs font-semibold text-text-primary shadow-sm ring-1 ring-border-subtle transition hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-50 ${h ? "hidden lg:inline-flex" : "inline-flex"}`,
|
|
22
|
+
children: [b ? /* @__PURE__ */ d(p, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ d(s, { className: "h-3.5 w-3.5" }), "Sync Now"]
|
|
22
23
|
});
|
|
23
|
-
return
|
|
24
|
-
className: `flex max-w-[13rem] items-center gap-2 rounded-full border px-3 py-1 max-sm:gap-0 max-sm:px-2 xl:max-w-[22rem] ${
|
|
24
|
+
return h ? /* @__PURE__ */ f("div", {
|
|
25
|
+
className: `flex max-w-[13rem] items-center gap-2 rounded-full border px-3 py-1 max-sm:gap-0 max-sm:px-2 xl:max-w-[22rem] ${A} ${g ?? ""}`,
|
|
25
26
|
role: "status",
|
|
26
27
|
"aria-live": "polite",
|
|
27
28
|
children: [/* @__PURE__ */ f(u, {
|
|
28
|
-
to:
|
|
29
|
-
title:
|
|
30
|
-
"aria-label":
|
|
29
|
+
to: _("field-capture/pending"),
|
|
30
|
+
title: M,
|
|
31
|
+
"aria-label": M,
|
|
31
32
|
className: "flex min-w-0 flex-1 items-center gap-2 text-left transition hover:opacity-90",
|
|
32
|
-
children: [/* @__PURE__ */ d(
|
|
33
|
+
children: [/* @__PURE__ */ d(j, { className: "h-4 w-4 shrink-0" }), /* @__PURE__ */ d("span", {
|
|
33
34
|
className: "truncate text-xs font-medium max-sm:hidden",
|
|
34
|
-
children: r(
|
|
35
|
+
children: r(M)
|
|
35
36
|
})]
|
|
36
|
-
}),
|
|
37
|
+
}), N]
|
|
37
38
|
}) : /* @__PURE__ */ f("div", {
|
|
38
|
-
className: `flex items-center justify-between gap-3 rounded-xl border px-3.5 py-2 ${
|
|
39
|
+
className: `flex items-center justify-between gap-3 rounded-xl border px-3.5 py-2 ${A} ${m ? "" : "shadow-sm"} ${g ?? ""}`,
|
|
39
40
|
role: "status",
|
|
40
41
|
"aria-live": "polite",
|
|
41
42
|
children: [/* @__PURE__ */ f("span", {
|
|
42
43
|
className: "flex items-center gap-2 text-sm font-medium",
|
|
43
|
-
children: [/* @__PURE__ */ d(
|
|
44
|
-
}),
|
|
44
|
+
children: [/* @__PURE__ */ d(j, { className: "h-4 w-4 shrink-0" }), M]
|
|
45
|
+
}), N]
|
|
45
46
|
});
|
|
46
47
|
};
|
|
47
|
-
export {
|
|
48
|
+
export { m as OfflineStatusPill };
|
|
@@ -12,34 +12,34 @@ import { useI18n as g } from "@burdenoff/fe-libs/shared/providers/shell/I18nProv
|
|
|
12
12
|
import { AlertTriangle as _, ArrowRight as v, Clock as y, CloudLightning as b, Info as x, Landmark as S, Radio as C, RefreshCw as w, Satellite as T, ShieldCheck as E, Syringe as D } from "lucide-react";
|
|
13
13
|
import { useNavigate as O } from "react-router";
|
|
14
14
|
import { jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
15
|
-
import { Button as j } from "@burdenoff/fe-libs/ui";
|
|
15
|
+
import { Button as j, SpinnerIcon as M } from "@burdenoff/fe-libs/ui";
|
|
16
16
|
// src/healthybowl/pages/ai/FarmAttentionPage.tsx
|
|
17
|
-
var
|
|
17
|
+
var N = (e) => new Date(e).toLocaleTimeString(f(), {
|
|
18
18
|
hour: "2-digit",
|
|
19
19
|
minute: "2-digit"
|
|
20
|
-
}),
|
|
20
|
+
}), P = [
|
|
21
21
|
7,
|
|
22
22
|
14,
|
|
23
23
|
30
|
|
24
|
-
],
|
|
24
|
+
], F = {
|
|
25
25
|
CRITICAL: "border-s-red-600",
|
|
26
26
|
WARNING: "border-s-amber-500",
|
|
27
27
|
INFO: "border-s-sky-500"
|
|
28
|
-
},
|
|
28
|
+
}, I = {
|
|
29
29
|
CRITICAL: "error",
|
|
30
30
|
WARNING: "warning",
|
|
31
31
|
INFO: "info"
|
|
32
|
-
},
|
|
32
|
+
}, L = {
|
|
33
33
|
CRITICAL: /* @__PURE__ */ k(_, {}),
|
|
34
34
|
WARNING: /* @__PURE__ */ k(y, {}),
|
|
35
35
|
INFO: /* @__PURE__ */ k(x, {})
|
|
36
|
-
},
|
|
36
|
+
}, R = (e, t) => t === "CRITICAL" ? e("healthybowl.attention.severity.critical", "Critical") : t === "WARNING" ? e("healthybowl.attention.severity.warning", "Needs attention") : e("healthybowl.attention.severity.info", "For information"), z = {
|
|
37
37
|
SENSOR: /* @__PURE__ */ k(C, {}),
|
|
38
38
|
WEATHER: /* @__PURE__ */ k(b, {}),
|
|
39
39
|
WITHDRAWAL: /* @__PURE__ */ k(D, {}),
|
|
40
40
|
SCHEME: /* @__PURE__ */ k(S, {}),
|
|
41
41
|
CROP_STRESS: /* @__PURE__ */ k(T, {})
|
|
42
|
-
},
|
|
42
|
+
}, B = (e, t) => {
|
|
43
43
|
switch (t) {
|
|
44
44
|
case "SENSOR": return e("healthybowl.attention.source.sensor", "Field sensor");
|
|
45
45
|
case "WEATHER": return e("healthybowl.attention.source.weather", "Weather");
|
|
@@ -48,7 +48,7 @@ var M = (e) => new Date(e).toLocaleTimeString(f(), {
|
|
|
48
48
|
case "CROP_STRESS": return e("healthybowl.attention.source.cropStress", "Crop stress");
|
|
49
49
|
default: return t;
|
|
50
50
|
}
|
|
51
|
-
},
|
|
51
|
+
}, V = (e, t) => {
|
|
52
52
|
switch (t) {
|
|
53
53
|
case "SENSOR": return e.sensorCount;
|
|
54
54
|
case "WEATHER": return e.weatherCount;
|
|
@@ -56,14 +56,14 @@ var M = (e) => new Date(e).toLocaleTimeString(f(), {
|
|
|
56
56
|
case "SCHEME": return e.schemeCount;
|
|
57
57
|
case "CROP_STRESS": return e.cropStressCount;
|
|
58
58
|
}
|
|
59
|
-
},
|
|
60
|
-
let a = s.includes(e.source) ?
|
|
59
|
+
}, H = ({ finding: e, severity: t, onOpen: n, t: i }) => {
|
|
60
|
+
let a = s.includes(e.source) ? z[e.source] : null;
|
|
61
61
|
return /* @__PURE__ */ k("li", {
|
|
62
62
|
"data-testid": "attention-finding",
|
|
63
63
|
"data-finding-id": e.id,
|
|
64
64
|
"data-finding-source": e.source,
|
|
65
65
|
"data-finding-severity": t,
|
|
66
|
-
className: `rounded-lg border border-border-subtle border-s-4 bg-bg-surface p-4 ${
|
|
66
|
+
className: `rounded-lg border border-border-subtle border-s-4 bg-bg-surface p-4 ${F[t]}`,
|
|
67
67
|
children: /* @__PURE__ */ A("div", {
|
|
68
68
|
className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
|
|
69
69
|
children: [/* @__PURE__ */ A("div", {
|
|
@@ -81,7 +81,7 @@ var M = (e) => new Date(e).toLocaleTimeString(f(), {
|
|
|
81
81
|
children: e.title
|
|
82
82
|
}),
|
|
83
83
|
/* @__PURE__ */ k(r, {
|
|
84
|
-
label:
|
|
84
|
+
label: B(i, e.source),
|
|
85
85
|
variant: "muted"
|
|
86
86
|
})
|
|
87
87
|
]
|
|
@@ -111,7 +111,7 @@ var M = (e) => new Date(e).toLocaleTimeString(f(), {
|
|
|
111
111
|
})]
|
|
112
112
|
})
|
|
113
113
|
});
|
|
114
|
-
},
|
|
114
|
+
}, U = ({ digest: e, onRefresh: t, t: n }) => /* @__PURE__ */ A("section", {
|
|
115
115
|
"data-testid": "attention-all-clear",
|
|
116
116
|
className: "rounded-xl border border-border-subtle bg-bg-surface p-6 sm:p-8",
|
|
117
117
|
children: [/* @__PURE__ */ k(i, {
|
|
@@ -140,11 +140,11 @@ var M = (e) => new Date(e).toLocaleTimeString(f(), {
|
|
|
140
140
|
children: [
|
|
141
141
|
/* @__PURE__ */ k("span", {
|
|
142
142
|
className: "flex size-7 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary [&>svg]:size-4",
|
|
143
|
-
children:
|
|
143
|
+
children: z[e]
|
|
144
144
|
}),
|
|
145
145
|
/* @__PURE__ */ k("span", {
|
|
146
146
|
className: "min-w-0 flex-1 truncate text-sm text-text-primary",
|
|
147
|
-
children:
|
|
147
|
+
children: B(n, e)
|
|
148
148
|
}),
|
|
149
149
|
/* @__PURE__ */ k(r, {
|
|
150
150
|
label: n("healthybowl.attention.clear.badge", "Clear"),
|
|
@@ -154,7 +154,7 @@ var M = (e) => new Date(e).toLocaleTimeString(f(), {
|
|
|
154
154
|
}, e))
|
|
155
155
|
})]
|
|
156
156
|
})]
|
|
157
|
-
}),
|
|
157
|
+
}), W = () => /* @__PURE__ */ k("div", {
|
|
158
158
|
className: "space-y-4",
|
|
159
159
|
"aria-busy": "true",
|
|
160
160
|
children: [
|
|
@@ -169,8 +169,8 @@ var M = (e) => new Date(e).toLocaleTimeString(f(), {
|
|
|
169
169
|
/* @__PURE__ */ k("div", { className: "h-3 w-32 animate-pulse rounded bg-bg-sunken" })
|
|
170
170
|
]
|
|
171
171
|
}, e))
|
|
172
|
-
}),
|
|
173
|
-
let { t: i } = g(), d = O(), { buildPath: f } = t(), [p, _] = h(
|
|
172
|
+
}), G = (e) => /cannot query field|unknown field|unknown argument|did not match any/i.test(e), K = () => {
|
|
173
|
+
let { t: i } = g(), d = O(), { buildPath: f } = t(), [p, _] = h(P[0]), { digest: v, findings: y, loading: b, error: x, refetch: S } = u({ horizonDays: p }), C = m(() => {
|
|
174
174
|
let e = {
|
|
175
175
|
CRITICAL: [],
|
|
176
176
|
WARNING: [],
|
|
@@ -185,7 +185,7 @@ var M = (e) => new Date(e).toLocaleTimeString(f(), {
|
|
|
185
185
|
children: [/* @__PURE__ */ k("span", {
|
|
186
186
|
className: "text-sm text-text-secondary",
|
|
187
187
|
children: i("healthybowl.attention.horizon.label", "Look ahead")
|
|
188
|
-
}),
|
|
188
|
+
}), P.map((e) => /* @__PURE__ */ k(j, {
|
|
189
189
|
variant: p === e ? "default" : "outline",
|
|
190
190
|
size: "sm",
|
|
191
191
|
onClick: () => _(e),
|
|
@@ -203,12 +203,12 @@ var M = (e) => new Date(e).toLocaleTimeString(f(), {
|
|
|
203
203
|
size: "sm",
|
|
204
204
|
onClick: () => void S(),
|
|
205
205
|
disabled: b,
|
|
206
|
-
children: [/* @__PURE__ */ k(
|
|
206
|
+
children: [b ? /* @__PURE__ */ k(M, { className: "me-1.5 h-4 w-4 animate-spin" }) : /* @__PURE__ */ k(w, { className: "me-1.5 h-4 w-4" }), i("healthybowl.attention.refresh", "Refresh")]
|
|
207
207
|
}),
|
|
208
208
|
children: [/* @__PURE__ */ k("div", {
|
|
209
209
|
className: "mb-4",
|
|
210
210
|
children: D
|
|
211
|
-
}), x ?
|
|
211
|
+
}), x ? G(x.message) ? /* @__PURE__ */ k(a, {
|
|
212
212
|
title: i("healthybowl.attention.error.notLiveTitle", "Farm Attention is not live on this environment yet"),
|
|
213
213
|
description: i("healthybowl.attention.error.notLiveDescription", "The digest has shipped to the HealthyBowl service but the API supergraph has not picked it up yet, so this page has nothing to read. Propagation usually completes within a few hours of a release. Your farm data is fine — every underlying alert is still on its own page."),
|
|
214
214
|
onRetry: () => void S()
|
|
@@ -216,7 +216,7 @@ var M = (e) => new Date(e).toLocaleTimeString(f(), {
|
|
|
216
216
|
title: i("healthybowl.attention.error.title", "Couldn't load your attention digest"),
|
|
217
217
|
description: x.message,
|
|
218
218
|
onRetry: () => void S()
|
|
219
|
-
}) : v ? v.findings.length === 0 ? /* @__PURE__ */ k(
|
|
219
|
+
}) : v ? v.findings.length === 0 ? /* @__PURE__ */ k(U, {
|
|
220
220
|
digest: v,
|
|
221
221
|
onRefresh: () => void S(),
|
|
222
222
|
t: i
|
|
@@ -234,29 +234,29 @@ var M = (e) => new Date(e).toLocaleTimeString(f(), {
|
|
|
234
234
|
"data-value": v.total
|
|
235
235
|
}),
|
|
236
236
|
/* @__PURE__ */ k(n, {
|
|
237
|
-
label:
|
|
237
|
+
label: R(i, "CRITICAL"),
|
|
238
238
|
value: v.critical,
|
|
239
|
-
icon:
|
|
239
|
+
icon: L.CRITICAL,
|
|
240
240
|
"data-value": v.critical
|
|
241
241
|
}),
|
|
242
242
|
/* @__PURE__ */ k(n, {
|
|
243
|
-
label:
|
|
243
|
+
label: R(i, "WARNING"),
|
|
244
244
|
value: v.warning,
|
|
245
|
-
icon:
|
|
245
|
+
icon: L.WARNING,
|
|
246
246
|
"data-value": v.warning
|
|
247
247
|
}),
|
|
248
248
|
/* @__PURE__ */ k(n, {
|
|
249
|
-
label:
|
|
249
|
+
label: R(i, "INFO"),
|
|
250
250
|
value: v.info,
|
|
251
|
-
icon:
|
|
251
|
+
icon: L.INFO,
|
|
252
252
|
"data-value": v.info
|
|
253
253
|
})
|
|
254
254
|
]
|
|
255
255
|
}),
|
|
256
256
|
/* @__PURE__ */ k("div", {
|
|
257
257
|
className: "flex flex-wrap items-center gap-2",
|
|
258
|
-
children: s.filter((e) =>
|
|
259
|
-
label: `${
|
|
258
|
+
children: s.filter((e) => V(v, e) > 0).map((e) => /* @__PURE__ */ k(r, {
|
|
259
|
+
label: `${B(i, e)} · ${V(v, e)}`,
|
|
260
260
|
variant: "muted"
|
|
261
261
|
}, e))
|
|
262
262
|
}),
|
|
@@ -266,14 +266,14 @@ var M = (e) => new Date(e).toLocaleTimeString(f(), {
|
|
|
266
266
|
className: "mb-3 flex items-center gap-2",
|
|
267
267
|
children: [/* @__PURE__ */ k("h2", {
|
|
268
268
|
className: "text-lg font-semibold text-text-primary",
|
|
269
|
-
children:
|
|
269
|
+
children: R(i, e)
|
|
270
270
|
}), /* @__PURE__ */ k(r, {
|
|
271
271
|
label: String(C[e].length),
|
|
272
|
-
variant:
|
|
272
|
+
variant: I[e]
|
|
273
273
|
})]
|
|
274
274
|
}), /* @__PURE__ */ k("ul", {
|
|
275
275
|
className: "space-y-3",
|
|
276
|
-
children: C[e].map((t) => /* @__PURE__ */ k(
|
|
276
|
+
children: C[e].map((t) => /* @__PURE__ */ k(H, {
|
|
277
277
|
finding: t,
|
|
278
278
|
severity: e,
|
|
279
279
|
onOpen: () => T(t),
|
|
@@ -284,12 +284,12 @@ var M = (e) => new Date(e).toLocaleTimeString(f(), {
|
|
|
284
284
|
/* @__PURE__ */ k("p", {
|
|
285
285
|
className: "text-xs text-text-tertiary",
|
|
286
286
|
children: i("healthybowl.attention.footer", "Generated at {{when}} · dated signals looked ahead {{days}} days · this list is read-only, act on each item from the page that owns it.", {
|
|
287
|
-
when:
|
|
287
|
+
when: N(v.generatedAt),
|
|
288
288
|
days: v.horizonDays
|
|
289
289
|
})
|
|
290
290
|
})
|
|
291
291
|
]
|
|
292
|
-
}) : /* @__PURE__ */ k(
|
|
292
|
+
}) : /* @__PURE__ */ k(W, {})]
|
|
293
293
|
});
|
|
294
294
|
};
|
|
295
|
-
export {
|
|
295
|
+
export { K as FarmAttentionPage };
|