@burdenoff/microfe-healthybowl 2026.1005.2 → 2026.1007.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 +128 -115
- package/dist/healthybowl/components/BedLayoutGrid.js.map +1 -1
- package/dist/healthybowl/components/CropPicker.js +37 -0
- package/dist/healthybowl/components/CropPicker.js.map +1 -0
- package/dist/healthybowl/components/DataTable.js +125 -108
- package/dist/healthybowl/components/DataTable.js.map +1 -1
- package/dist/healthybowl/components/FilterBar.js +9 -6
- package/dist/healthybowl/components/FilterBar.js.map +1 -1
- package/dist/healthybowl/components/PlantCatalogPicker.js +32 -0
- package/dist/healthybowl/components/PlantCatalogPicker.js.map +1 -0
- package/dist/healthybowl/components/WorkspaceRecordPicker.js +164 -0
- package/dist/healthybowl/components/WorkspaceRecordPicker.js.map +1 -0
- package/dist/healthybowl/components/index.js +3 -1
- package/dist/healthybowl/hooks/useCropPage.js +71 -0
- package/dist/healthybowl/hooks/useCropPage.js.map +1 -0
- package/dist/healthybowl/hooks/usePlantCatalog.js +133 -44
- package/dist/healthybowl/hooks/usePlantCatalog.js.map +1 -1
- package/dist/healthybowl/hooks/usePlantingEstimate.js +6 -6
- package/dist/healthybowl/hooks/usePlantingEstimate.js.map +1 -1
- package/dist/healthybowl/hooks/useWorkspaceRead.js +46 -0
- package/dist/healthybowl/hooks/useWorkspaceRead.js.map +1 -0
- package/dist/healthybowl/pages/HomePage.js +143 -142
- package/dist/healthybowl/pages/HomePage.js.map +1 -1
- package/dist/healthybowl/pages/analytics/ReportsPage.js +8 -8
- package/dist/healthybowl/pages/catalog/PlantCatalogPage.js +266 -192
- package/dist/healthybowl/pages/catalog/PlantCatalogPage.js.map +1 -1
- package/dist/healthybowl/pages/catalog/WorkspaceBrowseFilters.js +58 -0
- package/dist/healthybowl/pages/catalog/WorkspaceBrowseFilters.js.map +1 -0
- package/dist/healthybowl/pages/catalog/browsePagination.js +24 -0
- package/dist/healthybowl/pages/catalog/browsePagination.js.map +1 -0
- package/dist/healthybowl/pages/compliance/ComplianceDocumentsPage.js +6 -6
- package/dist/healthybowl/pages/crops/CropDetailsPage.js +340 -348
- package/dist/healthybowl/pages/crops/CropDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropPlanningPage.js +468 -434
- package/dist/healthybowl/pages/crops/CropPlanningPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropsPage.js +633 -542
- package/dist/healthybowl/pages/crops/CropsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js +875 -800
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/PlanningDetailsPage.js +459 -448
- package/dist/healthybowl/pages/crops/PlanningDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/SuccessionCropLabel.js +21 -0
- package/dist/healthybowl/pages/crops/SuccessionCropLabel.js.map +1 -0
- package/dist/healthybowl/pages/crops/planningEdit.js +30 -0
- package/dist/healthybowl/pages/crops/planningEdit.js.map +1 -0
- package/dist/healthybowl/pages/fields/FieldMapPage.js +989 -941
- package/dist/healthybowl/pages/fields/FieldMapPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/GeneralLedgerPage.js +6 -6
- package/dist/healthybowl/pages/financial/InvoiceManagementPage.js +7 -7
- package/dist/healthybowl/pages/financial/InvoiceManagementPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/TransactionsPage.js +541 -541
- package/dist/healthybowl/pages/financial/TransactionsPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js +10 -10
- package/dist/healthybowl/pages/government-schemes/CommunicationPage.js +207 -207
- package/dist/healthybowl/pages/government-schemes/CommunicationPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/SchemeAdminPage.js +38 -38
- package/dist/healthybowl/pages/government-schemes/SchemeAdminPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/TrainingProgramsPage.js +15 -15
- package/dist/healthybowl/pages/government-schemes/TrainingProgramsPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/AnimalRegistryPage.js +4 -4
- package/dist/healthybowl/pages/livestock/BreedingManagementPage.js +4 -4
- package/dist/healthybowl/pages/livestock/FeedManagementPage.js +4 -4
- package/dist/healthybowl/pages/livestock/HealthRecordsPage.js +16 -16
- package/dist/healthybowl/pages/livestock/HealthRecordsPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/ProductionTrackingPage.js +4 -4
- package/dist/healthybowl/pages/livestock/VaccinationSchedulePage.js +4 -4
- package/dist/healthybowl/pages/market/MarketPricesPage.js +305 -305
- package/dist/healthybowl/pages/market/MarketPricesPage.js.map +1 -1
- package/dist/healthybowl/pages/network/CohortsPage.js +107 -107
- package/dist/healthybowl/pages/network/CohortsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/CommunityPage.js +247 -247
- package/dist/healthybowl/pages/network/CommunityPage.js.map +1 -1
- package/dist/healthybowl/pages/network/EventsPage.js +16 -16
- package/dist/healthybowl/pages/network/EventsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/ExpertsPage.js +470 -470
- package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/MentorsPage.js +6 -6
- package/dist/healthybowl/pages/pest-management/PestIssuesPage.js +8 -8
- package/dist/healthybowl/pages/pest-management/TreatmentLibraryPage.js +7 -7
- package/dist/healthybowl/pages/pest-management/TreatmentLibraryPage.js.map +1 -1
- package/dist/healthybowl/pages/production/ProductionBatchesPage.js +7 -7
- package/dist/healthybowl/pages/production/RecipeManagementPage.js +5 -5
- package/dist/healthybowl/pages/production/ValueAddedProductsPage.js +7 -7
- package/dist/healthybowl/pages/soil/SoilTestsPage.js +6 -6
- package/dist/healthybowl/pages/soil/SoilTestsPage.js.map +1 -1
- package/dist/healthybowl/pages/suppliers/SuppliersPage.js +10 -10
- package/dist/healthybowl/pages/sustainability/CarbonCreditLedgerPage.js +6 -6
- package/dist/healthybowl/pages/terrace/PlantingFormModal.js +151 -131
- package/dist/healthybowl/pages/terrace/PlantingFormModal.js.map +1 -1
- package/dist/healthybowl/pages/traceability/BatchTrackingPage.js +6 -6
- package/dist/healthybowl/utils/cropComparison.js +1 -1
- package/dist/healthybowl/utils/cropComparison.js.map +1 -1
- package/dist/healthybowl/utils/cropPicker.js +35 -0
- package/dist/healthybowl/utils/cropPicker.js.map +1 -0
- package/dist/healthybowl/utils/plantingCapacity.js +2 -2
- package/dist/healthybowl/utils/plantingCapacity.js.map +1 -1
- package/dist/healthybowl/utils/quotaLabels.js +8 -0
- package/dist/healthybowl/utils/quotaLabels.js.map +1 -0
- package/dist/healthybowl/utils/seedRate.js +1 -8
- package/dist/healthybowl/utils/seedRate.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,16 +4,17 @@ import { useBasePath as i } from "../hooks/useBasePath.js";
|
|
|
4
4
|
import { StatusBadge as a } from "../components/StatusBadge.js";
|
|
5
5
|
import { EmptyState as o } from "../components/EmptyState.js";
|
|
6
6
|
import { ErrorState as s } from "../components/ErrorState.js";
|
|
7
|
-
import { PageLoader as
|
|
7
|
+
import { PageLoader as ee } from "../components/PageLoader.js";
|
|
8
8
|
import "../components/index.js";
|
|
9
|
-
import { useHealthyBowlData as
|
|
10
|
-
import { useHealthyBowlQuota as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
9
|
+
import { useHealthyBowlData as te } from "../hooks/useHealthyBowlData.js";
|
|
10
|
+
import { useHealthyBowlQuota as c } from "../hooks/useHealthyBowlQuota.js";
|
|
11
|
+
import { quotaLabelKey as ne } from "../utils/quotaLabels.js";
|
|
12
|
+
import { hasWeatherObservation as re } from "../utils/weatherPresence.js";
|
|
13
|
+
import { useCallback as l, useMemo as u } from "react";
|
|
14
|
+
import { useI18n as d } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
15
|
+
import { AlertTriangle as f, ArrowUpRight as p, BarChart3 as ie, CalendarClock as m, CheckCircle2 as h, ChevronRight as g, ClipboardList as _, Cloud as v, CloudOff as y, Droplets as ae, Eye as oe, MapPin as b, PawPrint as x, Plus as S, ShieldCheck as se, Sprout as C, Thermometer as w, Wallet as T, Wind as ce } from "lucide-react";
|
|
16
|
+
import { useNavigate as le } from "react-router";
|
|
17
|
+
import { Fragment as ue, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
17
18
|
import { EmphasisPanel as O, GlassCard as k } from "@burdenoff/fe-libs/ui";
|
|
18
19
|
//#region src/healthybowl/pages/HomePage.tsx
|
|
19
20
|
var A = {
|
|
@@ -66,7 +67,7 @@ var A = {
|
|
|
66
67
|
}),
|
|
67
68
|
/* @__PURE__ */ D("span", {
|
|
68
69
|
className: "mt-auto inline-flex items-center gap-1 text-xs font-medium text-text-secondary transition-colors group-hover:text-text-primary",
|
|
69
|
-
children: [o, /* @__PURE__ */ E(
|
|
70
|
+
children: [o, /* @__PURE__ */ E(p, { className: "size-3.5" })]
|
|
70
71
|
})
|
|
71
72
|
]
|
|
72
73
|
})
|
|
@@ -174,62 +175,62 @@ var A = {
|
|
|
174
175
|
})
|
|
175
176
|
]
|
|
176
177
|
}) }), B = () => {
|
|
177
|
-
let { dashboardStats: a, alerts:
|
|
178
|
+
let { dashboardStats: a, alerts: p, crops: g, weatherData: A, markAlertRead: j, farm: N, loadings: P, errors: F, refetch: B } = te(), V = le(), { t: H, locale: U } = d(), W = l((e, t, n) => H(e, t, n), [H]), { buildPath: G } = i(), { quotas: K, loading: de } = c(), q = a, J = {
|
|
178
179
|
location: A?.location ?? "",
|
|
179
180
|
current: A?.current,
|
|
180
181
|
forecast: A?.forecast ?? []
|
|
181
|
-
},
|
|
182
|
+
}, fe = re(J.current), Y = u(() => (/* @__PURE__ */ new Date()).toLocaleDateString(U, {
|
|
182
183
|
weekday: "long",
|
|
183
184
|
day: "numeric",
|
|
184
185
|
month: "long"
|
|
185
|
-
}), []), X =
|
|
186
|
+
}), [U]), X = u(() => [...p].sort((e, t) => M[e.severity] - M[t.severity]), [p]), pe = X.slice(0, 5), Z = p.length, me = u(() => [...g].sort((e, t) => (e.daysToHarvest ?? 2 ** 53 - 1) - (t.daysToHarvest ?? 2 ** 53 - 1)), [g]).slice(0, 6), Q = u(() => q.totalRevenue === 0 ? null : Math.round(q.totalExpenses / q.totalRevenue * 100 * 10) / 10, [q.totalExpenses, q.totalRevenue]), he = l((e) => {
|
|
186
187
|
let t = new Date(e).getTime();
|
|
187
188
|
if (Number.isNaN(t)) return "";
|
|
188
189
|
let n = Math.max(0, Math.floor((Date.now() - t) / 6e4));
|
|
189
|
-
if (n < 1) return
|
|
190
|
-
if (n < 60) return
|
|
190
|
+
if (n < 1) return W("healthybowl.home.time.now", "just now");
|
|
191
|
+
if (n < 60) return W("healthybowl.home.time.minutes", "{{n}}m ago", { n });
|
|
191
192
|
let r = Math.floor(n / 60);
|
|
192
|
-
if (r < 24) return
|
|
193
|
+
if (r < 24) return W("healthybowl.home.time.hours", "{{n}}h ago", { n: r });
|
|
193
194
|
let i = Math.floor(r / 24);
|
|
194
|
-
return i < 7 ?
|
|
195
|
-
}, [
|
|
195
|
+
return i < 7 ? W("healthybowl.home.time.days", "{{n}}d ago", { n: i }) : W("healthybowl.home.time.weeks", "{{n}}w ago", { n: Math.floor(i / 7) });
|
|
196
|
+
}, [W]), ge = l((e) => e === "critical" ? W("healthybowl.home.needsAttention.review", "Review") : e === "warning" ? W("healthybowl.home.needsAttention.open", "Open") : W("healthybowl.home.needsAttention.view", "View"), [W]), _e = l((e) => {
|
|
196
197
|
j(e.id, !0), e.actionUrl && V(e.actionUrl);
|
|
197
|
-
}, [j, V]),
|
|
198
|
+
}, [j, V]), ve = q.netProfit > 0 ? "success" : q.netProfit < 0 ? "danger" : "neutral", ye = p.some((e) => e.severity === "critical"), be = p.some((e) => e.severity === "warning"), $ = Z === 0 ? "success" : ye ? "danger" : be ? "warning" : "neutral", xe = [
|
|
198
199
|
{
|
|
199
|
-
label:
|
|
200
|
+
label: W("healthybowl.home.quickActions.addCrop.label", "Add crop"),
|
|
200
201
|
icon: C,
|
|
201
|
-
path:
|
|
202
|
+
path: G("crops")
|
|
202
203
|
},
|
|
203
204
|
{
|
|
204
|
-
label:
|
|
205
|
+
label: W("healthybowl.home.quickActions.recordHarvest.label", "Record harvest"),
|
|
205
206
|
icon: _,
|
|
206
|
-
path:
|
|
207
|
+
path: G("crops/harvest")
|
|
207
208
|
},
|
|
208
209
|
{
|
|
209
|
-
label:
|
|
210
|
-
icon:
|
|
211
|
-
path:
|
|
210
|
+
label: W("healthybowl.home.quickActions.viewFields.label", "View fields"),
|
|
211
|
+
icon: b,
|
|
212
|
+
path: G("crops/fields")
|
|
212
213
|
},
|
|
213
214
|
{
|
|
214
|
-
label:
|
|
215
|
+
label: W("healthybowl.home.quickActions.viewWeather.label", "View weather"),
|
|
215
216
|
icon: w,
|
|
216
|
-
path:
|
|
217
|
+
path: G("weather")
|
|
217
218
|
},
|
|
218
219
|
{
|
|
219
|
-
label:
|
|
220
|
-
icon:
|
|
221
|
-
path:
|
|
220
|
+
label: W("healthybowl.home.quickActions.analytics.label", "Analytics"),
|
|
221
|
+
icon: ie,
|
|
222
|
+
path: G("analytics")
|
|
222
223
|
}
|
|
223
|
-
],
|
|
224
|
+
], Se = Z === 0 ? W("healthybowl.home.header.allClear", "You're all caught up") : Z === 1 ? W("healthybowl.home.header.needsAttentionOne", "1 item needs your attention") : W("healthybowl.home.header.needsAttentionOther", "{{count}} items need your attention", { count: Z }), Ce = N?.name ? `${Y} · ${N.name}` : Y, we = /* @__PURE__ */ D("button", {
|
|
224
225
|
type: "button",
|
|
225
|
-
onClick: () => V(
|
|
226
|
+
onClick: () => V(G("crops")),
|
|
226
227
|
className: "inline-flex min-h-[40px] items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-canvas",
|
|
227
|
-
children: [/* @__PURE__ */ E(
|
|
228
|
+
children: [/* @__PURE__ */ E(S, { className: "h-4 w-4" }), W("healthybowl.home.primaryAction", "Add")]
|
|
228
229
|
});
|
|
229
230
|
return /* @__PURE__ */ D(r, {
|
|
230
|
-
title:
|
|
231
|
-
description:
|
|
232
|
-
actions:
|
|
231
|
+
title: W("healthybowl.home.title", "Farm Dashboard"),
|
|
232
|
+
description: Ce,
|
|
233
|
+
actions: we,
|
|
233
234
|
children: [/* @__PURE__ */ D("section", {
|
|
234
235
|
"aria-labelledby": "healthy-bowl-quota-heading",
|
|
235
236
|
className: "mb-6 rounded-xl border border-border-seam bg-bg-surface p-5",
|
|
@@ -238,22 +239,22 @@ var A = {
|
|
|
238
239
|
children: [/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("h2", {
|
|
239
240
|
id: "healthy-bowl-quota-heading",
|
|
240
241
|
className: "text-base font-semibold text-text-primary",
|
|
241
|
-
children:
|
|
242
|
+
children: W("healthybowl.home.quotas.title", "Plan usage")
|
|
242
243
|
}), /* @__PURE__ */ E("p", {
|
|
243
244
|
className: "text-sm text-text-secondary",
|
|
244
|
-
children:
|
|
245
|
+
children: W("healthybowl.home.quotas.description", "See what your farm plan has used and what remains.")
|
|
245
246
|
})] }), /* @__PURE__ */ E("button", {
|
|
246
247
|
type: "button",
|
|
247
248
|
onClick: () => V("/billing"),
|
|
248
249
|
className: "text-sm font-medium text-action-primary-text hover:underline",
|
|
249
|
-
children:
|
|
250
|
+
children: W("healthybowl.home.quotas.billing", "Manage plan")
|
|
250
251
|
})]
|
|
251
|
-
}),
|
|
252
|
+
}), de && K.length === 0 ? /* @__PURE__ */ E("p", {
|
|
252
253
|
className: "text-sm text-text-secondary",
|
|
253
|
-
children:
|
|
254
|
+
children: W("healthybowl.common.loading", "Loading…")
|
|
254
255
|
}) : /* @__PURE__ */ E("div", {
|
|
255
256
|
className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-5",
|
|
256
|
-
children:
|
|
257
|
+
children: K.map((e) => {
|
|
257
258
|
let t = e.noLimit || e.limit === null || e.limit === 0 ? 0 : Math.min(100, Math.round(e.used / e.limit * 100));
|
|
258
259
|
return /* @__PURE__ */ D("div", {
|
|
259
260
|
className: "rounded-lg border border-border-seam bg-bg-canvas p-3",
|
|
@@ -262,13 +263,13 @@ var A = {
|
|
|
262
263
|
className: "flex items-start justify-between gap-2",
|
|
263
264
|
children: [/* @__PURE__ */ E("span", {
|
|
264
265
|
className: "text-sm font-medium text-text-primary",
|
|
265
|
-
children: e.label
|
|
266
|
+
children: W(ne(e.quotaName), e.label)
|
|
266
267
|
}), e.noLimit ? /* @__PURE__ */ E("span", {
|
|
267
268
|
className: "text-xs text-text-secondary",
|
|
268
|
-
children:
|
|
269
|
+
children: W("healthybowl.home.quotas.unlimited", "Unlimited")
|
|
269
270
|
}) : e.provisioned ? null : /* @__PURE__ */ E("span", {
|
|
270
271
|
className: "text-xs text-status-warning-text",
|
|
271
|
-
children:
|
|
272
|
+
children: W("healthybowl.home.quotas.unknown", "Not available")
|
|
272
273
|
})]
|
|
273
274
|
}),
|
|
274
275
|
/* @__PURE__ */ D("p", {
|
|
@@ -284,37 +285,37 @@ var A = {
|
|
|
284
285
|
}),
|
|
285
286
|
/* @__PURE__ */ E("p", {
|
|
286
287
|
className: `mt-1 text-xs ${e.exhausted ? "text-status-error-text" : e.provisioned ? "text-text-secondary" : "text-status-warning-text"}`,
|
|
287
|
-
children: e.exhausted ?
|
|
288
|
+
children: e.exhausted ? W("healthybowl.home.quotas.exhausted", "Limit reached") : e.provisioned ? e.remaining === null ? W("healthybowl.home.quotas.noLimitRemaining", "No limit") : W("healthybowl.home.quotas.remaining", "{{count}} remaining", { count: e.remaining }) : W("healthybowl.home.quotas.notProvisioned", "No plan limit found for this workspace — creating may be refused.")
|
|
288
289
|
})
|
|
289
290
|
]
|
|
290
291
|
}, e.quotaName);
|
|
291
292
|
})
|
|
292
293
|
})]
|
|
293
|
-
}), P.dashboard ? /* @__PURE__ */ E(
|
|
294
|
+
}), P.dashboard ? /* @__PURE__ */ E(ee, {}) : F.dashboard ? /* @__PURE__ */ E(s, { onRetry: B }) : /* @__PURE__ */ D("div", {
|
|
294
295
|
className: "space-y-6",
|
|
295
296
|
children: [
|
|
296
297
|
/* @__PURE__ */ D("div", {
|
|
297
298
|
className: e("inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-sm font-medium", Z === 0 ? "bg-status-success-bg text-status-success-text" : "bg-status-warning-bg text-status-warning-text"),
|
|
298
|
-
children: [E(Z === 0 ? h :
|
|
299
|
+
children: [E(Z === 0 ? h : f, { className: "size-4" }), Se]
|
|
299
300
|
}),
|
|
300
301
|
!N?.id && /* @__PURE__ */ D(O, {
|
|
301
302
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
302
303
|
children: [/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("p", {
|
|
303
304
|
className: "text-base font-semibold text-text-primary",
|
|
304
|
-
children:
|
|
305
|
+
children: W("healthybowl.home.onboarding.title", "Welcome to HealthyBowl")
|
|
305
306
|
}), /* @__PURE__ */ E("p", {
|
|
306
307
|
className: "text-sm text-text-secondary",
|
|
307
|
-
children:
|
|
308
|
+
children: W("healthybowl.home.onboarding.description", "Set up your farm to start tracking crops, livestock, finances, and more.")
|
|
308
309
|
})] }), /* @__PURE__ */ D("button", {
|
|
309
310
|
type: "button",
|
|
310
|
-
onClick: () => V(
|
|
311
|
+
onClick: () => V(G("getting-started")),
|
|
311
312
|
className: "inline-flex min-h-[44px] items-center gap-2 self-start rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-canvas sm:self-auto",
|
|
312
|
-
children: [/* @__PURE__ */ E(
|
|
313
|
+
children: [/* @__PURE__ */ E(S, { className: "h-4 w-4" }), W("healthybowl.home.onboarding.action", "Set up your farm")]
|
|
313
314
|
})]
|
|
314
315
|
}),
|
|
315
316
|
/* @__PURE__ */ E("div", {
|
|
316
317
|
className: "flex flex-wrap gap-2",
|
|
317
|
-
children:
|
|
318
|
+
children: xe.map(({ label: e, icon: t, path: n }) => /* @__PURE__ */ D("button", {
|
|
318
319
|
type: "button",
|
|
319
320
|
onClick: () => V(n),
|
|
320
321
|
className: "inline-flex min-h-[40px] items-center gap-2 rounded-full border border-border-subtle bg-bg-surface px-3.5 py-2 text-sm font-medium text-text-secondary transition-colors hover:border-border-default hover:bg-bg-sunken hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-canvas",
|
|
@@ -327,35 +328,35 @@ var A = {
|
|
|
327
328
|
className: "grid grid-cols-2 gap-4 lg:col-span-2",
|
|
328
329
|
children: [
|
|
329
330
|
/* @__PURE__ */ E(I, {
|
|
330
|
-
label:
|
|
331
|
-
value: String(
|
|
331
|
+
label: W("healthybowl.home.kpi.activeCrops", "Active crops"),
|
|
332
|
+
value: String(q.activeCrops),
|
|
332
333
|
icon: /* @__PURE__ */ E(C, {}),
|
|
333
|
-
drillLabel:
|
|
334
|
-
onClick: () => V(
|
|
334
|
+
drillLabel: W("healthybowl.home.kpi.viewCrops", "View crops"),
|
|
335
|
+
onClick: () => V(G("crops"))
|
|
335
336
|
}),
|
|
336
337
|
/* @__PURE__ */ E(I, {
|
|
337
|
-
label:
|
|
338
|
-
value: String(
|
|
339
|
-
icon: /* @__PURE__ */ E(
|
|
340
|
-
drillLabel:
|
|
341
|
-
onClick: () => V(
|
|
338
|
+
label: W("healthybowl.home.kpi.harvestDue", "Harvest due"),
|
|
339
|
+
value: String(q.harvestDue),
|
|
340
|
+
icon: /* @__PURE__ */ E(m, {}),
|
|
341
|
+
drillLabel: W("healthybowl.home.kpi.viewHarvest", "View harvest"),
|
|
342
|
+
onClick: () => V(G("crops/harvest"))
|
|
342
343
|
}),
|
|
343
344
|
/* @__PURE__ */ E(I, {
|
|
344
|
-
label:
|
|
345
|
-
value: t(
|
|
345
|
+
label: W("healthybowl.home.kpi.netProfit", "Net profit"),
|
|
346
|
+
value: t(q.netProfit, "INR"),
|
|
346
347
|
icon: /* @__PURE__ */ E(T, {}),
|
|
347
|
-
tone:
|
|
348
|
-
drillLabel:
|
|
349
|
-
onClick: () => V(
|
|
348
|
+
tone: ve,
|
|
349
|
+
drillLabel: W("healthybowl.home.kpi.viewFinance", "View finances"),
|
|
350
|
+
onClick: () => V(G("financial"))
|
|
350
351
|
}),
|
|
351
352
|
/* @__PURE__ */ E(I, {
|
|
352
|
-
label:
|
|
353
|
+
label: W("healthybowl.home.kpi.needsAttention", "Needs attention"),
|
|
353
354
|
value: String(Z),
|
|
354
|
-
icon: /* @__PURE__ */ E(
|
|
355
|
+
icon: /* @__PURE__ */ E(f, {}),
|
|
355
356
|
tone: $,
|
|
356
357
|
glow: $ === "danger" || $ === "warning",
|
|
357
|
-
drillLabel:
|
|
358
|
-
onClick: () => V(
|
|
358
|
+
drillLabel: W("healthybowl.home.kpi.viewAlerts", "View alerts"),
|
|
359
|
+
onClick: () => V(G("weather/alerts"))
|
|
359
360
|
})
|
|
360
361
|
]
|
|
361
362
|
}), /* @__PURE__ */ D(k, {
|
|
@@ -364,32 +365,32 @@ var A = {
|
|
|
364
365
|
className: "flex items-center justify-between px-4 pb-1 pt-4",
|
|
365
366
|
children: [/* @__PURE__ */ E("h3", {
|
|
366
367
|
className: "text-sm font-semibold text-text-primary",
|
|
367
|
-
children:
|
|
368
|
+
children: W("healthybowl.home.needsAttention.title", "Needs attention")
|
|
368
369
|
}), X.length > 0 && /* @__PURE__ */ E("button", {
|
|
369
370
|
type: "button",
|
|
370
|
-
onClick: () => V(
|
|
371
|
+
onClick: () => V(G("weather/alerts")),
|
|
371
372
|
className: "text-xs font-medium text-text-secondary transition-colors hover:text-text-primary focus-visible:text-text-primary focus-visible:outline-none",
|
|
372
|
-
children:
|
|
373
|
+
children: W("healthybowl.home.needsAttention.viewAll", "View all")
|
|
373
374
|
})]
|
|
374
375
|
}), /* @__PURE__ */ E("div", {
|
|
375
376
|
className: "flex-1 px-4 pb-4",
|
|
376
377
|
children: X.length === 0 ? /* @__PURE__ */ E(o, {
|
|
377
378
|
icon: /* @__PURE__ */ E(h, { className: "h-8 w-8 text-status-success-text" }),
|
|
378
|
-
title:
|
|
379
|
-
description:
|
|
379
|
+
title: W("healthybowl.home.needsAttention.empty.title", "You're all caught up"),
|
|
380
|
+
description: W("healthybowl.home.needsAttention.empty.description", "No urgent farm alerts right now."),
|
|
380
381
|
action: /* @__PURE__ */ E("button", {
|
|
381
382
|
type: "button",
|
|
382
|
-
onClick: () => V(
|
|
383
|
+
onClick: () => V(G("weather/alert-rules")),
|
|
383
384
|
className: "inline-flex min-h-[40px] items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
384
|
-
children:
|
|
385
|
+
children: W("healthybowl.home.needsAttention.empty.action", "Manage alert rules")
|
|
385
386
|
})
|
|
386
387
|
}) : /* @__PURE__ */ E("ul", {
|
|
387
388
|
className: "divide-y divide-border-subtle",
|
|
388
|
-
children:
|
|
389
|
+
children: pe.map((e) => /* @__PURE__ */ E(R, {
|
|
389
390
|
alert: e,
|
|
390
|
-
ctaLabel:
|
|
391
|
-
relTime:
|
|
392
|
-
onOpen: () =>
|
|
391
|
+
ctaLabel: ge(e.severity),
|
|
392
|
+
relTime: he(e.timestamp),
|
|
393
|
+
onOpen: () => _e(e)
|
|
393
394
|
}, e.id))
|
|
394
395
|
})
|
|
395
396
|
})]
|
|
@@ -409,40 +410,40 @@ var A = {
|
|
|
409
410
|
children: /* @__PURE__ */ E(C, {})
|
|
410
411
|
}), /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("h2", {
|
|
411
412
|
className: "text-base font-semibold text-text-primary",
|
|
412
|
-
children:
|
|
413
|
+
children: W("healthybowl.home.cropsAnchor.title", "Crop overview")
|
|
413
414
|
}), /* @__PURE__ */ E("p", {
|
|
414
415
|
className: "text-xs text-text-secondary",
|
|
415
|
-
children: g.length === 1 ?
|
|
416
|
+
children: g.length === 1 ? W("healthybowl.home.cropsAnchor.subtitleOne", "1 crop in progress") : W("healthybowl.home.cropsAnchor.subtitleOther", "{{count}} crops in progress", { count: g.length })
|
|
416
417
|
})] })]
|
|
417
418
|
}), g.length > 0 && /* @__PURE__ */ E("button", {
|
|
418
419
|
type: "button",
|
|
419
|
-
onClick: () => V(
|
|
420
|
+
onClick: () => V(G("crops")),
|
|
420
421
|
className: "text-xs font-medium text-text-secondary transition-colors hover:text-text-primary focus-visible:text-text-primary focus-visible:outline-none",
|
|
421
|
-
children:
|
|
422
|
+
children: W("healthybowl.home.cropsAnchor.viewAll", "View all crops")
|
|
422
423
|
})]
|
|
423
424
|
}), /* @__PURE__ */ E("div", {
|
|
424
425
|
className: "flex-1 px-3 pb-3",
|
|
425
426
|
children: g.length === 0 ? /* @__PURE__ */ E(o, {
|
|
426
427
|
icon: /* @__PURE__ */ E(C, { className: "h-8 w-8 text-primary" }),
|
|
427
|
-
title:
|
|
428
|
-
description:
|
|
428
|
+
title: W("healthybowl.home.cropsAnchor.empty.title", "No active crops"),
|
|
429
|
+
description: W("healthybowl.home.cropsAnchor.empty.description", "Register your first crop to track growth, health and harvest here."),
|
|
429
430
|
action: /* @__PURE__ */ D("button", {
|
|
430
431
|
type: "button",
|
|
431
|
-
onClick: () => V(
|
|
432
|
+
onClick: () => V(G("crops")),
|
|
432
433
|
className: "inline-flex min-h-[40px] items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
433
|
-
children: [/* @__PURE__ */ E(
|
|
434
|
+
children: [/* @__PURE__ */ E(S, { className: "h-4 w-4" }), W("healthybowl.home.quickActions.addCrop.label", "Add crop")]
|
|
434
435
|
})
|
|
435
436
|
}) : /* @__PURE__ */ E("ul", {
|
|
436
437
|
className: "divide-y divide-border-subtle",
|
|
437
|
-
children:
|
|
438
|
+
children: me.map((e) => {
|
|
438
439
|
let t = (e.growthStage || e.status || "").replace(/_/g, " ").trim();
|
|
439
440
|
return /* @__PURE__ */ E(z, {
|
|
440
441
|
crop: e,
|
|
441
|
-
metaLabel: [e.fieldName, t].filter(Boolean).join(" · ") ||
|
|
442
|
+
metaLabel: [e.fieldName, t].filter(Boolean).join(" · ") || W("healthybowl.home.cropsAnchor.noField", "Unassigned"),
|
|
442
443
|
healthLabel: (e.healthStatus || "unknown").replace(/_/g, " "),
|
|
443
|
-
harvestLabel: e.expectedHarvestDate ?
|
|
444
|
-
openLabel:
|
|
445
|
-
onOpen: () => V(
|
|
444
|
+
harvestLabel: e.expectedHarvestDate ? W("healthybowl.home.cropsAnchor.harvest", "Harvest {{date}}", { date: n(e.expectedHarvestDate) }) : W("healthybowl.home.cropsAnchor.harvestUnknown", "Harvest date TBD"),
|
|
445
|
+
openLabel: W("healthybowl.home.cropsAnchor.open", "Open"),
|
|
446
|
+
onOpen: () => V(G(`crops/${e.id}`))
|
|
446
447
|
}, e.id);
|
|
447
448
|
})
|
|
448
449
|
})
|
|
@@ -453,39 +454,39 @@ var A = {
|
|
|
453
454
|
className: "px-4 pb-1 pt-4",
|
|
454
455
|
children: [/* @__PURE__ */ E("h3", {
|
|
455
456
|
className: "text-sm font-semibold text-text-primary",
|
|
456
|
-
children:
|
|
457
|
-
}),
|
|
457
|
+
children: W("healthybowl.home.weatherCard.title", "Current weather")
|
|
458
|
+
}), J.location && /* @__PURE__ */ E("p", {
|
|
458
459
|
className: "text-xs text-text-secondary",
|
|
459
|
-
children:
|
|
460
|
+
children: J.location
|
|
460
461
|
})]
|
|
461
462
|
}), /* @__PURE__ */ D("div", {
|
|
462
463
|
className: "flex flex-1 flex-col gap-4 px-4 pb-4",
|
|
463
464
|
children: [
|
|
464
|
-
|
|
465
|
+
fe ? /* @__PURE__ */ D(ue, { children: [/* @__PURE__ */ D("div", {
|
|
465
466
|
className: "flex items-center justify-between",
|
|
466
467
|
children: [/* @__PURE__ */ D("div", { children: [
|
|
467
468
|
/* @__PURE__ */ D("p", {
|
|
468
469
|
className: "text-4xl font-bold text-text-primary",
|
|
469
|
-
children: [
|
|
470
|
+
children: [J.current.temperature, "°C"]
|
|
470
471
|
}),
|
|
471
472
|
/* @__PURE__ */ E("p", {
|
|
472
473
|
className: "text-sm text-text-secondary",
|
|
473
|
-
children:
|
|
474
|
+
children: J.current.condition
|
|
474
475
|
}),
|
|
475
476
|
/* @__PURE__ */ D("p", {
|
|
476
477
|
className: "mt-1 text-xs text-text-secondary",
|
|
477
478
|
children: [
|
|
478
|
-
|
|
479
|
+
W("healthybowl.home.weatherCard.feelsLike", "Feels like"),
|
|
479
480
|
" ",
|
|
480
|
-
|
|
481
|
+
J.current.feelsLike,
|
|
481
482
|
"°C"
|
|
482
483
|
]
|
|
483
484
|
})
|
|
484
485
|
] }), /* @__PURE__ */ D("div", {
|
|
485
486
|
className: "flex flex-col items-center",
|
|
486
|
-
children: [/* @__PURE__ */ E(
|
|
487
|
+
children: [/* @__PURE__ */ E(v, { className: "h-12 w-12 text-text-secondary" }), /* @__PURE__ */ D("span", {
|
|
487
488
|
className: "mt-1 text-xs text-text-secondary",
|
|
488
|
-
children: ["UV ",
|
|
489
|
+
children: ["UV ", J.current.uvIndex]
|
|
489
490
|
})]
|
|
490
491
|
})]
|
|
491
492
|
}), /* @__PURE__ */ D("div", {
|
|
@@ -493,44 +494,44 @@ var A = {
|
|
|
493
494
|
children: [
|
|
494
495
|
/* @__PURE__ */ D("div", {
|
|
495
496
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
496
|
-
children: [/* @__PURE__ */ E(
|
|
497
|
-
|
|
497
|
+
children: [/* @__PURE__ */ E(ae, { className: "h-4 w-4" }), /* @__PURE__ */ D("span", { children: [
|
|
498
|
+
J.current.humidity,
|
|
498
499
|
"% ",
|
|
499
|
-
|
|
500
|
+
W("healthybowl.home.weatherCard.humidity", "Humidity")
|
|
500
501
|
] })]
|
|
501
502
|
}),
|
|
502
503
|
/* @__PURE__ */ D("div", {
|
|
503
504
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
504
|
-
children: [/* @__PURE__ */ E(
|
|
505
|
+
children: [/* @__PURE__ */ E(ce, { className: "h-4 w-4" }), /* @__PURE__ */ D("span", { children: [J.current.windSpeed, " km/h"] })]
|
|
505
506
|
}),
|
|
506
507
|
/* @__PURE__ */ D("div", {
|
|
507
508
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
508
|
-
children: [/* @__PURE__ */ E(w, { className: "h-4 w-4" }), /* @__PURE__ */ D("span", { children: [
|
|
509
|
+
children: [/* @__PURE__ */ E(w, { className: "h-4 w-4" }), /* @__PURE__ */ D("span", { children: [J.current.pressure, " hPa"] })]
|
|
509
510
|
}),
|
|
510
511
|
/* @__PURE__ */ D("div", {
|
|
511
512
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
512
|
-
children: [/* @__PURE__ */ E(
|
|
513
|
+
children: [/* @__PURE__ */ E(oe, { className: "h-4 w-4" }), /* @__PURE__ */ D("span", { children: [J.current.visibility, " km"] })]
|
|
513
514
|
})
|
|
514
515
|
]
|
|
515
516
|
})] }) : /* @__PURE__ */ E(o, {
|
|
516
|
-
icon: /* @__PURE__ */ E(
|
|
517
|
-
title: F.weather ?
|
|
518
|
-
description: F.weather ?
|
|
517
|
+
icon: /* @__PURE__ */ E(y, { className: "h-8 w-8 text-text-muted" }),
|
|
518
|
+
title: F.weather ? W("healthybowl.home.weatherCard.error.title", "Weather unavailable") : W("healthybowl.home.weatherCard.empty.title", "No weather yet"),
|
|
519
|
+
description: F.weather ? W("healthybowl.home.weatherCard.error.description", "We couldn't load conditions for your farm just now.") : W("healthybowl.home.weatherCard.empty.description", "Set your farm location to see local conditions here."),
|
|
519
520
|
action: /* @__PURE__ */ E("button", {
|
|
520
521
|
type: "button",
|
|
521
|
-
onClick: () => F.weather ? B() : V(
|
|
522
|
+
onClick: () => F.weather ? B() : V(G("farm")),
|
|
522
523
|
className: "inline-flex min-h-[40px] items-center gap-2 rounded-md border border-border-default px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
523
|
-
children: F.weather ?
|
|
524
|
+
children: F.weather ? W("healthybowl.home.weatherCard.error.retry", "Try again") : W("healthybowl.home.weatherCard.empty.action", "Set farm location")
|
|
524
525
|
})
|
|
525
526
|
}),
|
|
526
|
-
|
|
527
|
+
J.forecast.length > 0 && /* @__PURE__ */ E("div", {
|
|
527
528
|
className: "grid grid-cols-4 gap-2 border-t border-border-subtle pt-3",
|
|
528
|
-
children:
|
|
529
|
+
children: J.forecast.slice(0, 4).map((e) => /* @__PURE__ */ D("div", {
|
|
529
530
|
className: "rounded-md bg-bg-sunken/50 p-2 text-center",
|
|
530
531
|
children: [
|
|
531
532
|
/* @__PURE__ */ E("p", {
|
|
532
533
|
className: "text-xs font-medium text-text-secondary",
|
|
533
|
-
children: new Date(e.date).toLocaleDateString(
|
|
534
|
+
children: new Date(e.date).toLocaleDateString(U, { weekday: "short" })
|
|
534
535
|
}),
|
|
535
536
|
/* @__PURE__ */ D("p", {
|
|
536
537
|
className: "mt-1 text-sm font-semibold text-text-primary",
|
|
@@ -549,9 +550,9 @@ var A = {
|
|
|
549
550
|
}),
|
|
550
551
|
/* @__PURE__ */ E("button", {
|
|
551
552
|
type: "button",
|
|
552
|
-
onClick: () => V(
|
|
553
|
+
onClick: () => V(G("weather")),
|
|
553
554
|
className: "mt-auto w-full rounded-md border border-border-subtle py-2 text-sm text-text-primary transition-colors hover:bg-bg-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
554
|
-
children:
|
|
555
|
+
children: W("healthybowl.home.weatherCard.viewForecast", "View full forecast")
|
|
555
556
|
})
|
|
556
557
|
]
|
|
557
558
|
})]
|
|
@@ -559,37 +560,37 @@ var A = {
|
|
|
559
560
|
}),
|
|
560
561
|
/* @__PURE__ */ D("section", { children: [/* @__PURE__ */ E("h3", {
|
|
561
562
|
className: "mb-2 text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
562
|
-
children:
|
|
563
|
+
children: W("healthybowl.home.glance.title", "At a glance")
|
|
563
564
|
}), /* @__PURE__ */ D("div", {
|
|
564
565
|
className: "grid grid-cols-2 gap-3 sm:grid-cols-4",
|
|
565
566
|
children: [
|
|
566
567
|
/* @__PURE__ */ E(L, {
|
|
567
|
-
label:
|
|
568
|
-
value: String(
|
|
569
|
-
hint:
|
|
570
|
-
icon: /* @__PURE__ */ E(
|
|
571
|
-
onClick: () => V(
|
|
568
|
+
label: W("healthybowl.home.glance.fields", "Fields"),
|
|
569
|
+
value: String(q.totalFields),
|
|
570
|
+
hint: q.totalFields > 0 ? W("healthybowl.home.glance.fieldsHint", "Monitored") : W("healthybowl.home.glance.fieldsEmpty", "No fields yet"),
|
|
571
|
+
icon: /* @__PURE__ */ E(b, {}),
|
|
572
|
+
onClick: () => V(G("crops/fields"))
|
|
572
573
|
}),
|
|
573
574
|
/* @__PURE__ */ E(L, {
|
|
574
|
-
label:
|
|
575
|
-
value: String(
|
|
576
|
-
hint:
|
|
577
|
-
icon: /* @__PURE__ */ E(
|
|
578
|
-
onClick: () => V(
|
|
575
|
+
label: W("healthybowl.home.glance.livestock", "Livestock"),
|
|
576
|
+
value: String(q.totalAnimals),
|
|
577
|
+
hint: q.totalAnimals > 0 ? W("healthybowl.home.glance.livestockHint", "Under management") : W("healthybowl.home.glance.livestockEmpty", "No livestock added"),
|
|
578
|
+
icon: /* @__PURE__ */ E(x, {}),
|
|
579
|
+
onClick: () => V(G("livestock"))
|
|
579
580
|
}),
|
|
580
581
|
/* @__PURE__ */ E(L, {
|
|
581
|
-
label:
|
|
582
|
-
value:
|
|
583
|
-
hint:
|
|
584
|
-
icon: /* @__PURE__ */ E(
|
|
585
|
-
onClick: () => V(
|
|
582
|
+
label: W("healthybowl.home.glance.organic", "Organic score"),
|
|
583
|
+
value: q.organicScore > 0 ? `${q.organicScore}%` : W("healthybowl.home.glance.organicEmpty", "Not configured"),
|
|
584
|
+
hint: q.organicScore > 0 ? W("healthybowl.home.glance.organicHint", "Compliance") : void 0,
|
|
585
|
+
icon: /* @__PURE__ */ E(se, {}),
|
|
586
|
+
onClick: () => V(G("compliance"))
|
|
586
587
|
}),
|
|
587
588
|
/* @__PURE__ */ E(L, {
|
|
588
|
-
label:
|
|
589
|
-
value: t(
|
|
590
|
-
hint: Q == null ?
|
|
589
|
+
label: W("healthybowl.home.glance.expenses", "Expenses"),
|
|
590
|
+
value: t(q.totalExpenses, "INR"),
|
|
591
|
+
hint: Q == null ? W("healthybowl.home.glance.noRevenue", "No revenue yet") : W("healthybowl.home.glance.expensesRatio", "{{pct}}% of revenue", { pct: Q }),
|
|
591
592
|
icon: /* @__PURE__ */ E(T, {}),
|
|
592
|
-
onClick: () => V(
|
|
593
|
+
onClick: () => V(G("financial"))
|
|
593
594
|
})
|
|
594
595
|
]
|
|
595
596
|
})] })
|