@burdenoff/microfe-healthybowl 2026.812.6 → 2026.812.7
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.
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useHealthyBowl as e } from "../context/HealthyBowlContext.js";
|
|
2
|
+
import { gql as t } from "@apollo/client";
|
|
3
|
+
import { useQuery as n } from "@apollo/client/react";
|
|
4
|
+
//#region src/healthybowl/hooks/useHealthyBowlQuota.ts
|
|
5
|
+
var r = t`
|
|
6
|
+
query GetHealthyBowlQuotaStatus($context: ContextInput!) {
|
|
7
|
+
getHealthyBowlQuotaStatus(context: $context) {
|
|
8
|
+
quotaName
|
|
9
|
+
label
|
|
10
|
+
used
|
|
11
|
+
limit
|
|
12
|
+
remaining
|
|
13
|
+
noLimit
|
|
14
|
+
exhausted
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
function i() {
|
|
19
|
+
let { workspaceId: t } = e(), i = n(r, {
|
|
20
|
+
variables: { context: { workspaceId: t } },
|
|
21
|
+
skip: !t,
|
|
22
|
+
fetchPolicy: "cache-and-network"
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
...i,
|
|
26
|
+
quotas: i.data?.getHealthyBowlQuotaStatus ?? []
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { i as useHealthyBowlQuota };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=useHealthyBowlQuota.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHealthyBowlQuota.js","names":[],"sources":["../../../src/healthybowl/hooks/useHealthyBowlQuota.ts"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { useHealthyBowl } from '../context/HealthyBowlContext';\n\nconst QUOTA_STATUS_QUERY = gql`\n query GetHealthyBowlQuotaStatus($context: ContextInput!) {\n getHealthyBowlQuotaStatus(context: $context) {\n quotaName\n label\n used\n limit\n remaining\n noLimit\n exhausted\n }\n }\n`;\n\nexport interface HealthyBowlQuotaStatus {\n quotaName: string;\n label: string;\n used: number;\n limit: number | null;\n remaining: number | null;\n noLimit: boolean;\n exhausted: boolean;\n}\n\ninterface QuotaData {\n getHealthyBowlQuotaStatus: HealthyBowlQuotaStatus[];\n}\n\nexport function useHealthyBowlQuota() {\n const { workspaceId } = useHealthyBowl();\n const query = useQuery<QuotaData>(QUOTA_STATUS_QUERY, {\n variables: { context: { workspaceId } },\n skip: !workspaceId,\n fetchPolicy: 'cache-and-network',\n });\n return { ...query, quotas: query.data?.getHealthyBowlQuotaStatus ?? [] };\n}\n"],"mappings":";;;;AAIA,IAAM,IAAqB,CAAG;;;;;;;;;;;;;AA4B9B,SAAgB,IAAsB;CACpC,IAAM,EAAE,mBAAgB,GAAgB,EAClC,IAAQ,EAAoB,GAAoB;EACpD,WAAW,EAAE,SAAS,EAAE,gBAAa,EAAE;EACvC,MAAM,CAAC;EACP,aAAa;EACd,CAAC;AACF,QAAO;EAAE,GAAG;EAAO,QAAQ,EAAM,MAAM,6BAA6B,EAAE;EAAE"}
|
|
@@ -4,539 +4,597 @@ import { PageLayout as i } from "../components/PageLayout.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 c } from "../components/PageLoader.js";
|
|
8
8
|
import "../components/index.js";
|
|
9
|
-
import { useHealthyBowlData as
|
|
10
|
-
import {
|
|
9
|
+
import { useHealthyBowlData as l } from "../hooks/useHealthyBowlData.js";
|
|
10
|
+
import { useHealthyBowlQuota as ee } from "../hooks/useHealthyBowlQuota.js";
|
|
11
|
+
import { hasWeatherObservation as te } from "../utils/weatherPresence.js";
|
|
11
12
|
import { useCallback as u, useMemo as d } from "react";
|
|
12
|
-
import { useI18n as
|
|
13
|
-
import { AlertTriangle as
|
|
14
|
-
import { useNavigate as
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import { EmphasisPanel as
|
|
13
|
+
import { useI18n as f } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
14
|
+
import { AlertTriangle as p, ArrowUpRight as m, BarChart3 as ne, CalendarClock as re, CheckCircle2 as h, ChevronRight as g, ClipboardList as _, Cloud as ie, CloudOff as ae, Droplets as oe, Eye as v, MapPin as y, PawPrint as b, Plus as x, ShieldCheck as S, Sprout as C, Thermometer as w, Wallet as T, Wind as se } from "lucide-react";
|
|
15
|
+
import { useNavigate as ce } from "react-router";
|
|
16
|
+
import { Fragment as le, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
17
|
+
import { EmphasisPanel as O, GlassCard as k } from "@burdenoff/fe-libs/ui";
|
|
17
18
|
//#region src/healthybowl/pages/HomePage.tsx
|
|
18
|
-
var
|
|
19
|
+
var A = {
|
|
19
20
|
neutral: "text-text-primary",
|
|
20
21
|
success: "text-status-success-text",
|
|
21
22
|
warning: "text-status-warning-text",
|
|
22
23
|
danger: "text-status-error-text"
|
|
23
|
-
},
|
|
24
|
+
}, j = {
|
|
24
25
|
neutral: "bg-[var(--color-accent-soft)] text-text-primary",
|
|
25
26
|
success: "bg-status-success-bg text-status-success-text",
|
|
26
27
|
warning: "bg-status-warning-bg text-status-warning-text",
|
|
27
28
|
danger: "bg-status-error-bg text-status-error-text"
|
|
28
|
-
},
|
|
29
|
+
}, M = {
|
|
29
30
|
critical: 0,
|
|
30
31
|
warning: 1,
|
|
31
32
|
info: 2
|
|
32
|
-
},
|
|
33
|
+
}, N = {
|
|
33
34
|
critical: "bg-status-error-text",
|
|
34
35
|
warning: "bg-status-warning-text",
|
|
35
36
|
info: "bg-status-info-text"
|
|
36
|
-
},
|
|
37
|
+
}, P = (e) => {
|
|
37
38
|
switch (e) {
|
|
38
39
|
case "excellent": return "success";
|
|
39
40
|
case "good": return "info";
|
|
40
41
|
case "fair": return "warning";
|
|
41
42
|
default: return "error";
|
|
42
43
|
}
|
|
43
|
-
},
|
|
44
|
+
}, F = (e) => Math.max(0, Math.min(100, Math.round(e))), I = ({ label: t, value: n, icon: r, tone: i = "neutral", glow: a = !1, drillLabel: o, onClick: s }) => /* @__PURE__ */ E("button", {
|
|
44
45
|
type: "button",
|
|
45
46
|
onClick: s,
|
|
46
47
|
className: "group block text-start focus-visible:outline-none",
|
|
47
|
-
children: /* @__PURE__ */ k
|
|
48
|
+
children: /* @__PURE__ */ D(k, {
|
|
48
49
|
treatment: "metric",
|
|
49
50
|
glow: a,
|
|
50
51
|
className: "flex h-full flex-col gap-3 border-border-seam p-4 transition-shadow group-hover:shadow-pop group-focus-visible:ring-2 group-focus-visible:ring-border-focus group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-bg-canvas",
|
|
51
52
|
children: [
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ D("div", {
|
|
53
54
|
className: "flex items-center justify-between",
|
|
54
|
-
children: [/* @__PURE__ */
|
|
55
|
+
children: [/* @__PURE__ */ E("span", {
|
|
55
56
|
className: "text-sm font-medium text-text-secondary",
|
|
56
57
|
children: t
|
|
57
|
-
}), /* @__PURE__ */
|
|
58
|
-
className: e("flex size-8 items-center justify-center rounded-lg [&>svg]:size-4",
|
|
58
|
+
}), /* @__PURE__ */ E("span", {
|
|
59
|
+
className: e("flex size-8 items-center justify-center rounded-lg [&>svg]:size-4", j[i]),
|
|
59
60
|
children: r
|
|
60
61
|
})]
|
|
61
62
|
}),
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
className: e("text-3xl font-semibold tabular-nums",
|
|
63
|
+
/* @__PURE__ */ E("span", {
|
|
64
|
+
className: e("text-3xl font-semibold tabular-nums", A[i]),
|
|
64
65
|
children: n
|
|
65
66
|
}),
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ D("span", {
|
|
67
68
|
className: "mt-auto inline-flex items-center gap-1 text-xs font-medium text-text-secondary transition-colors group-hover:text-text-primary",
|
|
68
|
-
children: [o, /* @__PURE__ */
|
|
69
|
+
children: [o, /* @__PURE__ */ E(m, { className: "size-3.5" })]
|
|
69
70
|
})
|
|
70
71
|
]
|
|
71
72
|
})
|
|
72
|
-
}),
|
|
73
|
+
}), L = ({ label: e, value: t, hint: n, icon: r, onClick: i }) => /* @__PURE__ */ E("button", {
|
|
73
74
|
type: "button",
|
|
74
75
|
onClick: i,
|
|
75
76
|
className: "group block text-start focus-visible:outline-none",
|
|
76
|
-
children: /* @__PURE__ */ k
|
|
77
|
+
children: /* @__PURE__ */ D(k, {
|
|
77
78
|
className: "flex h-full items-center justify-between gap-3 border-border-seam p-3 transition-shadow group-hover:shadow-pop group-focus-visible:ring-2 group-focus-visible:ring-border-focus group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-bg-canvas",
|
|
78
|
-
children: [/* @__PURE__ */
|
|
79
|
+
children: [/* @__PURE__ */ D("div", {
|
|
79
80
|
className: "min-w-0",
|
|
80
81
|
children: [
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ E("p", {
|
|
82
83
|
className: "text-xs font-medium text-text-secondary",
|
|
83
84
|
children: e
|
|
84
85
|
}),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ E("p", {
|
|
86
87
|
className: "mt-0.5 truncate text-lg font-semibold tabular-nums text-text-primary",
|
|
87
88
|
children: t
|
|
88
89
|
}),
|
|
89
|
-
n && /* @__PURE__ */
|
|
90
|
+
n && /* @__PURE__ */ E("p", {
|
|
90
91
|
className: "mt-0.5 truncate text-xs text-text-secondary",
|
|
91
92
|
children: n
|
|
92
93
|
})
|
|
93
94
|
]
|
|
94
|
-
}), /* @__PURE__ */
|
|
95
|
+
}), /* @__PURE__ */ E("span", {
|
|
95
96
|
className: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-secondary [&>svg]:size-4",
|
|
96
97
|
children: r
|
|
97
98
|
})]
|
|
98
99
|
})
|
|
99
|
-
}),
|
|
100
|
+
}), R = ({ alert: t, ctaLabel: n, relTime: r, onOpen: i }) => /* @__PURE__ */ D("li", {
|
|
100
101
|
className: "flex items-start gap-3 py-3",
|
|
101
|
-
children: [/* @__PURE__ */
|
|
102
|
-
className: e("mt-1.5 size-2.5 shrink-0 rounded-full",
|
|
102
|
+
children: [/* @__PURE__ */ E("span", {
|
|
103
|
+
className: e("mt-1.5 size-2.5 shrink-0 rounded-full", N[t.severity]),
|
|
103
104
|
"aria-hidden": !0
|
|
104
|
-
}), /* @__PURE__ */
|
|
105
|
+
}), /* @__PURE__ */ D("div", {
|
|
105
106
|
className: "min-w-0 flex-1",
|
|
106
107
|
children: [
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ D("div", {
|
|
108
109
|
className: "flex items-baseline justify-between gap-3",
|
|
109
|
-
children: [/* @__PURE__ */
|
|
110
|
+
children: [/* @__PURE__ */ E("p", {
|
|
110
111
|
className: "truncate text-sm font-medium text-text-primary",
|
|
111
112
|
children: t.title
|
|
112
|
-
}), /* @__PURE__ */
|
|
113
|
+
}), /* @__PURE__ */ E("button", {
|
|
113
114
|
type: "button",
|
|
114
115
|
onClick: i,
|
|
115
116
|
className: "shrink-0 text-xs font-medium text-action-primary-bg transition-colors hover:underline focus-visible:underline focus-visible:outline-none",
|
|
116
117
|
children: n
|
|
117
118
|
})]
|
|
118
119
|
}),
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ E("p", {
|
|
120
121
|
className: "mt-0.5 truncate text-xs text-text-secondary",
|
|
121
122
|
children: t.message
|
|
122
123
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ E("p", {
|
|
124
125
|
className: "mt-0.5 text-xs text-text-muted",
|
|
125
126
|
children: r
|
|
126
127
|
})
|
|
127
128
|
]
|
|
128
129
|
})]
|
|
129
|
-
}),
|
|
130
|
+
}), z = ({ crop: e, metaLabel: t, healthLabel: n, harvestLabel: r, openLabel: i, onOpen: o }) => /* @__PURE__ */ E("li", { children: /* @__PURE__ */ D("button", {
|
|
130
131
|
type: "button",
|
|
131
132
|
onClick: o,
|
|
132
133
|
className: "group block w-full rounded-lg p-3 text-start transition-colors hover:bg-bg-sunken/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
133
134
|
children: [
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ D("div", {
|
|
135
136
|
className: "flex items-center justify-between gap-2",
|
|
136
|
-
children: [/* @__PURE__ */
|
|
137
|
+
children: [/* @__PURE__ */ D("div", {
|
|
137
138
|
className: "min-w-0",
|
|
138
|
-
children: [/* @__PURE__ */
|
|
139
|
+
children: [/* @__PURE__ */ E("p", {
|
|
139
140
|
className: "truncate text-sm font-medium text-text-primary",
|
|
140
141
|
children: e.name
|
|
141
|
-
}), /* @__PURE__ */
|
|
142
|
+
}), /* @__PURE__ */ E("p", {
|
|
142
143
|
className: "truncate text-xs text-text-secondary",
|
|
143
144
|
children: t
|
|
144
145
|
})]
|
|
145
|
-
}), /* @__PURE__ */
|
|
146
|
+
}), /* @__PURE__ */ E(a, {
|
|
146
147
|
label: n,
|
|
147
|
-
variant:
|
|
148
|
+
variant: P(e.healthStatus),
|
|
148
149
|
dot: !0
|
|
149
150
|
})]
|
|
150
151
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ D("div", {
|
|
152
153
|
className: "mt-2 flex items-center gap-3",
|
|
153
|
-
children: [/* @__PURE__ */
|
|
154
|
+
children: [/* @__PURE__ */ E("div", {
|
|
154
155
|
className: "h-1.5 flex-1 overflow-hidden rounded-full bg-bg-sunken",
|
|
155
|
-
children: /* @__PURE__ */
|
|
156
|
+
children: /* @__PURE__ */ E("div", {
|
|
156
157
|
className: "h-full rounded-full bg-action-primary-bg",
|
|
157
|
-
style: { width: `${
|
|
158
|
+
style: { width: `${F(e.progress)}%` }
|
|
158
159
|
})
|
|
159
|
-
}), /* @__PURE__ */
|
|
160
|
+
}), /* @__PURE__ */ D("span", {
|
|
160
161
|
className: "w-9 shrink-0 text-end text-xs font-medium tabular-nums text-text-secondary",
|
|
161
|
-
children: [
|
|
162
|
+
children: [F(e.progress), "%"]
|
|
162
163
|
})]
|
|
163
164
|
}),
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ D("div", {
|
|
165
166
|
className: "mt-1.5 flex items-center justify-between text-xs text-text-secondary",
|
|
166
|
-
children: [/* @__PURE__ */
|
|
167
|
+
children: [/* @__PURE__ */ E("span", {
|
|
167
168
|
className: "truncate",
|
|
168
169
|
children: r
|
|
169
|
-
}), /* @__PURE__ */
|
|
170
|
+
}), /* @__PURE__ */ D("span", {
|
|
170
171
|
className: "inline-flex shrink-0 items-center gap-0.5 font-medium transition-colors group-hover:text-text-primary",
|
|
171
|
-
children: [i, /* @__PURE__ */
|
|
172
|
+
children: [i, /* @__PURE__ */ E(g, { className: "size-3.5" })]
|
|
172
173
|
})]
|
|
173
174
|
})
|
|
174
175
|
]
|
|
175
|
-
}) }),
|
|
176
|
-
let { dashboardStats: a, alerts:
|
|
177
|
-
location:
|
|
178
|
-
current:
|
|
179
|
-
forecast:
|
|
180
|
-
},
|
|
176
|
+
}) }), B = () => {
|
|
177
|
+
let { dashboardStats: a, alerts: m, crops: g, weatherData: A, markAlertRead: j, farm: N, loadings: P, errors: F, refetch: B } = l(), V = ce(), { t: H } = f(), U = u((e, t, n) => H(e, t, n), [H]), { buildPath: W } = r(), { quotas: G, loading: ue } = ee(), K = a, q = {
|
|
178
|
+
location: A?.location ?? "",
|
|
179
|
+
current: A?.current,
|
|
180
|
+
forecast: A?.forecast ?? []
|
|
181
|
+
}, J = te(q.current), Y = d(() => (/* @__PURE__ */ new Date()).toLocaleDateString(void 0, {
|
|
181
182
|
weekday: "long",
|
|
182
183
|
day: "numeric",
|
|
183
184
|
month: "long"
|
|
184
|
-
}), []), X = d(() => [...
|
|
185
|
+
}), []), X = d(() => [...m].sort((e, t) => M[e.severity] - M[t.severity]), [m]), de = X.slice(0, 5), Z = m.length, fe = d(() => [...g].sort((e, t) => (e.daysToHarvest ?? 2 ** 53 - 1) - (t.daysToHarvest ?? 2 ** 53 - 1)), [g]).slice(0, 6), Q = d(() => K.totalRevenue === 0 ? null : Math.round(K.totalExpenses / K.totalRevenue * 100 * 10) / 10, [K.totalExpenses, K.totalRevenue]), pe = u((e) => {
|
|
185
186
|
let t = new Date(e).getTime();
|
|
186
187
|
if (Number.isNaN(t)) return "";
|
|
187
188
|
let n = Math.max(0, Math.floor((Date.now() - t) / 6e4));
|
|
188
|
-
if (n < 1) return
|
|
189
|
-
if (n < 60) return
|
|
189
|
+
if (n < 1) return U("healthybowl.home.time.now", "just now");
|
|
190
|
+
if (n < 60) return U("healthybowl.home.time.minutes", "{{n}}m ago", { n });
|
|
190
191
|
let r = Math.floor(n / 60);
|
|
191
|
-
if (r < 24) return
|
|
192
|
+
if (r < 24) return U("healthybowl.home.time.hours", "{{n}}h ago", { n: r });
|
|
192
193
|
let i = Math.floor(r / 24);
|
|
193
|
-
return i < 7 ?
|
|
194
|
-
}, [
|
|
195
|
-
|
|
196
|
-
}, [
|
|
194
|
+
return i < 7 ? U("healthybowl.home.time.days", "{{n}}d ago", { n: i }) : U("healthybowl.home.time.weeks", "{{n}}w ago", { n: Math.floor(i / 7) });
|
|
195
|
+
}, [U]), me = u((e) => e === "critical" ? U("healthybowl.home.needsAttention.review", "Review") : e === "warning" ? U("healthybowl.home.needsAttention.open", "Open") : U("healthybowl.home.needsAttention.view", "View"), [U]), he = u((e) => {
|
|
196
|
+
j(e.id, !0), e.actionUrl && V(e.actionUrl);
|
|
197
|
+
}, [j, V]), ge = K.netProfit > 0 ? "success" : K.netProfit < 0 ? "danger" : "neutral", _e = m.some((e) => e.severity === "critical"), ve = m.some((e) => e.severity === "warning"), $ = Z === 0 ? "success" : _e ? "danger" : ve ? "warning" : "neutral", ye = [
|
|
197
198
|
{
|
|
198
|
-
label:
|
|
199
|
-
icon:
|
|
200
|
-
path:
|
|
199
|
+
label: U("healthybowl.home.quickActions.addCrop.label", "Add crop"),
|
|
200
|
+
icon: C,
|
|
201
|
+
path: W("crops")
|
|
201
202
|
},
|
|
202
203
|
{
|
|
203
|
-
label:
|
|
204
|
+
label: U("healthybowl.home.quickActions.recordHarvest.label", "Record harvest"),
|
|
204
205
|
icon: _,
|
|
205
|
-
path:
|
|
206
|
+
path: W("crops/harvest")
|
|
206
207
|
},
|
|
207
208
|
{
|
|
208
|
-
label:
|
|
209
|
-
icon:
|
|
210
|
-
path:
|
|
209
|
+
label: U("healthybowl.home.quickActions.viewFields.label", "View fields"),
|
|
210
|
+
icon: y,
|
|
211
|
+
path: W("crops/fields")
|
|
211
212
|
},
|
|
212
213
|
{
|
|
213
|
-
label:
|
|
214
|
-
icon:
|
|
215
|
-
path:
|
|
214
|
+
label: U("healthybowl.home.quickActions.viewWeather.label", "View weather"),
|
|
215
|
+
icon: w,
|
|
216
|
+
path: W("weather")
|
|
216
217
|
},
|
|
217
218
|
{
|
|
218
|
-
label:
|
|
219
|
+
label: U("healthybowl.home.quickActions.analytics.label", "Analytics"),
|
|
219
220
|
icon: ne,
|
|
220
|
-
path:
|
|
221
|
+
path: W("analytics")
|
|
221
222
|
}
|
|
222
|
-
],
|
|
223
|
+
], be = Z === 0 ? U("healthybowl.home.header.allClear", "You're all caught up") : Z === 1 ? U("healthybowl.home.header.needsAttentionOne", "1 item needs your attention") : U("healthybowl.home.header.needsAttentionOther", "{{count}} items need your attention", { count: Z }), xe = N?.name ? `${Y} · ${N.name}` : Y, Se = /* @__PURE__ */ D("button", {
|
|
223
224
|
type: "button",
|
|
224
|
-
onClick: () =>
|
|
225
|
+
onClick: () => V(W("crops")),
|
|
225
226
|
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",
|
|
226
|
-
children: [/* @__PURE__ */
|
|
227
|
+
children: [/* @__PURE__ */ E(x, { className: "h-4 w-4" }), U("healthybowl.home.primaryAction", "Add")]
|
|
227
228
|
});
|
|
228
|
-
return /* @__PURE__ */
|
|
229
|
-
title:
|
|
230
|
-
description:
|
|
231
|
-
actions:
|
|
232
|
-
children:
|
|
229
|
+
return /* @__PURE__ */ D(i, {
|
|
230
|
+
title: U("healthybowl.home.title", "Farm Dashboard"),
|
|
231
|
+
description: xe,
|
|
232
|
+
actions: Se,
|
|
233
|
+
children: [/* @__PURE__ */ D("section", {
|
|
234
|
+
"aria-labelledby": "healthy-bowl-quota-heading",
|
|
235
|
+
className: "mb-6 rounded-xl border border-border-seam bg-bg-surface p-5",
|
|
236
|
+
children: [/* @__PURE__ */ D("div", {
|
|
237
|
+
className: "mb-4 flex items-center justify-between gap-3",
|
|
238
|
+
children: [/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("h2", {
|
|
239
|
+
id: "healthy-bowl-quota-heading",
|
|
240
|
+
className: "text-base font-semibold text-text-primary",
|
|
241
|
+
children: U("healthybowl.home.quotas.title", "Plan usage")
|
|
242
|
+
}), /* @__PURE__ */ E("p", {
|
|
243
|
+
className: "text-sm text-text-secondary",
|
|
244
|
+
children: U("healthybowl.home.quotas.description", "See what your farm plan has used and what remains.")
|
|
245
|
+
})] }), /* @__PURE__ */ E("button", {
|
|
246
|
+
type: "button",
|
|
247
|
+
onClick: () => V("/billing"),
|
|
248
|
+
className: "text-sm font-medium text-action-primary-text hover:underline",
|
|
249
|
+
children: U("healthybowl.home.quotas.billing", "Manage plan")
|
|
250
|
+
})]
|
|
251
|
+
}), ue && G.length === 0 ? /* @__PURE__ */ E("p", {
|
|
252
|
+
className: "text-sm text-text-secondary",
|
|
253
|
+
children: U("healthybowl.common.loading", "Loading…")
|
|
254
|
+
}) : /* @__PURE__ */ E("div", {
|
|
255
|
+
className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-5",
|
|
256
|
+
children: G.map((e) => {
|
|
257
|
+
let t = e.noLimit || e.limit === null || e.limit === 0 ? 0 : Math.min(100, Math.round(e.used / e.limit * 100));
|
|
258
|
+
return /* @__PURE__ */ D("div", {
|
|
259
|
+
className: "rounded-lg border border-border-seam bg-bg-canvas p-3",
|
|
260
|
+
children: [
|
|
261
|
+
/* @__PURE__ */ D("div", {
|
|
262
|
+
className: "flex items-start justify-between gap-2",
|
|
263
|
+
children: [/* @__PURE__ */ E("span", {
|
|
264
|
+
className: "text-sm font-medium text-text-primary",
|
|
265
|
+
children: e.label
|
|
266
|
+
}), e.noLimit ? /* @__PURE__ */ E("span", {
|
|
267
|
+
className: "text-xs text-text-secondary",
|
|
268
|
+
children: U("healthybowl.home.quotas.unlimited", "Unlimited")
|
|
269
|
+
}) : null]
|
|
270
|
+
}),
|
|
271
|
+
/* @__PURE__ */ D("p", {
|
|
272
|
+
className: "mt-2 text-lg font-semibold text-text-primary",
|
|
273
|
+
children: [e.used, e.limit === null ? "" : ` / ${e.limit}`]
|
|
274
|
+
}),
|
|
275
|
+
e.limit === null ? null : /* @__PURE__ */ E("div", {
|
|
276
|
+
className: "mt-2 h-2 overflow-hidden rounded-full bg-bg-sunken",
|
|
277
|
+
children: /* @__PURE__ */ E("div", {
|
|
278
|
+
className: `h-full ${e.exhausted ? "bg-status-error-bg" : "bg-action-primary-bg"}`,
|
|
279
|
+
style: { width: `${t}%` }
|
|
280
|
+
})
|
|
281
|
+
}),
|
|
282
|
+
/* @__PURE__ */ E("p", {
|
|
283
|
+
className: `mt-1 text-xs ${e.exhausted ? "text-status-error-text" : "text-text-secondary"}`,
|
|
284
|
+
children: e.exhausted ? U("healthybowl.home.quotas.exhausted", "Limit reached") : e.remaining === null ? U("healthybowl.home.quotas.noLimitRemaining", "No limit") : U("healthybowl.home.quotas.remaining", "{{count}} remaining", { count: e.remaining })
|
|
285
|
+
})
|
|
286
|
+
]
|
|
287
|
+
}, e.quotaName);
|
|
288
|
+
})
|
|
289
|
+
})]
|
|
290
|
+
}), P.dashboard ? /* @__PURE__ */ E(c, {}) : F.dashboard ? /* @__PURE__ */ E(s, { onRetry: B }) : /* @__PURE__ */ D("div", {
|
|
233
291
|
className: "space-y-6",
|
|
234
292
|
children: [
|
|
235
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ D("div", {
|
|
236
294
|
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"),
|
|
237
|
-
children: [
|
|
295
|
+
children: [E(Z === 0 ? h : p, { className: "size-4" }), be]
|
|
238
296
|
}),
|
|
239
|
-
!
|
|
297
|
+
!N?.id && /* @__PURE__ */ D(O, {
|
|
240
298
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
241
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("p", {
|
|
242
300
|
className: "text-base font-semibold text-text-primary",
|
|
243
|
-
children:
|
|
244
|
-
}), /* @__PURE__ */
|
|
301
|
+
children: U("healthybowl.home.onboarding.title", "Welcome to HealthyBowl")
|
|
302
|
+
}), /* @__PURE__ */ E("p", {
|
|
245
303
|
className: "text-sm text-text-secondary",
|
|
246
|
-
children:
|
|
247
|
-
})] }), /* @__PURE__ */
|
|
304
|
+
children: U("healthybowl.home.onboarding.description", "Set up your farm to start tracking crops, livestock, finances, and more.")
|
|
305
|
+
})] }), /* @__PURE__ */ D("button", {
|
|
248
306
|
type: "button",
|
|
249
|
-
onClick: () =>
|
|
307
|
+
onClick: () => V(W("getting-started")),
|
|
250
308
|
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",
|
|
251
|
-
children: [/* @__PURE__ */
|
|
309
|
+
children: [/* @__PURE__ */ E(x, { className: "h-4 w-4" }), U("healthybowl.home.onboarding.action", "Set up your farm")]
|
|
252
310
|
})]
|
|
253
311
|
}),
|
|
254
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ E("div", {
|
|
255
313
|
className: "flex flex-wrap gap-2",
|
|
256
|
-
children:
|
|
314
|
+
children: ye.map(({ label: e, icon: t, path: n }) => /* @__PURE__ */ D("button", {
|
|
257
315
|
type: "button",
|
|
258
|
-
onClick: () =>
|
|
316
|
+
onClick: () => V(n),
|
|
259
317
|
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",
|
|
260
|
-
children: [/* @__PURE__ */
|
|
318
|
+
children: [/* @__PURE__ */ E(t, { className: "size-4" }), e]
|
|
261
319
|
}, e))
|
|
262
320
|
}),
|
|
263
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ D("div", {
|
|
264
322
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
265
|
-
children: [/* @__PURE__ */
|
|
323
|
+
children: [/* @__PURE__ */ D("div", {
|
|
266
324
|
className: "grid grid-cols-2 gap-4 lg:col-span-2",
|
|
267
325
|
children: [
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
label:
|
|
270
|
-
value: String(
|
|
271
|
-
icon: /* @__PURE__ */
|
|
272
|
-
drillLabel:
|
|
273
|
-
onClick: () =>
|
|
326
|
+
/* @__PURE__ */ E(I, {
|
|
327
|
+
label: U("healthybowl.home.kpi.activeCrops", "Active crops"),
|
|
328
|
+
value: String(K.activeCrops),
|
|
329
|
+
icon: /* @__PURE__ */ E(C, {}),
|
|
330
|
+
drillLabel: U("healthybowl.home.kpi.viewCrops", "View crops"),
|
|
331
|
+
onClick: () => V(W("crops"))
|
|
274
332
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
276
|
-
label:
|
|
277
|
-
value: String(
|
|
278
|
-
icon: /* @__PURE__ */
|
|
279
|
-
drillLabel:
|
|
280
|
-
onClick: () =>
|
|
333
|
+
/* @__PURE__ */ E(I, {
|
|
334
|
+
label: U("healthybowl.home.kpi.harvestDue", "Harvest due"),
|
|
335
|
+
value: String(K.harvestDue),
|
|
336
|
+
icon: /* @__PURE__ */ E(re, {}),
|
|
337
|
+
drillLabel: U("healthybowl.home.kpi.viewHarvest", "View harvest"),
|
|
338
|
+
onClick: () => V(W("crops/harvest"))
|
|
281
339
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
-
label:
|
|
284
|
-
value: t(
|
|
285
|
-
icon: /* @__PURE__ */
|
|
286
|
-
tone:
|
|
287
|
-
drillLabel:
|
|
288
|
-
onClick: () =>
|
|
340
|
+
/* @__PURE__ */ E(I, {
|
|
341
|
+
label: U("healthybowl.home.kpi.netProfit", "Net profit"),
|
|
342
|
+
value: t(K.netProfit, "INR"),
|
|
343
|
+
icon: /* @__PURE__ */ E(T, {}),
|
|
344
|
+
tone: ge,
|
|
345
|
+
drillLabel: U("healthybowl.home.kpi.viewFinance", "View finances"),
|
|
346
|
+
onClick: () => V(W("financial"))
|
|
289
347
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
-
label:
|
|
348
|
+
/* @__PURE__ */ E(I, {
|
|
349
|
+
label: U("healthybowl.home.kpi.needsAttention", "Needs attention"),
|
|
292
350
|
value: String(Z),
|
|
293
|
-
icon: /* @__PURE__ */
|
|
351
|
+
icon: /* @__PURE__ */ E(p, {}),
|
|
294
352
|
tone: $,
|
|
295
353
|
glow: $ === "danger" || $ === "warning",
|
|
296
|
-
drillLabel:
|
|
297
|
-
onClick: () =>
|
|
354
|
+
drillLabel: U("healthybowl.home.kpi.viewAlerts", "View alerts"),
|
|
355
|
+
onClick: () => V(W("weather/alerts"))
|
|
298
356
|
})
|
|
299
357
|
]
|
|
300
|
-
}), /* @__PURE__ */ k
|
|
358
|
+
}), /* @__PURE__ */ D(k, {
|
|
301
359
|
className: "flex h-full flex-col border-border-seam p-0",
|
|
302
|
-
children: [/* @__PURE__ */
|
|
360
|
+
children: [/* @__PURE__ */ D("div", {
|
|
303
361
|
className: "flex items-center justify-between px-4 pb-1 pt-4",
|
|
304
|
-
children: [/* @__PURE__ */
|
|
362
|
+
children: [/* @__PURE__ */ E("h3", {
|
|
305
363
|
className: "text-sm font-semibold text-text-primary",
|
|
306
|
-
children:
|
|
307
|
-
}), X.length > 0 && /* @__PURE__ */
|
|
364
|
+
children: U("healthybowl.home.needsAttention.title", "Needs attention")
|
|
365
|
+
}), X.length > 0 && /* @__PURE__ */ E("button", {
|
|
308
366
|
type: "button",
|
|
309
|
-
onClick: () =>
|
|
367
|
+
onClick: () => V(W("weather/alerts")),
|
|
310
368
|
className: "text-xs font-medium text-text-secondary transition-colors hover:text-text-primary focus-visible:text-text-primary focus-visible:outline-none",
|
|
311
|
-
children:
|
|
369
|
+
children: U("healthybowl.home.needsAttention.viewAll", "View all")
|
|
312
370
|
})]
|
|
313
|
-
}), /* @__PURE__ */
|
|
371
|
+
}), /* @__PURE__ */ E("div", {
|
|
314
372
|
className: "flex-1 px-4 pb-4",
|
|
315
|
-
children: X.length === 0 ? /* @__PURE__ */
|
|
316
|
-
icon: /* @__PURE__ */
|
|
317
|
-
title:
|
|
318
|
-
description:
|
|
319
|
-
action: /* @__PURE__ */
|
|
373
|
+
children: X.length === 0 ? /* @__PURE__ */ E(o, {
|
|
374
|
+
icon: /* @__PURE__ */ E(h, { className: "h-8 w-8 text-status-success-text" }),
|
|
375
|
+
title: U("healthybowl.home.needsAttention.empty.title", "You're all caught up"),
|
|
376
|
+
description: U("healthybowl.home.needsAttention.empty.description", "No urgent farm alerts right now."),
|
|
377
|
+
action: /* @__PURE__ */ E("button", {
|
|
320
378
|
type: "button",
|
|
321
|
-
onClick: () =>
|
|
379
|
+
onClick: () => V(W("weather/alert-rules")),
|
|
322
380
|
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",
|
|
323
|
-
children:
|
|
381
|
+
children: U("healthybowl.home.needsAttention.empty.action", "Manage alert rules")
|
|
324
382
|
})
|
|
325
|
-
}) : /* @__PURE__ */
|
|
383
|
+
}) : /* @__PURE__ */ E("ul", {
|
|
326
384
|
className: "divide-y divide-border-subtle",
|
|
327
|
-
children:
|
|
385
|
+
children: de.map((e) => /* @__PURE__ */ E(R, {
|
|
328
386
|
alert: e,
|
|
329
|
-
ctaLabel:
|
|
330
|
-
relTime:
|
|
331
|
-
onOpen: () =>
|
|
387
|
+
ctaLabel: me(e.severity),
|
|
388
|
+
relTime: pe(e.timestamp),
|
|
389
|
+
onOpen: () => he(e)
|
|
332
390
|
}, e.id))
|
|
333
391
|
})
|
|
334
392
|
})]
|
|
335
393
|
})]
|
|
336
394
|
}),
|
|
337
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ D("div", {
|
|
338
396
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
339
|
-
children: [/* @__PURE__ */ k
|
|
397
|
+
children: [/* @__PURE__ */ D(k, {
|
|
340
398
|
glow: !0,
|
|
341
399
|
className: "flex h-full flex-col border-border-seam p-0 lg:col-span-2",
|
|
342
|
-
children: [/* @__PURE__ */
|
|
400
|
+
children: [/* @__PURE__ */ D("div", {
|
|
343
401
|
className: "flex items-center justify-between px-5 pb-2 pt-5",
|
|
344
|
-
children: [/* @__PURE__ */
|
|
402
|
+
children: [/* @__PURE__ */ D("div", {
|
|
345
403
|
className: "flex items-center gap-2",
|
|
346
|
-
children: [/* @__PURE__ */
|
|
404
|
+
children: [/* @__PURE__ */ E("span", {
|
|
347
405
|
className: "flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-primary [&>svg]:size-4",
|
|
348
|
-
children: /* @__PURE__ */
|
|
349
|
-
}), /* @__PURE__ */
|
|
406
|
+
children: /* @__PURE__ */ E(C, {})
|
|
407
|
+
}), /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("h2", {
|
|
350
408
|
className: "text-base font-semibold text-text-primary",
|
|
351
|
-
children:
|
|
352
|
-
}), /* @__PURE__ */
|
|
409
|
+
children: U("healthybowl.home.cropsAnchor.title", "Crop overview")
|
|
410
|
+
}), /* @__PURE__ */ E("p", {
|
|
353
411
|
className: "text-xs text-text-secondary",
|
|
354
|
-
children: g.length === 1 ?
|
|
412
|
+
children: g.length === 1 ? U("healthybowl.home.cropsAnchor.subtitleOne", "1 crop in progress") : U("healthybowl.home.cropsAnchor.subtitleOther", "{{count}} crops in progress", { count: g.length })
|
|
355
413
|
})] })]
|
|
356
|
-
}), g.length > 0 && /* @__PURE__ */
|
|
414
|
+
}), g.length > 0 && /* @__PURE__ */ E("button", {
|
|
357
415
|
type: "button",
|
|
358
|
-
onClick: () =>
|
|
416
|
+
onClick: () => V(W("crops")),
|
|
359
417
|
className: "text-xs font-medium text-text-secondary transition-colors hover:text-text-primary focus-visible:text-text-primary focus-visible:outline-none",
|
|
360
|
-
children:
|
|
418
|
+
children: U("healthybowl.home.cropsAnchor.viewAll", "View all crops")
|
|
361
419
|
})]
|
|
362
|
-
}), /* @__PURE__ */
|
|
420
|
+
}), /* @__PURE__ */ E("div", {
|
|
363
421
|
className: "flex-1 px-3 pb-3",
|
|
364
|
-
children: g.length === 0 ? /* @__PURE__ */
|
|
365
|
-
icon: /* @__PURE__ */
|
|
366
|
-
title:
|
|
367
|
-
description:
|
|
368
|
-
action: /* @__PURE__ */
|
|
422
|
+
children: g.length === 0 ? /* @__PURE__ */ E(o, {
|
|
423
|
+
icon: /* @__PURE__ */ E(C, { className: "h-8 w-8 text-primary" }),
|
|
424
|
+
title: U("healthybowl.home.cropsAnchor.empty.title", "No active crops"),
|
|
425
|
+
description: U("healthybowl.home.cropsAnchor.empty.description", "Register your first crop to track growth, health and harvest here."),
|
|
426
|
+
action: /* @__PURE__ */ D("button", {
|
|
369
427
|
type: "button",
|
|
370
|
-
onClick: () =>
|
|
428
|
+
onClick: () => V(W("crops")),
|
|
371
429
|
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",
|
|
372
|
-
children: [/* @__PURE__ */
|
|
430
|
+
children: [/* @__PURE__ */ E(x, { className: "h-4 w-4" }), U("healthybowl.home.quickActions.addCrop.label", "Add crop")]
|
|
373
431
|
})
|
|
374
|
-
}) : /* @__PURE__ */
|
|
432
|
+
}) : /* @__PURE__ */ E("ul", {
|
|
375
433
|
className: "divide-y divide-border-subtle",
|
|
376
|
-
children:
|
|
434
|
+
children: fe.map((e) => {
|
|
377
435
|
let t = (e.growthStage || e.status || "").replace(/_/g, " ").trim();
|
|
378
|
-
return /* @__PURE__ */
|
|
436
|
+
return /* @__PURE__ */ E(z, {
|
|
379
437
|
crop: e,
|
|
380
|
-
metaLabel: [e.fieldName, t].filter(Boolean).join(" · ") ||
|
|
438
|
+
metaLabel: [e.fieldName, t].filter(Boolean).join(" · ") || U("healthybowl.home.cropsAnchor.noField", "Unassigned"),
|
|
381
439
|
healthLabel: (e.healthStatus || "unknown").replace(/_/g, " "),
|
|
382
|
-
harvestLabel: e.expectedHarvestDate ?
|
|
383
|
-
openLabel:
|
|
384
|
-
onOpen: () =>
|
|
440
|
+
harvestLabel: e.expectedHarvestDate ? U("healthybowl.home.cropsAnchor.harvest", "Harvest {{date}}", { date: n(e.expectedHarvestDate) }) : U("healthybowl.home.cropsAnchor.harvestUnknown", "Harvest date TBD"),
|
|
441
|
+
openLabel: U("healthybowl.home.cropsAnchor.open", "Open"),
|
|
442
|
+
onOpen: () => V(W(`crops/${e.id}`))
|
|
385
443
|
}, e.id);
|
|
386
444
|
})
|
|
387
445
|
})
|
|
388
446
|
})]
|
|
389
|
-
}), /* @__PURE__ */ k
|
|
447
|
+
}), /* @__PURE__ */ D(k, {
|
|
390
448
|
className: "flex h-full flex-col border-border-seam p-0",
|
|
391
|
-
children: [/* @__PURE__ */
|
|
449
|
+
children: [/* @__PURE__ */ D("div", {
|
|
392
450
|
className: "px-4 pb-1 pt-4",
|
|
393
|
-
children: [/* @__PURE__ */
|
|
451
|
+
children: [/* @__PURE__ */ E("h3", {
|
|
394
452
|
className: "text-sm font-semibold text-text-primary",
|
|
395
|
-
children:
|
|
396
|
-
}),
|
|
453
|
+
children: U("healthybowl.home.weatherCard.title", "Current weather")
|
|
454
|
+
}), q.location && /* @__PURE__ */ E("p", {
|
|
397
455
|
className: "text-xs text-text-secondary",
|
|
398
|
-
children:
|
|
456
|
+
children: q.location
|
|
399
457
|
})]
|
|
400
|
-
}), /* @__PURE__ */
|
|
458
|
+
}), /* @__PURE__ */ D("div", {
|
|
401
459
|
className: "flex flex-1 flex-col gap-4 px-4 pb-4",
|
|
402
460
|
children: [
|
|
403
|
-
|
|
461
|
+
J ? /* @__PURE__ */ D(le, { children: [/* @__PURE__ */ D("div", {
|
|
404
462
|
className: "flex items-center justify-between",
|
|
405
|
-
children: [/* @__PURE__ */
|
|
406
|
-
/* @__PURE__ */
|
|
463
|
+
children: [/* @__PURE__ */ D("div", { children: [
|
|
464
|
+
/* @__PURE__ */ D("p", {
|
|
407
465
|
className: "text-4xl font-bold text-text-primary",
|
|
408
|
-
children: [
|
|
466
|
+
children: [q.current.temperature, "°C"]
|
|
409
467
|
}),
|
|
410
|
-
/* @__PURE__ */
|
|
468
|
+
/* @__PURE__ */ E("p", {
|
|
411
469
|
className: "text-sm text-text-secondary",
|
|
412
|
-
children:
|
|
470
|
+
children: q.current.condition
|
|
413
471
|
}),
|
|
414
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ D("p", {
|
|
415
473
|
className: "mt-1 text-xs text-text-secondary",
|
|
416
474
|
children: [
|
|
417
|
-
|
|
475
|
+
U("healthybowl.home.weatherCard.feelsLike", "Feels like"),
|
|
418
476
|
" ",
|
|
419
|
-
|
|
477
|
+
q.current.feelsLike,
|
|
420
478
|
"°C"
|
|
421
479
|
]
|
|
422
480
|
})
|
|
423
|
-
] }), /* @__PURE__ */
|
|
481
|
+
] }), /* @__PURE__ */ D("div", {
|
|
424
482
|
className: "flex flex-col items-center",
|
|
425
|
-
children: [/* @__PURE__ */
|
|
483
|
+
children: [/* @__PURE__ */ E(ie, { className: "h-12 w-12 text-text-secondary" }), /* @__PURE__ */ D("span", {
|
|
426
484
|
className: "mt-1 text-xs text-text-secondary",
|
|
427
|
-
children: ["UV ",
|
|
485
|
+
children: ["UV ", q.current.uvIndex]
|
|
428
486
|
})]
|
|
429
487
|
})]
|
|
430
|
-
}), /* @__PURE__ */
|
|
488
|
+
}), /* @__PURE__ */ D("div", {
|
|
431
489
|
className: "grid grid-cols-2 gap-3 border-t border-border-subtle pt-3",
|
|
432
490
|
children: [
|
|
433
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ D("div", {
|
|
434
492
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
435
|
-
children: [/* @__PURE__ */
|
|
436
|
-
|
|
493
|
+
children: [/* @__PURE__ */ E(oe, { className: "h-4 w-4" }), /* @__PURE__ */ D("span", { children: [
|
|
494
|
+
q.current.humidity,
|
|
437
495
|
"% ",
|
|
438
|
-
|
|
496
|
+
U("healthybowl.home.weatherCard.humidity", "Humidity")
|
|
439
497
|
] })]
|
|
440
498
|
}),
|
|
441
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ D("div", {
|
|
442
500
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
443
|
-
children: [/* @__PURE__ */
|
|
501
|
+
children: [/* @__PURE__ */ E(se, { className: "h-4 w-4" }), /* @__PURE__ */ D("span", { children: [q.current.windSpeed, " km/h"] })]
|
|
444
502
|
}),
|
|
445
|
-
/* @__PURE__ */
|
|
503
|
+
/* @__PURE__ */ D("div", {
|
|
446
504
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
447
|
-
children: [/* @__PURE__ */
|
|
505
|
+
children: [/* @__PURE__ */ E(w, { className: "h-4 w-4" }), /* @__PURE__ */ D("span", { children: [q.current.pressure, " hPa"] })]
|
|
448
506
|
}),
|
|
449
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ D("div", {
|
|
450
508
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
451
|
-
children: [/* @__PURE__ */
|
|
509
|
+
children: [/* @__PURE__ */ E(v, { className: "h-4 w-4" }), /* @__PURE__ */ D("span", { children: [q.current.visibility, " km"] })]
|
|
452
510
|
})
|
|
453
511
|
]
|
|
454
|
-
})] }) : /* @__PURE__ */
|
|
455
|
-
icon: /* @__PURE__ */
|
|
456
|
-
title:
|
|
457
|
-
description:
|
|
458
|
-
action: /* @__PURE__ */
|
|
512
|
+
})] }) : /* @__PURE__ */ E(o, {
|
|
513
|
+
icon: /* @__PURE__ */ E(ae, { className: "h-8 w-8 text-text-muted" }),
|
|
514
|
+
title: F.weather ? U("healthybowl.home.weatherCard.error.title", "Weather unavailable") : U("healthybowl.home.weatherCard.empty.title", "No weather yet"),
|
|
515
|
+
description: F.weather ? U("healthybowl.home.weatherCard.error.description", "We couldn't load conditions for your farm just now.") : U("healthybowl.home.weatherCard.empty.description", "Set your farm location to see local conditions here."),
|
|
516
|
+
action: /* @__PURE__ */ E("button", {
|
|
459
517
|
type: "button",
|
|
460
|
-
onClick: () =>
|
|
518
|
+
onClick: () => F.weather ? B() : V(W("farm")),
|
|
461
519
|
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",
|
|
462
|
-
children:
|
|
520
|
+
children: F.weather ? U("healthybowl.home.weatherCard.error.retry", "Try again") : U("healthybowl.home.weatherCard.empty.action", "Set farm location")
|
|
463
521
|
})
|
|
464
522
|
}),
|
|
465
|
-
|
|
523
|
+
q.forecast.length > 0 && /* @__PURE__ */ E("div", {
|
|
466
524
|
className: "grid grid-cols-4 gap-2 border-t border-border-subtle pt-3",
|
|
467
|
-
children:
|
|
525
|
+
children: q.forecast.slice(0, 4).map((e) => /* @__PURE__ */ D("div", {
|
|
468
526
|
className: "rounded-md bg-bg-sunken/50 p-2 text-center",
|
|
469
527
|
children: [
|
|
470
|
-
/* @__PURE__ */
|
|
528
|
+
/* @__PURE__ */ E("p", {
|
|
471
529
|
className: "text-xs font-medium text-text-secondary",
|
|
472
530
|
children: new Date(e.date).toLocaleDateString("en-US", { weekday: "short" })
|
|
473
531
|
}),
|
|
474
|
-
/* @__PURE__ */
|
|
532
|
+
/* @__PURE__ */ D("p", {
|
|
475
533
|
className: "mt-1 text-sm font-semibold text-text-primary",
|
|
476
534
|
children: [e.high, "°"]
|
|
477
535
|
}),
|
|
478
|
-
/* @__PURE__ */
|
|
536
|
+
/* @__PURE__ */ D("p", {
|
|
479
537
|
className: "text-xs text-text-secondary",
|
|
480
538
|
children: [e.low, "°"]
|
|
481
539
|
}),
|
|
482
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ D("p", {
|
|
483
541
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
484
542
|
children: [e.precipitation, "%"]
|
|
485
543
|
})
|
|
486
544
|
]
|
|
487
545
|
}, e.date))
|
|
488
546
|
}),
|
|
489
|
-
/* @__PURE__ */
|
|
547
|
+
/* @__PURE__ */ E("button", {
|
|
490
548
|
type: "button",
|
|
491
|
-
onClick: () =>
|
|
549
|
+
onClick: () => V(W("weather")),
|
|
492
550
|
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",
|
|
493
|
-
children:
|
|
551
|
+
children: U("healthybowl.home.weatherCard.viewForecast", "View full forecast")
|
|
494
552
|
})
|
|
495
553
|
]
|
|
496
554
|
})]
|
|
497
555
|
})]
|
|
498
556
|
}),
|
|
499
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ D("section", { children: [/* @__PURE__ */ E("h3", {
|
|
500
558
|
className: "mb-2 text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
501
|
-
children:
|
|
502
|
-
}), /* @__PURE__ */
|
|
559
|
+
children: U("healthybowl.home.glance.title", "At a glance")
|
|
560
|
+
}), /* @__PURE__ */ D("div", {
|
|
503
561
|
className: "grid grid-cols-2 gap-3 sm:grid-cols-4",
|
|
504
562
|
children: [
|
|
505
|
-
/* @__PURE__ */
|
|
506
|
-
label:
|
|
507
|
-
value: String(
|
|
508
|
-
hint:
|
|
509
|
-
icon: /* @__PURE__ */
|
|
510
|
-
onClick: () =>
|
|
563
|
+
/* @__PURE__ */ E(L, {
|
|
564
|
+
label: U("healthybowl.home.glance.fields", "Fields"),
|
|
565
|
+
value: String(K.totalFields),
|
|
566
|
+
hint: K.totalFields > 0 ? U("healthybowl.home.glance.fieldsHint", "Monitored") : U("healthybowl.home.glance.fieldsEmpty", "No fields yet"),
|
|
567
|
+
icon: /* @__PURE__ */ E(y, {}),
|
|
568
|
+
onClick: () => V(W("crops/fields"))
|
|
511
569
|
}),
|
|
512
|
-
/* @__PURE__ */
|
|
513
|
-
label:
|
|
514
|
-
value: String(
|
|
515
|
-
hint:
|
|
516
|
-
icon: /* @__PURE__ */
|
|
517
|
-
onClick: () =>
|
|
570
|
+
/* @__PURE__ */ E(L, {
|
|
571
|
+
label: U("healthybowl.home.glance.livestock", "Livestock"),
|
|
572
|
+
value: String(K.totalAnimals),
|
|
573
|
+
hint: K.totalAnimals > 0 ? U("healthybowl.home.glance.livestockHint", "Under management") : U("healthybowl.home.glance.livestockEmpty", "No livestock added"),
|
|
574
|
+
icon: /* @__PURE__ */ E(b, {}),
|
|
575
|
+
onClick: () => V(W("livestock"))
|
|
518
576
|
}),
|
|
519
|
-
/* @__PURE__ */
|
|
520
|
-
label:
|
|
521
|
-
value:
|
|
522
|
-
hint:
|
|
523
|
-
icon: /* @__PURE__ */
|
|
524
|
-
onClick: () =>
|
|
577
|
+
/* @__PURE__ */ E(L, {
|
|
578
|
+
label: U("healthybowl.home.glance.organic", "Organic score"),
|
|
579
|
+
value: K.organicScore > 0 ? `${K.organicScore}%` : U("healthybowl.home.glance.organicEmpty", "Not configured"),
|
|
580
|
+
hint: K.organicScore > 0 ? U("healthybowl.home.glance.organicHint", "Compliance") : void 0,
|
|
581
|
+
icon: /* @__PURE__ */ E(S, {}),
|
|
582
|
+
onClick: () => V(W("compliance"))
|
|
525
583
|
}),
|
|
526
|
-
/* @__PURE__ */
|
|
527
|
-
label:
|
|
528
|
-
value: t(
|
|
529
|
-
hint: Q == null ?
|
|
530
|
-
icon: /* @__PURE__ */
|
|
531
|
-
onClick: () =>
|
|
584
|
+
/* @__PURE__ */ E(L, {
|
|
585
|
+
label: U("healthybowl.home.glance.expenses", "Expenses"),
|
|
586
|
+
value: t(K.totalExpenses, "INR"),
|
|
587
|
+
hint: Q == null ? U("healthybowl.home.glance.noRevenue", "No revenue yet") : U("healthybowl.home.glance.expensesRatio", "{{pct}}% of revenue", { pct: Q }),
|
|
588
|
+
icon: /* @__PURE__ */ E(T, {}),
|
|
589
|
+
onClick: () => V(W("financial"))
|
|
532
590
|
})
|
|
533
591
|
]
|
|
534
592
|
})] })
|
|
535
593
|
]
|
|
536
|
-
})
|
|
594
|
+
})]
|
|
537
595
|
});
|
|
538
596
|
};
|
|
539
597
|
//#endregion
|
|
540
|
-
export {
|
|
598
|
+
export { B as HomePage };
|
|
541
599
|
|
|
542
600
|
//# sourceMappingURL=HomePage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HomePage.js","names":[],"sources":["../../../src/healthybowl/pages/HomePage.tsx"],"sourcesContent":["import { useMemo, useCallback, type FC, type ReactNode } from 'react';\nimport { useNavigate } from 'react-router';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n Sprout,\n CalendarClock,\n Wallet,\n AlertTriangle,\n Plus,\n ClipboardList,\n BarChart3,\n MapPin,\n Thermometer,\n ArrowUpRight,\n ChevronRight,\n CheckCircle2,\n Cloud,\n CloudOff,\n Droplets,\n Wind,\n Eye,\n PawPrint,\n ShieldCheck,\n} from 'lucide-react';\nimport { EmphasisPanel, GlassCard } from '@burdenoff/fe-libs/ui';\nimport { PageLayout, StatusBadge, EmptyState, ErrorState, PageLoader } from '../components';\nimport { useHealthyBowlData } from '../hooks/useHealthyBowlData';\nimport { useBasePath } from '../hooks/useBasePath';\nimport { cn, formatCurrency, HB_DEFAULT_CURRENCY, formatDateOnly } from '../utils/helpers';\nimport { hasWeatherObservation } from '../utils/weatherPresence';\nimport type { Alert, Crop } from '../types';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Semantic maps — colour carries meaning, always paired with a label. Tokens only.\n// ─────────────────────────────────────────────────────────────────────────────\n\ntype Tone = 'neutral' | 'success' | 'warning' | 'danger';\n\nconst toneValueClass: Record<Tone, string> = {\n neutral: 'text-text-primary',\n success: 'text-status-success-text',\n warning: 'text-status-warning-text',\n danger: 'text-status-error-text',\n};\n\nconst toneChipClass: Record<Tone, string> = {\n neutral: 'bg-[var(--color-accent-soft)] text-text-primary',\n success: 'bg-status-success-bg text-status-success-text',\n warning: 'bg-status-warning-bg text-status-warning-text',\n danger: 'bg-status-error-bg text-status-error-text',\n};\n\nconst severityRank: Record<Alert['severity'], number> = { critical: 0, warning: 1, info: 2 };\n\nconst severityDotClass: Record<Alert['severity'], string> = {\n critical: 'bg-status-error-text',\n warning: 'bg-status-warning-text',\n info: 'bg-status-info-text',\n};\n\nconst healthVariant = (status: string) => {\n switch (status) {\n case 'excellent':\n return 'success' as const;\n case 'good':\n return 'info' as const;\n case 'fair':\n return 'warning' as const;\n default:\n return 'error' as const;\n }\n};\n\nconst clampPercent = (n: number) => Math.max(0, Math.min(100, Math.round(n)));\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Presentational sub-components (module-level so they don't remount each render)\n// ─────────────────────────────────────────────────────────────────────────────\n\ninterface KpiTileProps {\n label: string;\n value: string;\n icon: ReactNode;\n tone?: Tone;\n /** Featured accent glow — reserve for the single focal KPI (needs-attention). */\n glow?: boolean;\n drillLabel: string;\n onClick: () => void;\n}\n\n/** Primary KPI card — big real value + tone-coded chip + drill-down. No fabricated trend/sparkline. */\nconst KpiTile: FC<KpiTileProps> = ({ label, value, icon, tone = 'neutral', glow = false, drillLabel, onClick }) => (\n <button type=\"button\" onClick={onClick} className=\"group block text-start focus-visible:outline-none\">\n <GlassCard\n treatment=\"metric\"\n glow={glow}\n className=\"flex h-full flex-col gap-3 border-border-seam p-4 transition-shadow group-hover:shadow-pop group-focus-visible:ring-2 group-focus-visible:ring-border-focus group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-bg-canvas\"\n >\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm font-medium text-text-secondary\">{label}</span>\n <span className={cn('flex size-8 items-center justify-center rounded-lg [&>svg]:size-4', toneChipClass[tone])}>\n {icon}\n </span>\n </div>\n <span className={cn('text-3xl font-semibold tabular-nums', toneValueClass[tone])}>{value}</span>\n <span className=\"mt-auto inline-flex items-center gap-1 text-xs font-medium text-text-secondary transition-colors group-hover:text-text-primary\">\n {drillLabel}\n <ArrowUpRight className=\"size-3.5\" />\n </span>\n </GlassCard>\n </button>\n);\n\ninterface MiniStatProps {\n label: string;\n value: string;\n hint?: string;\n icon: ReactNode;\n onClick: () => void;\n}\n\n/** Secondary \"at a glance\" tile — quieter than a KPI, honest zero-state hints. */\nconst MiniStat: FC<MiniStatProps> = ({ label, value, hint, icon, onClick }) => (\n <button type=\"button\" onClick={onClick} className=\"group block text-start focus-visible:outline-none\">\n <GlassCard className=\"flex h-full items-center justify-between gap-3 border-border-seam p-3 transition-shadow group-hover:shadow-pop group-focus-visible:ring-2 group-focus-visible:ring-border-focus group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-bg-canvas\">\n <div className=\"min-w-0\">\n <p className=\"text-xs font-medium text-text-secondary\">{label}</p>\n <p className=\"mt-0.5 truncate text-lg font-semibold tabular-nums text-text-primary\">{value}</p>\n {hint && <p className=\"mt-0.5 truncate text-xs text-text-secondary\">{hint}</p>}\n </div>\n <span className=\"flex size-8 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-secondary [&>svg]:size-4\">\n {icon}\n </span>\n </GlassCard>\n </button>\n);\n\ninterface AlertRowProps {\n alert: Alert;\n ctaLabel: string;\n relTime: string;\n onOpen: () => void;\n}\n\n/** One needs-attention row: severity dot + title + message + relative time + CTA. */\nconst AlertRow: FC<AlertRowProps> = ({ alert, ctaLabel, relTime, onOpen }) => (\n <li className=\"flex items-start gap-3 py-3\">\n <span className={cn('mt-1.5 size-2.5 shrink-0 rounded-full', severityDotClass[alert.severity])} aria-hidden />\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-baseline justify-between gap-3\">\n <p className=\"truncate text-sm font-medium text-text-primary\">{alert.title}</p>\n <button\n type=\"button\"\n onClick={onOpen}\n className=\"shrink-0 text-xs font-medium text-action-primary-bg transition-colors hover:underline focus-visible:underline focus-visible:outline-none\"\n >\n {ctaLabel}\n </button>\n </div>\n <p className=\"mt-0.5 truncate text-xs text-text-secondary\">{alert.message}</p>\n <p className=\"mt-0.5 text-xs text-text-muted\">{relTime}</p>\n </div>\n </li>\n);\n\ninterface CropRowProps {\n crop: Crop;\n metaLabel: string;\n healthLabel: string;\n harvestLabel: string;\n openLabel: string;\n onOpen: () => void;\n}\n\n/** Rich crop row — name, field · stage, health, progress bar, expected harvest, open. */\nconst CropRow: FC<CropRowProps> = ({ crop, metaLabel, healthLabel, harvestLabel, openLabel, onOpen }) => (\n <li>\n <button\n type=\"button\"\n onClick={onOpen}\n className=\"group block w-full rounded-lg p-3 text-start transition-colors hover:bg-bg-sunken/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus\"\n >\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"min-w-0\">\n <p className=\"truncate text-sm font-medium text-text-primary\">{crop.name}</p>\n <p className=\"truncate text-xs text-text-secondary\">{metaLabel}</p>\n </div>\n <StatusBadge label={healthLabel} variant={healthVariant(crop.healthStatus)} dot />\n </div>\n <div className=\"mt-2 flex items-center gap-3\">\n <div className=\"h-1.5 flex-1 overflow-hidden rounded-full bg-bg-sunken\">\n <div\n className=\"h-full rounded-full bg-action-primary-bg\"\n style={{ width: `${clampPercent(crop.progress)}%` }}\n />\n </div>\n <span className=\"w-9 shrink-0 text-end text-xs font-medium tabular-nums text-text-secondary\">\n {clampPercent(crop.progress)}%\n </span>\n </div>\n <div className=\"mt-1.5 flex items-center justify-between text-xs text-text-secondary\">\n <span className=\"truncate\">{harvestLabel}</span>\n <span className=\"inline-flex shrink-0 items-center gap-0.5 font-medium transition-colors group-hover:text-text-primary\">\n {openLabel}\n <ChevronRight className=\"size-3.5\" />\n </span>\n </div>\n </button>\n </li>\n);\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Dashboard\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const HomePage: FC = () => {\n const { dashboardStats, alerts, crops, weatherData, markAlertRead, farm, loadings, errors, refetch } =\n useHealthyBowlData();\n\n const navigate = useNavigate();\n const { t: translate } = useI18n();\n // Local wrapper preserves the (key, fallback) call style used across HB pages\n // while forwarding interpolation params to the shared i18n `t` (for {{count}} etc.).\n const t = useCallback(\n (key: string, fallback: string, params?: Record<string, string | number>): string =>\n translate(key, fallback, params),\n [translate]\n );\n const { buildPath } = useBasePath();\n const stats = dashboardStats;\n\n const weather = {\n location: weatherData?.location ?? '',\n current: weatherData?.current,\n forecast: weatherData?.forecast ?? [],\n };\n // The data hook substitutes an all-zero EMPTY_WEATHER when there is nothing to\n // show, so presence has to come from a named condition — never from the\n // numbers, because 0 °C / 0 km/h / UV 0 is a real (and frost-relevant) reading.\n const hasWeather = hasWeatherObservation(weather.current);\n\n // Today's date, localised — \"Friday, 25 July\" style.\n const todayLabel = useMemo(\n () => new Date().toLocaleDateString(undefined, { weekday: 'long', day: 'numeric', month: 'long' }),\n []\n );\n\n // Alerts sorted by severity (critical → warning → info); capped for the panel.\n const sortedAlerts = useMemo(\n () => [...alerts].sort((a, b) => severityRank[a.severity] - severityRank[b.severity]),\n [alerts]\n );\n const visibleAlerts = sortedAlerts.slice(0, 5);\n const attentionCount = alerts.length;\n\n // Crops ordered by nearest harvest first; capped so the anchor stays scannable.\n const sortedCrops = useMemo(\n () =>\n [...crops].sort(\n (a, b) => (a.daysToHarvest ?? Number.MAX_SAFE_INTEGER) - (b.daysToHarvest ?? Number.MAX_SAFE_INTEGER)\n ),\n [crops]\n );\n const visibleCrops = sortedCrops.slice(0, 6);\n\n // Expenses as a share of revenue — honest ratio, null when there's no revenue to compare against.\n const expenseRatioPercent = useMemo(() => {\n if (stats.totalRevenue === 0) return null;\n return Math.round((stats.totalExpenses / stats.totalRevenue) * 100 * 10) / 10;\n }, [stats.totalExpenses, stats.totalRevenue]);\n\n // Compact relative-time (minutes/hours/days/weeks), i18n'd.\n const relTime = useCallback(\n (iso: string): string => {\n const then = new Date(iso).getTime();\n if (Number.isNaN(then)) return '';\n const diffMin = Math.max(0, Math.floor((Date.now() - then) / 60000));\n if (diffMin < 1) return t('healthybowl.home.time.now', 'just now');\n if (diffMin < 60) return t('healthybowl.home.time.minutes', '{{n}}m ago', { n: diffMin });\n const diffHr = Math.floor(diffMin / 60);\n if (diffHr < 24) return t('healthybowl.home.time.hours', '{{n}}h ago', { n: diffHr });\n const diffDay = Math.floor(diffHr / 24);\n if (diffDay < 7) return t('healthybowl.home.time.days', '{{n}}d ago', { n: diffDay });\n return t('healthybowl.home.time.weeks', '{{n}}w ago', { n: Math.floor(diffDay / 7) });\n },\n [t]\n );\n\n // Per-alert CTA label by severity — mirrors Review / Open / View in the design.\n const alertCta = useCallback(\n (severity: Alert['severity']): string => {\n if (severity === 'critical') return t('healthybowl.home.needsAttention.review', 'Review');\n if (severity === 'warning') return t('healthybowl.home.needsAttention.open', 'Open');\n return t('healthybowl.home.needsAttention.view', 'View');\n },\n [t]\n );\n\n const openAlert = useCallback(\n (alert: Alert) => {\n void markAlertRead(alert.id, true);\n if (alert.actionUrl) navigate(alert.actionUrl);\n },\n [markAlertRead, navigate]\n );\n\n // ── Real-field-backed KPI derivations ──\n const netProfitTone: Tone = stats.netProfit > 0 ? 'success' : stats.netProfit < 0 ? 'danger' : 'neutral';\n const hasCritical = alerts.some((a) => a.severity === 'critical');\n const hasWarning = alerts.some((a) => a.severity === 'warning');\n const attentionTone: Tone =\n attentionCount === 0 ? 'success' : hasCritical ? 'danger' : hasWarning ? 'warning' : 'neutral';\n\n const quickActions = [\n {\n label: t('healthybowl.home.quickActions.addCrop.label', 'Add crop'),\n icon: Sprout,\n path: buildPath('crops'),\n },\n {\n label: t('healthybowl.home.quickActions.recordHarvest.label', 'Record harvest'),\n icon: ClipboardList,\n path: buildPath('crops/harvest'),\n },\n {\n label: t('healthybowl.home.quickActions.viewFields.label', 'View fields'),\n icon: MapPin,\n path: buildPath('crops/fields'),\n },\n {\n label: t('healthybowl.home.quickActions.viewWeather.label', 'View weather'),\n icon: Thermometer,\n path: buildPath('weather'),\n },\n {\n label: t('healthybowl.home.quickActions.analytics.label', 'Analytics'),\n icon: BarChart3,\n path: buildPath('analytics'),\n },\n ];\n\n // Compact header subline: date · farm + a live needs-attention summary.\n const attentionSummary =\n attentionCount === 0\n ? t('healthybowl.home.header.allClear', \"You're all caught up\")\n : attentionCount === 1\n ? t('healthybowl.home.header.needsAttentionOne', '1 item needs your attention')\n : t('healthybowl.home.header.needsAttentionOther', '{{count}} items need your attention', {\n count: attentionCount,\n });\n\n // PageLayout's `description` is a plain string; the date + farm reads as the subline.\n const headerSubline = farm?.name ? `${todayLabel} · ${farm.name}` : todayLabel;\n\n const headerActions = (\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('crops'))}\n 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\"\n >\n <Plus className=\"h-4 w-4\" />\n {t('healthybowl.home.primaryAction', 'Add')}\n </button>\n );\n\n return (\n <PageLayout\n title={t('healthybowl.home.title', 'Farm Dashboard')}\n description={headerSubline}\n actions={headerActions}\n >\n {loadings.dashboard ? (\n <PageLoader />\n ) : errors.dashboard ? (\n <ErrorState onRetry={refetch} />\n ) : (\n <div className=\"space-y-6\">\n {/* Live needs-attention summary — reads directly under the compact header */}\n <div\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-sm font-medium',\n attentionCount === 0\n ? 'bg-status-success-bg text-status-success-text'\n : 'bg-status-warning-bg text-status-warning-text'\n )}\n >\n {attentionCount === 0 ? <CheckCircle2 className=\"size-4\" /> : <AlertTriangle className=\"size-4\" />}\n {attentionSummary}\n </div>\n\n {/* First-run onboarding — only once data has settled and there's no farm yet */}\n {!farm?.id && (\n <EmphasisPanel className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <p className=\"text-base font-semibold text-text-primary\">\n {t('healthybowl.home.onboarding.title', 'Welcome to HealthyBowl')}\n </p>\n <p className=\"text-sm text-text-secondary\">\n {t(\n 'healthybowl.home.onboarding.description',\n 'Set up your farm to start tracking crops, livestock, finances, and more.'\n )}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('getting-started'))}\n 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\"\n >\n <Plus className=\"h-4 w-4\" />\n {t('healthybowl.home.onboarding.action', 'Set up your farm')}\n </button>\n </EmphasisPanel>\n )}\n\n {/* Quick-action strip — compact row, existing wired targets */}\n <div className=\"flex flex-wrap gap-2\">\n {quickActions.map(({ label, icon: Icon, path }) => (\n <button\n key={label}\n type=\"button\"\n onClick={() => navigate(path)}\n 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\"\n >\n <Icon className=\"size-4\" />\n {label}\n </button>\n ))}\n </div>\n\n {/* Primary row — 4 real-field KPIs + needs-attention panel above the fold */}\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-3\">\n <div className=\"grid grid-cols-2 gap-4 lg:col-span-2\">\n <KpiTile\n label={t('healthybowl.home.kpi.activeCrops', 'Active crops')}\n value={String(stats.activeCrops)}\n icon={<Sprout />}\n drillLabel={t('healthybowl.home.kpi.viewCrops', 'View crops')}\n onClick={() => navigate(buildPath('crops'))}\n />\n <KpiTile\n label={t('healthybowl.home.kpi.harvestDue', 'Harvest due')}\n value={String(stats.harvestDue)}\n icon={<CalendarClock />}\n drillLabel={t('healthybowl.home.kpi.viewHarvest', 'View harvest')}\n onClick={() => navigate(buildPath('crops/harvest'))}\n />\n <KpiTile\n label={t('healthybowl.home.kpi.netProfit', 'Net profit')}\n value={formatCurrency(stats.netProfit, HB_DEFAULT_CURRENCY)}\n icon={<Wallet />}\n tone={netProfitTone}\n drillLabel={t('healthybowl.home.kpi.viewFinance', 'View finances')}\n onClick={() => navigate(buildPath('financial'))}\n />\n <KpiTile\n label={t('healthybowl.home.kpi.needsAttention', 'Needs attention')}\n value={String(attentionCount)}\n icon={<AlertTriangle />}\n tone={attentionTone}\n glow={attentionTone === 'danger' || attentionTone === 'warning'}\n drillLabel={t('healthybowl.home.kpi.viewAlerts', 'View alerts')}\n onClick={() => navigate(buildPath('weather/alerts'))}\n />\n </div>\n\n {/* Needs attention */}\n <GlassCard className=\"flex h-full flex-col border-border-seam p-0\">\n <div className=\"flex items-center justify-between px-4 pb-1 pt-4\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.home.needsAttention.title', 'Needs attention')}\n </h3>\n {sortedAlerts.length > 0 && (\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('weather/alerts'))}\n className=\"text-xs font-medium text-text-secondary transition-colors hover:text-text-primary focus-visible:text-text-primary focus-visible:outline-none\"\n >\n {t('healthybowl.home.needsAttention.viewAll', 'View all')}\n </button>\n )}\n </div>\n <div className=\"flex-1 px-4 pb-4\">\n {sortedAlerts.length === 0 ? (\n <EmptyState\n icon={<CheckCircle2 className=\"h-8 w-8 text-status-success-text\" />}\n title={t('healthybowl.home.needsAttention.empty.title', \"You're all caught up\")}\n description={t(\n 'healthybowl.home.needsAttention.empty.description',\n 'No urgent farm alerts right now.'\n )}\n action={\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('weather/alert-rules'))}\n 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\"\n >\n {t('healthybowl.home.needsAttention.empty.action', 'Manage alert rules')}\n </button>\n }\n />\n ) : (\n <ul className=\"divide-y divide-border-subtle\">\n {visibleAlerts.map((alert) => (\n <AlertRow\n key={alert.id}\n alert={alert}\n ctaLabel={alertCta(alert.severity)}\n relTime={relTime(alert.timestamp)}\n onOpen={() => openAlert(alert)}\n />\n ))}\n </ul>\n )}\n </div>\n </GlassCard>\n </div>\n\n {/* Anchor row — crop overview (strongest) + compact weather */}\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-3\">\n {/* Crop overview — the farm-specific anchor */}\n <GlassCard glow className=\"flex h-full flex-col border-border-seam p-0 lg:col-span-2\">\n <div className=\"flex items-center justify-between px-5 pb-2 pt-5\">\n <div className=\"flex items-center gap-2\">\n <span className=\"flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-primary [&>svg]:size-4\">\n <Sprout />\n </span>\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">\n {t('healthybowl.home.cropsAnchor.title', 'Crop overview')}\n </h2>\n <p className=\"text-xs text-text-secondary\">\n {crops.length === 1\n ? t('healthybowl.home.cropsAnchor.subtitleOne', '1 crop in progress')\n : t('healthybowl.home.cropsAnchor.subtitleOther', '{{count}} crops in progress', {\n count: crops.length,\n })}\n </p>\n </div>\n </div>\n {crops.length > 0 && (\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('crops'))}\n className=\"text-xs font-medium text-text-secondary transition-colors hover:text-text-primary focus-visible:text-text-primary focus-visible:outline-none\"\n >\n {t('healthybowl.home.cropsAnchor.viewAll', 'View all crops')}\n </button>\n )}\n </div>\n <div className=\"flex-1 px-3 pb-3\">\n {crops.length === 0 ? (\n <EmptyState\n icon={<Sprout className=\"h-8 w-8 text-primary\" />}\n title={t('healthybowl.home.cropsAnchor.empty.title', 'No active crops')}\n description={t(\n 'healthybowl.home.cropsAnchor.empty.description',\n 'Register your first crop to track growth, health and harvest here.'\n )}\n action={\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('crops'))}\n 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\"\n >\n <Plus className=\"h-4 w-4\" />\n {t('healthybowl.home.quickActions.addCrop.label', 'Add crop')}\n </button>\n }\n />\n ) : (\n <ul className=\"divide-y divide-border-subtle\">\n {visibleCrops.map((crop) => {\n const stage = (crop.growthStage || crop.status || '').replace(/_/g, ' ').trim();\n const metaLabel = [crop.fieldName, stage].filter(Boolean).join(' · ');\n return (\n <CropRow\n key={crop.id}\n crop={crop}\n metaLabel={metaLabel || t('healthybowl.home.cropsAnchor.noField', 'Unassigned')}\n healthLabel={(crop.healthStatus || 'unknown').replace(/_/g, ' ')}\n harvestLabel={\n crop.expectedHarvestDate\n ? t('healthybowl.home.cropsAnchor.harvest', 'Harvest {{date}}', {\n date: formatDateOnly(crop.expectedHarvestDate),\n })\n : t('healthybowl.home.cropsAnchor.harvestUnknown', 'Harvest date TBD')\n }\n openLabel={t('healthybowl.home.cropsAnchor.open', 'Open')}\n onOpen={() => navigate(buildPath(`crops/${crop.id}`))}\n />\n );\n })}\n </ul>\n )}\n </div>\n </GlassCard>\n\n {/* Weather — secondary */}\n <GlassCard className=\"flex h-full flex-col border-border-seam p-0\">\n <div className=\"px-4 pb-1 pt-4\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.home.weatherCard.title', 'Current weather')}\n </h3>\n {weather.location && <p className=\"text-xs text-text-secondary\">{weather.location}</p>}\n </div>\n <div className=\"flex flex-1 flex-col gap-4 px-4 pb-4\">\n {!hasWeather ? (\n // No observation. Say so, rather than printing 0 °C / 0% / 0 hPa\n // — fabricated readings are worse than none on a farm dashboard.\n <EmptyState\n icon={<CloudOff className=\"h-8 w-8 text-text-muted\" />}\n title={\n errors.weather\n ? t('healthybowl.home.weatherCard.error.title', 'Weather unavailable')\n : t('healthybowl.home.weatherCard.empty.title', 'No weather yet')\n }\n description={\n errors.weather\n ? t(\n 'healthybowl.home.weatherCard.error.description',\n \"We couldn't load conditions for your farm just now.\"\n )\n : t(\n 'healthybowl.home.weatherCard.empty.description',\n 'Set your farm location to see local conditions here.'\n )\n }\n action={\n <button\n type=\"button\"\n onClick={() => (errors.weather ? refetch() : navigate(buildPath('farm')))}\n 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\"\n >\n {errors.weather\n ? t('healthybowl.home.weatherCard.error.retry', 'Try again')\n : t('healthybowl.home.weatherCard.empty.action', 'Set farm location')}\n </button>\n }\n />\n ) : (\n <>\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-4xl font-bold text-text-primary\">{weather.current.temperature}°C</p>\n <p className=\"text-sm text-text-secondary\">{weather.current.condition}</p>\n <p className=\"mt-1 text-xs text-text-secondary\">\n {t('healthybowl.home.weatherCard.feelsLike', 'Feels like')} {weather.current.feelsLike}°C\n </p>\n </div>\n <div className=\"flex flex-col items-center\">\n <Cloud className=\"h-12 w-12 text-text-secondary\" />\n <span className=\"mt-1 text-xs text-text-secondary\">UV {weather.current.uvIndex}</span>\n </div>\n </div>\n\n <div className=\"grid grid-cols-2 gap-3 border-t border-border-subtle pt-3\">\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Droplets className=\"h-4 w-4\" />\n <span>\n {weather.current.humidity}% {t('healthybowl.home.weatherCard.humidity', 'Humidity')}\n </span>\n </div>\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Wind className=\"h-4 w-4\" />\n <span>{weather.current.windSpeed} km/h</span>\n </div>\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Thermometer className=\"h-4 w-4\" />\n <span>{weather.current.pressure} hPa</span>\n </div>\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Eye className=\"h-4 w-4\" />\n <span>{weather.current.visibility} km</span>\n </div>\n </div>\n </>\n )}\n\n {weather.forecast.length > 0 && (\n <div className=\"grid grid-cols-4 gap-2 border-t border-border-subtle pt-3\">\n {weather.forecast.slice(0, 4).map((day) => (\n <div key={day.date} className=\"rounded-md bg-bg-sunken/50 p-2 text-center\">\n <p className=\"text-xs font-medium text-text-secondary\">\n {new Date(day.date).toLocaleDateString('en-US', { weekday: 'short' })}\n </p>\n <p className=\"mt-1 text-sm font-semibold text-text-primary\">{day.high}°</p>\n <p className=\"text-xs text-text-secondary\">{day.low}°</p>\n <p className=\"mt-0.5 text-xs text-text-secondary\">{day.precipitation}%</p>\n </div>\n ))}\n </div>\n )}\n\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('weather'))}\n 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\"\n >\n {t('healthybowl.home.weatherCard.viewForecast', 'View full forecast')}\n </button>\n </div>\n </GlassCard>\n </div>\n\n {/* At a glance — demoted secondary metrics with honest zero-states */}\n <section>\n <h3 className=\"mb-2 text-xs font-medium uppercase tracking-wide text-text-secondary\">\n {t('healthybowl.home.glance.title', 'At a glance')}\n </h3>\n <div className=\"grid grid-cols-2 gap-3 sm:grid-cols-4\">\n <MiniStat\n label={t('healthybowl.home.glance.fields', 'Fields')}\n value={String(stats.totalFields)}\n hint={\n stats.totalFields > 0\n ? t('healthybowl.home.glance.fieldsHint', 'Monitored')\n : t('healthybowl.home.glance.fieldsEmpty', 'No fields yet')\n }\n icon={<MapPin />}\n onClick={() => navigate(buildPath('crops/fields'))}\n />\n <MiniStat\n label={t('healthybowl.home.glance.livestock', 'Livestock')}\n value={String(stats.totalAnimals)}\n hint={\n stats.totalAnimals > 0\n ? t('healthybowl.home.glance.livestockHint', 'Under management')\n : t('healthybowl.home.glance.livestockEmpty', 'No livestock added')\n }\n icon={<PawPrint />}\n onClick={() => navigate(buildPath('livestock'))}\n />\n <MiniStat\n label={t('healthybowl.home.glance.organic', 'Organic score')}\n value={\n stats.organicScore > 0\n ? `${stats.organicScore}%`\n : t('healthybowl.home.glance.organicEmpty', 'Not configured')\n }\n hint={stats.organicScore > 0 ? t('healthybowl.home.glance.organicHint', 'Compliance') : undefined}\n icon={<ShieldCheck />}\n onClick={() => navigate(buildPath('compliance'))}\n />\n <MiniStat\n label={t('healthybowl.home.glance.expenses', 'Expenses')}\n value={formatCurrency(stats.totalExpenses, HB_DEFAULT_CURRENCY)}\n hint={\n expenseRatioPercent != null\n ? t('healthybowl.home.glance.expensesRatio', '{{pct}}% of revenue', { pct: expenseRatioPercent })\n : t('healthybowl.home.glance.noRevenue', 'No revenue yet')\n }\n icon={<Wallet />}\n onClick={() => navigate(buildPath('financial'))}\n />\n </div>\n </section>\n </div>\n )}\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAsCA,IAAM,IAAuC;CAC3C,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;CACT,EAEK,IAAsC;CAC1C,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;CACT,EAEK,IAAkD;CAAE,UAAU;CAAG,SAAS;CAAG,MAAM;CAAG,EAEtF,IAAsD;CAC1D,UAAU;CACV,SAAS;CACT,MAAM;CACP,EAEK,KAAiB,MAAmB;AACxC,SAAQ,GAAR;EACE,KAAK,YACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,QACE,QAAO;;GAIP,KAAgB,MAAc,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC,CAAC,EAkBvE,KAA6B,EAAE,UAAO,UAAO,SAAM,UAAO,WAAW,UAAO,IAAO,eAAY,iBACnG,kBAAC,UAAD;CAAQ,MAAK;CAAkB;CAAS,WAAU;WAChD,kBAAC,GAAD;EACE,WAAU;EACJ;EACN,WAAU;YAHZ;GAKE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,QAAD;KAAM,WAAU;eAA2C;KAAa,CAAA,EACxE,kBA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AO,OAAO,EAAM,aAAa;OACjC,MACE,EAAM,eAAe,IACjB,EAAE,yCAAyC,mBAAmB,GAC9D,EAAE,0CAA0C,qBAAqB;OAEvE,MAAM,kBAAC,GAAD,EAAY,CAAA;OAClB,eAAe,EAAS,EAAU,YAAY,CAAC;OAC/C,CAAA;MACF,kBAAC,GAAD;OACE,OAAO,EAAE,mCAAmC,gBAAgB;OAC5D,OACE,EAAM,eAAe,IACjB,GAAG,EAAM,aAAa,KACtB,EAAE,wCAAwC,iBAAiB;OAEjE,MAAM,EAAM,eAAe,IAAI,EAAE,uCAAuC,aAAa,GAAG,KAAA;OACxF,MAAM,kBAAC,GAAD,EAAe,CAAA;OACrB,eAAe,EAAS,EAAU,aAAa,CAAC;OAChD,CAAA;MACF,kBAAC,GAAD;OACE,OAAO,EAAE,oCAAoC,WAAW;OACxD,OAAO,EAAe,EAAM,eAAA,MAAmC;OAC/D,MACE,KAAuB,OAEnB,EAAE,qCAAqC,iBAAiB,GADxD,EAAE,yCAAyC,uBAAuB,EAAE,KAAK,GAAqB,CAAC;OAGrG,MAAM,kBAAC,GAAD,EAAU,CAAA;OAChB,eAAe,EAAS,EAAU,YAAY,CAAC;OAC/C,CAAA;MACE;OACE,EAAA,CAAA;IACN;;EAEG,CAAA"}
|
|
1
|
+
{"version":3,"file":"HomePage.js","names":[],"sources":["../../../src/healthybowl/pages/HomePage.tsx"],"sourcesContent":["import { useMemo, useCallback, type FC, type ReactNode } from 'react';\nimport { useNavigate } from 'react-router';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n Sprout,\n CalendarClock,\n Wallet,\n AlertTriangle,\n Plus,\n ClipboardList,\n BarChart3,\n MapPin,\n Thermometer,\n ArrowUpRight,\n ChevronRight,\n CheckCircle2,\n Cloud,\n CloudOff,\n Droplets,\n Wind,\n Eye,\n PawPrint,\n ShieldCheck,\n} from 'lucide-react';\nimport { EmphasisPanel, GlassCard } from '@burdenoff/fe-libs/ui';\nimport { PageLayout, StatusBadge, EmptyState, ErrorState, PageLoader } from '../components';\nimport { useHealthyBowlData } from '../hooks/useHealthyBowlData';\nimport { useHealthyBowlQuota } from '../hooks/useHealthyBowlQuota';\nimport { useBasePath } from '../hooks/useBasePath';\nimport { cn, formatCurrency, HB_DEFAULT_CURRENCY, formatDateOnly } from '../utils/helpers';\nimport { hasWeatherObservation } from '../utils/weatherPresence';\nimport type { Alert, Crop } from '../types';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Semantic maps — colour carries meaning, always paired with a label. Tokens only.\n// ─────────────────────────────────────────────────────────────────────────────\n\ntype Tone = 'neutral' | 'success' | 'warning' | 'danger';\n\nconst toneValueClass: Record<Tone, string> = {\n neutral: 'text-text-primary',\n success: 'text-status-success-text',\n warning: 'text-status-warning-text',\n danger: 'text-status-error-text',\n};\n\nconst toneChipClass: Record<Tone, string> = {\n neutral: 'bg-[var(--color-accent-soft)] text-text-primary',\n success: 'bg-status-success-bg text-status-success-text',\n warning: 'bg-status-warning-bg text-status-warning-text',\n danger: 'bg-status-error-bg text-status-error-text',\n};\n\nconst severityRank: Record<Alert['severity'], number> = { critical: 0, warning: 1, info: 2 };\n\nconst severityDotClass: Record<Alert['severity'], string> = {\n critical: 'bg-status-error-text',\n warning: 'bg-status-warning-text',\n info: 'bg-status-info-text',\n};\n\nconst healthVariant = (status: string) => {\n switch (status) {\n case 'excellent':\n return 'success' as const;\n case 'good':\n return 'info' as const;\n case 'fair':\n return 'warning' as const;\n default:\n return 'error' as const;\n }\n};\n\nconst clampPercent = (n: number) => Math.max(0, Math.min(100, Math.round(n)));\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Presentational sub-components (module-level so they don't remount each render)\n// ─────────────────────────────────────────────────────────────────────────────\n\ninterface KpiTileProps {\n label: string;\n value: string;\n icon: ReactNode;\n tone?: Tone;\n /** Featured accent glow — reserve for the single focal KPI (needs-attention). */\n glow?: boolean;\n drillLabel: string;\n onClick: () => void;\n}\n\n/** Primary KPI card — big real value + tone-coded chip + drill-down. No fabricated trend/sparkline. */\nconst KpiTile: FC<KpiTileProps> = ({ label, value, icon, tone = 'neutral', glow = false, drillLabel, onClick }) => (\n <button type=\"button\" onClick={onClick} className=\"group block text-start focus-visible:outline-none\">\n <GlassCard\n treatment=\"metric\"\n glow={glow}\n className=\"flex h-full flex-col gap-3 border-border-seam p-4 transition-shadow group-hover:shadow-pop group-focus-visible:ring-2 group-focus-visible:ring-border-focus group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-bg-canvas\"\n >\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm font-medium text-text-secondary\">{label}</span>\n <span className={cn('flex size-8 items-center justify-center rounded-lg [&>svg]:size-4', toneChipClass[tone])}>\n {icon}\n </span>\n </div>\n <span className={cn('text-3xl font-semibold tabular-nums', toneValueClass[tone])}>{value}</span>\n <span className=\"mt-auto inline-flex items-center gap-1 text-xs font-medium text-text-secondary transition-colors group-hover:text-text-primary\">\n {drillLabel}\n <ArrowUpRight className=\"size-3.5\" />\n </span>\n </GlassCard>\n </button>\n);\n\ninterface MiniStatProps {\n label: string;\n value: string;\n hint?: string;\n icon: ReactNode;\n onClick: () => void;\n}\n\n/** Secondary \"at a glance\" tile — quieter than a KPI, honest zero-state hints. */\nconst MiniStat: FC<MiniStatProps> = ({ label, value, hint, icon, onClick }) => (\n <button type=\"button\" onClick={onClick} className=\"group block text-start focus-visible:outline-none\">\n <GlassCard className=\"flex h-full items-center justify-between gap-3 border-border-seam p-3 transition-shadow group-hover:shadow-pop group-focus-visible:ring-2 group-focus-visible:ring-border-focus group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-bg-canvas\">\n <div className=\"min-w-0\">\n <p className=\"text-xs font-medium text-text-secondary\">{label}</p>\n <p className=\"mt-0.5 truncate text-lg font-semibold tabular-nums text-text-primary\">{value}</p>\n {hint && <p className=\"mt-0.5 truncate text-xs text-text-secondary\">{hint}</p>}\n </div>\n <span className=\"flex size-8 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-secondary [&>svg]:size-4\">\n {icon}\n </span>\n </GlassCard>\n </button>\n);\n\ninterface AlertRowProps {\n alert: Alert;\n ctaLabel: string;\n relTime: string;\n onOpen: () => void;\n}\n\n/** One needs-attention row: severity dot + title + message + relative time + CTA. */\nconst AlertRow: FC<AlertRowProps> = ({ alert, ctaLabel, relTime, onOpen }) => (\n <li className=\"flex items-start gap-3 py-3\">\n <span className={cn('mt-1.5 size-2.5 shrink-0 rounded-full', severityDotClass[alert.severity])} aria-hidden />\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-baseline justify-between gap-3\">\n <p className=\"truncate text-sm font-medium text-text-primary\">{alert.title}</p>\n <button\n type=\"button\"\n onClick={onOpen}\n className=\"shrink-0 text-xs font-medium text-action-primary-bg transition-colors hover:underline focus-visible:underline focus-visible:outline-none\"\n >\n {ctaLabel}\n </button>\n </div>\n <p className=\"mt-0.5 truncate text-xs text-text-secondary\">{alert.message}</p>\n <p className=\"mt-0.5 text-xs text-text-muted\">{relTime}</p>\n </div>\n </li>\n);\n\ninterface CropRowProps {\n crop: Crop;\n metaLabel: string;\n healthLabel: string;\n harvestLabel: string;\n openLabel: string;\n onOpen: () => void;\n}\n\n/** Rich crop row — name, field · stage, health, progress bar, expected harvest, open. */\nconst CropRow: FC<CropRowProps> = ({ crop, metaLabel, healthLabel, harvestLabel, openLabel, onOpen }) => (\n <li>\n <button\n type=\"button\"\n onClick={onOpen}\n className=\"group block w-full rounded-lg p-3 text-start transition-colors hover:bg-bg-sunken/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus\"\n >\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"min-w-0\">\n <p className=\"truncate text-sm font-medium text-text-primary\">{crop.name}</p>\n <p className=\"truncate text-xs text-text-secondary\">{metaLabel}</p>\n </div>\n <StatusBadge label={healthLabel} variant={healthVariant(crop.healthStatus)} dot />\n </div>\n <div className=\"mt-2 flex items-center gap-3\">\n <div className=\"h-1.5 flex-1 overflow-hidden rounded-full bg-bg-sunken\">\n <div\n className=\"h-full rounded-full bg-action-primary-bg\"\n style={{ width: `${clampPercent(crop.progress)}%` }}\n />\n </div>\n <span className=\"w-9 shrink-0 text-end text-xs font-medium tabular-nums text-text-secondary\">\n {clampPercent(crop.progress)}%\n </span>\n </div>\n <div className=\"mt-1.5 flex items-center justify-between text-xs text-text-secondary\">\n <span className=\"truncate\">{harvestLabel}</span>\n <span className=\"inline-flex shrink-0 items-center gap-0.5 font-medium transition-colors group-hover:text-text-primary\">\n {openLabel}\n <ChevronRight className=\"size-3.5\" />\n </span>\n </div>\n </button>\n </li>\n);\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Dashboard\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const HomePage: FC = () => {\n const { dashboardStats, alerts, crops, weatherData, markAlertRead, farm, loadings, errors, refetch } =\n useHealthyBowlData();\n\n const navigate = useNavigate();\n const { t: translate } = useI18n();\n // Local wrapper preserves the (key, fallback) call style used across HB pages\n // while forwarding interpolation params to the shared i18n `t` (for {{count}} etc.).\n const t = useCallback(\n (key: string, fallback: string, params?: Record<string, string | number>): string =>\n translate(key, fallback, params),\n [translate]\n );\n const { buildPath } = useBasePath();\n const { quotas, loading: quotasLoading } = useHealthyBowlQuota();\n const stats = dashboardStats;\n\n const weather = {\n location: weatherData?.location ?? '',\n current: weatherData?.current,\n forecast: weatherData?.forecast ?? [],\n };\n // The data hook substitutes an all-zero EMPTY_WEATHER when there is nothing to\n // show, so presence has to come from a named condition — never from the\n // numbers, because 0 °C / 0 km/h / UV 0 is a real (and frost-relevant) reading.\n const hasWeather = hasWeatherObservation(weather.current);\n\n // Today's date, localised — \"Friday, 25 July\" style.\n const todayLabel = useMemo(\n () => new Date().toLocaleDateString(undefined, { weekday: 'long', day: 'numeric', month: 'long' }),\n []\n );\n\n // Alerts sorted by severity (critical → warning → info); capped for the panel.\n const sortedAlerts = useMemo(\n () => [...alerts].sort((a, b) => severityRank[a.severity] - severityRank[b.severity]),\n [alerts]\n );\n const visibleAlerts = sortedAlerts.slice(0, 5);\n const attentionCount = alerts.length;\n\n // Crops ordered by nearest harvest first; capped so the anchor stays scannable.\n const sortedCrops = useMemo(\n () =>\n [...crops].sort(\n (a, b) => (a.daysToHarvest ?? Number.MAX_SAFE_INTEGER) - (b.daysToHarvest ?? Number.MAX_SAFE_INTEGER)\n ),\n [crops]\n );\n const visibleCrops = sortedCrops.slice(0, 6);\n\n // Expenses as a share of revenue — honest ratio, null when there's no revenue to compare against.\n const expenseRatioPercent = useMemo(() => {\n if (stats.totalRevenue === 0) return null;\n return Math.round((stats.totalExpenses / stats.totalRevenue) * 100 * 10) / 10;\n }, [stats.totalExpenses, stats.totalRevenue]);\n\n // Compact relative-time (minutes/hours/days/weeks), i18n'd.\n const relTime = useCallback(\n (iso: string): string => {\n const then = new Date(iso).getTime();\n if (Number.isNaN(then)) return '';\n const diffMin = Math.max(0, Math.floor((Date.now() - then) / 60000));\n if (diffMin < 1) return t('healthybowl.home.time.now', 'just now');\n if (diffMin < 60) return t('healthybowl.home.time.minutes', '{{n}}m ago', { n: diffMin });\n const diffHr = Math.floor(diffMin / 60);\n if (diffHr < 24) return t('healthybowl.home.time.hours', '{{n}}h ago', { n: diffHr });\n const diffDay = Math.floor(diffHr / 24);\n if (diffDay < 7) return t('healthybowl.home.time.days', '{{n}}d ago', { n: diffDay });\n return t('healthybowl.home.time.weeks', '{{n}}w ago', { n: Math.floor(diffDay / 7) });\n },\n [t]\n );\n\n // Per-alert CTA label by severity — mirrors Review / Open / View in the design.\n const alertCta = useCallback(\n (severity: Alert['severity']): string => {\n if (severity === 'critical') return t('healthybowl.home.needsAttention.review', 'Review');\n if (severity === 'warning') return t('healthybowl.home.needsAttention.open', 'Open');\n return t('healthybowl.home.needsAttention.view', 'View');\n },\n [t]\n );\n\n const openAlert = useCallback(\n (alert: Alert) => {\n void markAlertRead(alert.id, true);\n if (alert.actionUrl) navigate(alert.actionUrl);\n },\n [markAlertRead, navigate]\n );\n\n // ── Real-field-backed KPI derivations ──\n const netProfitTone: Tone = stats.netProfit > 0 ? 'success' : stats.netProfit < 0 ? 'danger' : 'neutral';\n const hasCritical = alerts.some((a) => a.severity === 'critical');\n const hasWarning = alerts.some((a) => a.severity === 'warning');\n const attentionTone: Tone =\n attentionCount === 0 ? 'success' : hasCritical ? 'danger' : hasWarning ? 'warning' : 'neutral';\n\n const quickActions = [\n {\n label: t('healthybowl.home.quickActions.addCrop.label', 'Add crop'),\n icon: Sprout,\n path: buildPath('crops'),\n },\n {\n label: t('healthybowl.home.quickActions.recordHarvest.label', 'Record harvest'),\n icon: ClipboardList,\n path: buildPath('crops/harvest'),\n },\n {\n label: t('healthybowl.home.quickActions.viewFields.label', 'View fields'),\n icon: MapPin,\n path: buildPath('crops/fields'),\n },\n {\n label: t('healthybowl.home.quickActions.viewWeather.label', 'View weather'),\n icon: Thermometer,\n path: buildPath('weather'),\n },\n {\n label: t('healthybowl.home.quickActions.analytics.label', 'Analytics'),\n icon: BarChart3,\n path: buildPath('analytics'),\n },\n ];\n\n // Compact header subline: date · farm + a live needs-attention summary.\n const attentionSummary =\n attentionCount === 0\n ? t('healthybowl.home.header.allClear', \"You're all caught up\")\n : attentionCount === 1\n ? t('healthybowl.home.header.needsAttentionOne', '1 item needs your attention')\n : t('healthybowl.home.header.needsAttentionOther', '{{count}} items need your attention', {\n count: attentionCount,\n });\n\n // PageLayout's `description` is a plain string; the date + farm reads as the subline.\n const headerSubline = farm?.name ? `${todayLabel} · ${farm.name}` : todayLabel;\n\n const headerActions = (\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('crops'))}\n 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\"\n >\n <Plus className=\"h-4 w-4\" />\n {t('healthybowl.home.primaryAction', 'Add')}\n </button>\n );\n\n return (\n <PageLayout\n title={t('healthybowl.home.title', 'Farm Dashboard')}\n description={headerSubline}\n actions={headerActions}\n >\n <section\n aria-labelledby=\"healthy-bowl-quota-heading\"\n className=\"mb-6 rounded-xl border border-border-seam bg-bg-surface p-5\"\n >\n <div className=\"mb-4 flex items-center justify-between gap-3\">\n <div>\n <h2 id=\"healthy-bowl-quota-heading\" className=\"text-base font-semibold text-text-primary\">\n {t('healthybowl.home.quotas.title', 'Plan usage')}\n </h2>\n <p className=\"text-sm text-text-secondary\">\n {t('healthybowl.home.quotas.description', 'See what your farm plan has used and what remains.')}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={() => navigate('/billing')}\n className=\"text-sm font-medium text-action-primary-text hover:underline\"\n >\n {t('healthybowl.home.quotas.billing', 'Manage plan')}\n </button>\n </div>\n {quotasLoading && quotas.length === 0 ? (\n <p className=\"text-sm text-text-secondary\">{t('healthybowl.common.loading', 'Loading…')}</p>\n ) : (\n <div className=\"grid gap-3 sm:grid-cols-2 lg:grid-cols-5\">\n {quotas.map((quota) => {\n const percent =\n quota.noLimit || quota.limit === null || quota.limit === 0\n ? 0\n : Math.min(100, Math.round((quota.used / quota.limit) * 100));\n return (\n <div key={quota.quotaName} className=\"rounded-lg border border-border-seam bg-bg-canvas p-3\">\n <div className=\"flex items-start justify-between gap-2\">\n <span className=\"text-sm font-medium text-text-primary\">{quota.label}</span>\n {quota.noLimit ? (\n <span className=\"text-xs text-text-secondary\">\n {t('healthybowl.home.quotas.unlimited', 'Unlimited')}\n </span>\n ) : null}\n </div>\n <p className=\"mt-2 text-lg font-semibold text-text-primary\">\n {quota.used}\n {quota.limit === null ? '' : ` / ${quota.limit}`}\n </p>\n {quota.limit !== null ? (\n <div className=\"mt-2 h-2 overflow-hidden rounded-full bg-bg-sunken\">\n <div\n className={`h-full ${quota.exhausted ? 'bg-status-error-bg' : 'bg-action-primary-bg'}`}\n style={{ width: `${percent}%` }}\n />\n </div>\n ) : null}\n <p className={`mt-1 text-xs ${quota.exhausted ? 'text-status-error-text' : 'text-text-secondary'}`}>\n {quota.exhausted\n ? t('healthybowl.home.quotas.exhausted', 'Limit reached')\n : quota.remaining === null\n ? t('healthybowl.home.quotas.noLimitRemaining', 'No limit')\n : t('healthybowl.home.quotas.remaining', '{{count}} remaining', { count: quota.remaining })}\n </p>\n </div>\n );\n })}\n </div>\n )}\n </section>\n {loadings.dashboard ? (\n <PageLoader />\n ) : errors.dashboard ? (\n <ErrorState onRetry={refetch} />\n ) : (\n <div className=\"space-y-6\">\n {/* Live needs-attention summary — reads directly under the compact header */}\n <div\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-sm font-medium',\n attentionCount === 0\n ? 'bg-status-success-bg text-status-success-text'\n : 'bg-status-warning-bg text-status-warning-text'\n )}\n >\n {attentionCount === 0 ? <CheckCircle2 className=\"size-4\" /> : <AlertTriangle className=\"size-4\" />}\n {attentionSummary}\n </div>\n\n {/* First-run onboarding — only once data has settled and there's no farm yet */}\n {!farm?.id && (\n <EmphasisPanel className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <p className=\"text-base font-semibold text-text-primary\">\n {t('healthybowl.home.onboarding.title', 'Welcome to HealthyBowl')}\n </p>\n <p className=\"text-sm text-text-secondary\">\n {t(\n 'healthybowl.home.onboarding.description',\n 'Set up your farm to start tracking crops, livestock, finances, and more.'\n )}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('getting-started'))}\n 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\"\n >\n <Plus className=\"h-4 w-4\" />\n {t('healthybowl.home.onboarding.action', 'Set up your farm')}\n </button>\n </EmphasisPanel>\n )}\n\n {/* Quick-action strip — compact row, existing wired targets */}\n <div className=\"flex flex-wrap gap-2\">\n {quickActions.map(({ label, icon: Icon, path }) => (\n <button\n key={label}\n type=\"button\"\n onClick={() => navigate(path)}\n 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\"\n >\n <Icon className=\"size-4\" />\n {label}\n </button>\n ))}\n </div>\n\n {/* Primary row — 4 real-field KPIs + needs-attention panel above the fold */}\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-3\">\n <div className=\"grid grid-cols-2 gap-4 lg:col-span-2\">\n <KpiTile\n label={t('healthybowl.home.kpi.activeCrops', 'Active crops')}\n value={String(stats.activeCrops)}\n icon={<Sprout />}\n drillLabel={t('healthybowl.home.kpi.viewCrops', 'View crops')}\n onClick={() => navigate(buildPath('crops'))}\n />\n <KpiTile\n label={t('healthybowl.home.kpi.harvestDue', 'Harvest due')}\n value={String(stats.harvestDue)}\n icon={<CalendarClock />}\n drillLabel={t('healthybowl.home.kpi.viewHarvest', 'View harvest')}\n onClick={() => navigate(buildPath('crops/harvest'))}\n />\n <KpiTile\n label={t('healthybowl.home.kpi.netProfit', 'Net profit')}\n value={formatCurrency(stats.netProfit, HB_DEFAULT_CURRENCY)}\n icon={<Wallet />}\n tone={netProfitTone}\n drillLabel={t('healthybowl.home.kpi.viewFinance', 'View finances')}\n onClick={() => navigate(buildPath('financial'))}\n />\n <KpiTile\n label={t('healthybowl.home.kpi.needsAttention', 'Needs attention')}\n value={String(attentionCount)}\n icon={<AlertTriangle />}\n tone={attentionTone}\n glow={attentionTone === 'danger' || attentionTone === 'warning'}\n drillLabel={t('healthybowl.home.kpi.viewAlerts', 'View alerts')}\n onClick={() => navigate(buildPath('weather/alerts'))}\n />\n </div>\n\n {/* Needs attention */}\n <GlassCard className=\"flex h-full flex-col border-border-seam p-0\">\n <div className=\"flex items-center justify-between px-4 pb-1 pt-4\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.home.needsAttention.title', 'Needs attention')}\n </h3>\n {sortedAlerts.length > 0 && (\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('weather/alerts'))}\n className=\"text-xs font-medium text-text-secondary transition-colors hover:text-text-primary focus-visible:text-text-primary focus-visible:outline-none\"\n >\n {t('healthybowl.home.needsAttention.viewAll', 'View all')}\n </button>\n )}\n </div>\n <div className=\"flex-1 px-4 pb-4\">\n {sortedAlerts.length === 0 ? (\n <EmptyState\n icon={<CheckCircle2 className=\"h-8 w-8 text-status-success-text\" />}\n title={t('healthybowl.home.needsAttention.empty.title', \"You're all caught up\")}\n description={t(\n 'healthybowl.home.needsAttention.empty.description',\n 'No urgent farm alerts right now.'\n )}\n action={\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('weather/alert-rules'))}\n 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\"\n >\n {t('healthybowl.home.needsAttention.empty.action', 'Manage alert rules')}\n </button>\n }\n />\n ) : (\n <ul className=\"divide-y divide-border-subtle\">\n {visibleAlerts.map((alert) => (\n <AlertRow\n key={alert.id}\n alert={alert}\n ctaLabel={alertCta(alert.severity)}\n relTime={relTime(alert.timestamp)}\n onOpen={() => openAlert(alert)}\n />\n ))}\n </ul>\n )}\n </div>\n </GlassCard>\n </div>\n\n {/* Anchor row — crop overview (strongest) + compact weather */}\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-3\">\n {/* Crop overview — the farm-specific anchor */}\n <GlassCard glow className=\"flex h-full flex-col border-border-seam p-0 lg:col-span-2\">\n <div className=\"flex items-center justify-between px-5 pb-2 pt-5\">\n <div className=\"flex items-center gap-2\">\n <span className=\"flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-primary [&>svg]:size-4\">\n <Sprout />\n </span>\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">\n {t('healthybowl.home.cropsAnchor.title', 'Crop overview')}\n </h2>\n <p className=\"text-xs text-text-secondary\">\n {crops.length === 1\n ? t('healthybowl.home.cropsAnchor.subtitleOne', '1 crop in progress')\n : t('healthybowl.home.cropsAnchor.subtitleOther', '{{count}} crops in progress', {\n count: crops.length,\n })}\n </p>\n </div>\n </div>\n {crops.length > 0 && (\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('crops'))}\n className=\"text-xs font-medium text-text-secondary transition-colors hover:text-text-primary focus-visible:text-text-primary focus-visible:outline-none\"\n >\n {t('healthybowl.home.cropsAnchor.viewAll', 'View all crops')}\n </button>\n )}\n </div>\n <div className=\"flex-1 px-3 pb-3\">\n {crops.length === 0 ? (\n <EmptyState\n icon={<Sprout className=\"h-8 w-8 text-primary\" />}\n title={t('healthybowl.home.cropsAnchor.empty.title', 'No active crops')}\n description={t(\n 'healthybowl.home.cropsAnchor.empty.description',\n 'Register your first crop to track growth, health and harvest here.'\n )}\n action={\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('crops'))}\n 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\"\n >\n <Plus className=\"h-4 w-4\" />\n {t('healthybowl.home.quickActions.addCrop.label', 'Add crop')}\n </button>\n }\n />\n ) : (\n <ul className=\"divide-y divide-border-subtle\">\n {visibleCrops.map((crop) => {\n const stage = (crop.growthStage || crop.status || '').replace(/_/g, ' ').trim();\n const metaLabel = [crop.fieldName, stage].filter(Boolean).join(' · ');\n return (\n <CropRow\n key={crop.id}\n crop={crop}\n metaLabel={metaLabel || t('healthybowl.home.cropsAnchor.noField', 'Unassigned')}\n healthLabel={(crop.healthStatus || 'unknown').replace(/_/g, ' ')}\n harvestLabel={\n crop.expectedHarvestDate\n ? t('healthybowl.home.cropsAnchor.harvest', 'Harvest {{date}}', {\n date: formatDateOnly(crop.expectedHarvestDate),\n })\n : t('healthybowl.home.cropsAnchor.harvestUnknown', 'Harvest date TBD')\n }\n openLabel={t('healthybowl.home.cropsAnchor.open', 'Open')}\n onOpen={() => navigate(buildPath(`crops/${crop.id}`))}\n />\n );\n })}\n </ul>\n )}\n </div>\n </GlassCard>\n\n {/* Weather — secondary */}\n <GlassCard className=\"flex h-full flex-col border-border-seam p-0\">\n <div className=\"px-4 pb-1 pt-4\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.home.weatherCard.title', 'Current weather')}\n </h3>\n {weather.location && <p className=\"text-xs text-text-secondary\">{weather.location}</p>}\n </div>\n <div className=\"flex flex-1 flex-col gap-4 px-4 pb-4\">\n {!hasWeather ? (\n // No observation. Say so, rather than printing 0 °C / 0% / 0 hPa\n // — fabricated readings are worse than none on a farm dashboard.\n <EmptyState\n icon={<CloudOff className=\"h-8 w-8 text-text-muted\" />}\n title={\n errors.weather\n ? t('healthybowl.home.weatherCard.error.title', 'Weather unavailable')\n : t('healthybowl.home.weatherCard.empty.title', 'No weather yet')\n }\n description={\n errors.weather\n ? t(\n 'healthybowl.home.weatherCard.error.description',\n \"We couldn't load conditions for your farm just now.\"\n )\n : t(\n 'healthybowl.home.weatherCard.empty.description',\n 'Set your farm location to see local conditions here.'\n )\n }\n action={\n <button\n type=\"button\"\n onClick={() => (errors.weather ? refetch() : navigate(buildPath('farm')))}\n 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\"\n >\n {errors.weather\n ? t('healthybowl.home.weatherCard.error.retry', 'Try again')\n : t('healthybowl.home.weatherCard.empty.action', 'Set farm location')}\n </button>\n }\n />\n ) : (\n <>\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-4xl font-bold text-text-primary\">{weather.current.temperature}°C</p>\n <p className=\"text-sm text-text-secondary\">{weather.current.condition}</p>\n <p className=\"mt-1 text-xs text-text-secondary\">\n {t('healthybowl.home.weatherCard.feelsLike', 'Feels like')} {weather.current.feelsLike}°C\n </p>\n </div>\n <div className=\"flex flex-col items-center\">\n <Cloud className=\"h-12 w-12 text-text-secondary\" />\n <span className=\"mt-1 text-xs text-text-secondary\">UV {weather.current.uvIndex}</span>\n </div>\n </div>\n\n <div className=\"grid grid-cols-2 gap-3 border-t border-border-subtle pt-3\">\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Droplets className=\"h-4 w-4\" />\n <span>\n {weather.current.humidity}% {t('healthybowl.home.weatherCard.humidity', 'Humidity')}\n </span>\n </div>\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Wind className=\"h-4 w-4\" />\n <span>{weather.current.windSpeed} km/h</span>\n </div>\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Thermometer className=\"h-4 w-4\" />\n <span>{weather.current.pressure} hPa</span>\n </div>\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Eye className=\"h-4 w-4\" />\n <span>{weather.current.visibility} km</span>\n </div>\n </div>\n </>\n )}\n\n {weather.forecast.length > 0 && (\n <div className=\"grid grid-cols-4 gap-2 border-t border-border-subtle pt-3\">\n {weather.forecast.slice(0, 4).map((day) => (\n <div key={day.date} className=\"rounded-md bg-bg-sunken/50 p-2 text-center\">\n <p className=\"text-xs font-medium text-text-secondary\">\n {new Date(day.date).toLocaleDateString('en-US', { weekday: 'short' })}\n </p>\n <p className=\"mt-1 text-sm font-semibold text-text-primary\">{day.high}°</p>\n <p className=\"text-xs text-text-secondary\">{day.low}°</p>\n <p className=\"mt-0.5 text-xs text-text-secondary\">{day.precipitation}%</p>\n </div>\n ))}\n </div>\n )}\n\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('weather'))}\n 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\"\n >\n {t('healthybowl.home.weatherCard.viewForecast', 'View full forecast')}\n </button>\n </div>\n </GlassCard>\n </div>\n\n {/* At a glance — demoted secondary metrics with honest zero-states */}\n <section>\n <h3 className=\"mb-2 text-xs font-medium uppercase tracking-wide text-text-secondary\">\n {t('healthybowl.home.glance.title', 'At a glance')}\n </h3>\n <div className=\"grid grid-cols-2 gap-3 sm:grid-cols-4\">\n <MiniStat\n label={t('healthybowl.home.glance.fields', 'Fields')}\n value={String(stats.totalFields)}\n hint={\n stats.totalFields > 0\n ? t('healthybowl.home.glance.fieldsHint', 'Monitored')\n : t('healthybowl.home.glance.fieldsEmpty', 'No fields yet')\n }\n icon={<MapPin />}\n onClick={() => navigate(buildPath('crops/fields'))}\n />\n <MiniStat\n label={t('healthybowl.home.glance.livestock', 'Livestock')}\n value={String(stats.totalAnimals)}\n hint={\n stats.totalAnimals > 0\n ? t('healthybowl.home.glance.livestockHint', 'Under management')\n : t('healthybowl.home.glance.livestockEmpty', 'No livestock added')\n }\n icon={<PawPrint />}\n onClick={() => navigate(buildPath('livestock'))}\n />\n <MiniStat\n label={t('healthybowl.home.glance.organic', 'Organic score')}\n value={\n stats.organicScore > 0\n ? `${stats.organicScore}%`\n : t('healthybowl.home.glance.organicEmpty', 'Not configured')\n }\n hint={stats.organicScore > 0 ? t('healthybowl.home.glance.organicHint', 'Compliance') : undefined}\n icon={<ShieldCheck />}\n onClick={() => navigate(buildPath('compliance'))}\n />\n <MiniStat\n label={t('healthybowl.home.glance.expenses', 'Expenses')}\n value={formatCurrency(stats.totalExpenses, HB_DEFAULT_CURRENCY)}\n hint={\n expenseRatioPercent != null\n ? t('healthybowl.home.glance.expensesRatio', '{{pct}}% of revenue', { pct: expenseRatioPercent })\n : t('healthybowl.home.glance.noRevenue', 'No revenue yet')\n }\n icon={<Wallet />}\n onClick={() => navigate(buildPath('financial'))}\n />\n </div>\n </section>\n </div>\n )}\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAuCA,IAAM,IAAuC;CAC3C,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;CACT,EAEK,IAAsC;CAC1C,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;CACT,EAEK,IAAkD;CAAE,UAAU;CAAG,SAAS;CAAG,MAAM;CAAG,EAEtF,IAAsD;CAC1D,UAAU;CACV,SAAS;CACT,MAAM;CACP,EAEK,KAAiB,MAAmB;AACxC,SAAQ,GAAR;EACE,KAAK,YACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,QACE,QAAO;;GAIP,KAAgB,MAAc,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC,CAAC,EAkBvE,KAA6B,EAAE,UAAO,UAAO,SAAM,UAAO,WAAW,UAAO,IAAO,eAAY,iBACnG,kBAAC,UAAD;CAAQ,MAAK;CAAkB;CAAS,WAAU;WAChD,kBAAC,GAAD;EACE,WAAU;EACJ;EACN,WAAU;YAHZ;GAKE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,QAAD;KAAM,WAAU;eAA2C;KAAa,CAAA,EACxE,kBAAC,QAAD;KAAM,WAAW,EAAG,qEAAqE,EAAc,GAAM;eAC1G;KACI,CAAA,CACH;;GACN,kBAAC,QAAD;IAAM,WAAW,EAAG,uCAAuC,EAAe,GAAM;cAAG;IAAa,CAAA;GAChG,kBAAC,QAAD;IAAM,WAAU;cAAhB,CACG,GACD,kBAAC,GAAD,EAAc,WAAU,YAAa,CAAA,CAChC;;GACG;;CACL,CAAA,EAYL,KAA+B,EAAE,UAAO,UAAO,SAAM,SAAM,iBAC/D,kBAAC,UAAD;CA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