@burdenoff/microfe-healthybowl 2026.710.21 → 2026.710.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/healthybowl/HealthyBowlRoot.js +93 -85
- package/dist/healthybowl/HealthyBowlRoot.js.map +1 -1
- package/dist/healthybowl/HealthyBowlRoutes.js +98 -86
- package/dist/healthybowl/HealthyBowlRoutes.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlWithdrawal.js +237 -0
- package/dist/healthybowl/hooks/useHealthyBowlWithdrawal.js.map +1 -0
- package/dist/healthybowl/pages/livestock/AnimalDetailsPage.js +532 -527
- package/dist/healthybowl/pages/livestock/AnimalDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/MedicationLibraryPage.js +387 -0
- package/dist/healthybowl/pages/livestock/MedicationLibraryPage.js.map +1 -0
- package/dist/healthybowl/pages/livestock/WithdrawalAlertsPage.js +286 -0
- package/dist/healthybowl/pages/livestock/WithdrawalAlertsPage.js.map +1 -0
- package/dist/healthybowl/pages/livestock/WithdrawalCalendarPage.js +182 -0
- package/dist/healthybowl/pages/livestock/WithdrawalCalendarPage.js.map +1 -0
- package/dist/healthybowl/pages/livestock/withdrawal/AnimalWithdrawalCard.js +166 -0
- package/dist/healthybowl/pages/livestock/withdrawal/AnimalWithdrawalCard.js.map +1 -0
- package/dist/healthybowl/pages/livestock/withdrawal/LogTreatmentModal.js +274 -0
- package/dist/healthybowl/pages/livestock/withdrawal/LogTreatmentModal.js.map +1 -0
- package/dist/healthybowl/pages/livestock/withdrawal/WithdrawalNav.js +40 -0
- package/dist/healthybowl/pages/livestock/withdrawal/WithdrawalNav.js.map +1 -0
- package/dist/healthybowl/pages/livestock/withdrawal/status.js +53 -0
- package/dist/healthybowl/pages/livestock/withdrawal/status.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { useBasePath as e } from "../../hooks/useBasePath.js";
|
|
2
|
+
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
|
+
import { StatCard as n } from "../../components/StatCard.js";
|
|
4
|
+
import { DataTable as r } from "../../components/DataTable.js";
|
|
5
|
+
import { StatusBadge as i } from "../../components/StatusBadge.js";
|
|
6
|
+
import { EmptyState as a } from "../../components/EmptyState.js";
|
|
7
|
+
import { ErrorState as o } from "../../components/ErrorState.js";
|
|
8
|
+
import { ToastContainer as s } from "../../components/Toast.js";
|
|
9
|
+
import { PageLoader as c } from "../../components/PageLoader.js";
|
|
10
|
+
import { useToast as ee } from "../../hooks/useToast.js";
|
|
11
|
+
import "../../components/index.js";
|
|
12
|
+
import { useHealthyBowlData as l } from "../../hooks/useHealthyBowlData.js";
|
|
13
|
+
import { useHealthyBowlWithdrawal as u } from "../../hooks/useHealthyBowlWithdrawal.js";
|
|
14
|
+
import { PRODUCE_LABEL as d, formatClearDate as f, statusMeta as p, statusPillLabel as m } from "./withdrawal/status.js";
|
|
15
|
+
import { WithdrawalNav as h } from "./withdrawal/WithdrawalNav.js";
|
|
16
|
+
import { LogTreatmentModal as g } from "./withdrawal/LogTreatmentModal.js";
|
|
17
|
+
import { useMemo as _, useState as v } from "react";
|
|
18
|
+
import { useI18n as y } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
19
|
+
import { AlertTriangle as b, RefreshCw as x, ShieldCheck as te, Syringe as S } from "lucide-react";
|
|
20
|
+
import { useNavigate as C } from "react-router-dom";
|
|
21
|
+
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
22
|
+
import { Button as D } from "@burdenoff/fe-libs/ui";
|
|
23
|
+
//#region src/healthybowl/pages/livestock/WithdrawalAlertsPage.tsx
|
|
24
|
+
function O(e) {
|
|
25
|
+
let t = [];
|
|
26
|
+
return e.milkWithdrawalDays !== null && t.push(`milk ${e.milkWithdrawalDays}d`), e.meatWithdrawalDays !== null && t.push(`meat ${e.meatWithdrawalDays}d`), e.eggsWithdrawalDays !== null && t.push(`eggs ${e.eggsWithdrawalDays}d`), t.length ? t.join(" · ") : "—";
|
|
27
|
+
}
|
|
28
|
+
function k(e) {
|
|
29
|
+
let t = e.produceStatuses.filter((e) => e.blocked && e.clearDate).map((e) => e.clearDate);
|
|
30
|
+
if (t.length) return t.sort()[0];
|
|
31
|
+
let n = e.produceStatuses.filter((e) => e.clearDate).map((e) => e.clearDate);
|
|
32
|
+
return n.length ? n.sort().slice(-1)[0] : null;
|
|
33
|
+
}
|
|
34
|
+
var A = () => {
|
|
35
|
+
let { t: A } = y(), j = C(), { buildPath: M } = e(), { toasts: N, toast: P, dismiss: F } = ee(), { activeWithdrawals: I, summary: L, library: ne, loading: R, errors: z, logTreatment: B, runScan: V, refetchAll: H } = u(), { animals: U } = l(), [W, G] = v(!1), [K, q] = v(!1), [J, Y] = v("ALL"), X = _(() => U.map((e) => ({
|
|
36
|
+
id: e.id,
|
|
37
|
+
tagNumber: e.tagNumber,
|
|
38
|
+
name: e.name,
|
|
39
|
+
type: e.type
|
|
40
|
+
})), [U]), Z = _(() => J === "ALL" ? I : I.filter((e) => e.overallStatus === J), [I, J]), Q = _(() => {
|
|
41
|
+
let e = [];
|
|
42
|
+
for (let t of I) for (let n of t.produceStatuses) n.blocked && n.clearDate && e.push({
|
|
43
|
+
key: `${t.id}-${n.produceType}`,
|
|
44
|
+
tag: t.animalTag,
|
|
45
|
+
produce: d[n.produceType],
|
|
46
|
+
clear: n.clearDate
|
|
47
|
+
});
|
|
48
|
+
return e.sort((e, t) => e.clear.localeCompare(t.clear)).slice(0, 6);
|
|
49
|
+
}, [I]), re = async (e) => {
|
|
50
|
+
let t = await B(e);
|
|
51
|
+
t && P({
|
|
52
|
+
title: A("healthybowl.withdrawal.toast.logged", "Treatment logged — withdrawal started"),
|
|
53
|
+
description: A("healthybowl.withdrawal.toast.loggedDesc", "{{tag}}: {{summary}}", {
|
|
54
|
+
tag: t.animalTag,
|
|
55
|
+
summary: O(t)
|
|
56
|
+
}),
|
|
57
|
+
variant: "success"
|
|
58
|
+
});
|
|
59
|
+
}, ie = async () => {
|
|
60
|
+
q(!0);
|
|
61
|
+
try {
|
|
62
|
+
let e = await V();
|
|
63
|
+
P({
|
|
64
|
+
title: e && e.cleared > 0 ? A("healthybowl.withdrawal.scan.cleared", "{{count}} product(s) cleared", { count: e.cleared }) : A("healthybowl.withdrawal.scan.none", "No products newly cleared"),
|
|
65
|
+
description: e ? A("healthybowl.withdrawal.scan.summary", "{{sent}} notification(s) sent.", { sent: e.notificationsSent }) : void 0,
|
|
66
|
+
variant: e && e.cleared > 0 ? "success" : "info"
|
|
67
|
+
});
|
|
68
|
+
} catch (e) {
|
|
69
|
+
P({
|
|
70
|
+
title: A("healthybowl.withdrawal.scan.failed", "Scan failed"),
|
|
71
|
+
description: e instanceof Error ? e.message : String(e),
|
|
72
|
+
variant: "error"
|
|
73
|
+
});
|
|
74
|
+
} finally {
|
|
75
|
+
q(!1);
|
|
76
|
+
}
|
|
77
|
+
}, ae = [
|
|
78
|
+
{
|
|
79
|
+
key: "animal",
|
|
80
|
+
header: A("healthybowl.withdrawal.table.animal", "Animal"),
|
|
81
|
+
render: (e) => /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("div", {
|
|
82
|
+
className: "font-medium text-text-primary",
|
|
83
|
+
children: e.animalTag
|
|
84
|
+
}), /* @__PURE__ */ T("div", {
|
|
85
|
+
className: "text-xs text-text-secondary",
|
|
86
|
+
children: e.animalName
|
|
87
|
+
})] })
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
key: "species",
|
|
91
|
+
header: A("healthybowl.withdrawal.table.species", "Species"),
|
|
92
|
+
render: (e) => /* @__PURE__ */ T("span", {
|
|
93
|
+
className: "capitalize",
|
|
94
|
+
children: e.animalType.toLowerCase()
|
|
95
|
+
})
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
key: "medication",
|
|
99
|
+
header: A("healthybowl.withdrawal.table.medication", "Medication"),
|
|
100
|
+
render: (e) => e.medicationName
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
key: "treated",
|
|
104
|
+
header: A("healthybowl.withdrawal.table.treatedOn", "Treated on"),
|
|
105
|
+
render: (e) => f(e.treatmentDate)
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
key: "days",
|
|
109
|
+
header: A("healthybowl.withdrawal.table.withdrawalDays", "Withdrawal"),
|
|
110
|
+
render: (e) => /* @__PURE__ */ T("span", {
|
|
111
|
+
className: "text-text-secondary",
|
|
112
|
+
children: O(e)
|
|
113
|
+
})
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
key: "clear",
|
|
117
|
+
header: A("healthybowl.withdrawal.table.clearDate", "Clear date"),
|
|
118
|
+
render: (e) => f(k(e))
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
key: "daysLeft",
|
|
122
|
+
header: A("healthybowl.withdrawal.table.daysLeft", "Days left"),
|
|
123
|
+
render: (e) => /* @__PURE__ */ T("span", {
|
|
124
|
+
className: "tabular-nums",
|
|
125
|
+
children: e.overallStatus === "CLEARED" ? "—" : `${e.daysLeft}`
|
|
126
|
+
})
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
key: "status",
|
|
130
|
+
header: A("healthybowl.withdrawal.table.status", "Status"),
|
|
131
|
+
render: (e) => /* @__PURE__ */ T(i, {
|
|
132
|
+
variant: p(e.overallStatus).variant,
|
|
133
|
+
label: m(e.overallStatus, e.daysLeft),
|
|
134
|
+
dot: !0
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
];
|
|
138
|
+
if (R.summary && !L && I.length === 0) return /* @__PURE__ */ T(c, {});
|
|
139
|
+
let $ = L?.productsBlocked ?? 0;
|
|
140
|
+
return /* @__PURE__ */ E(t, {
|
|
141
|
+
title: A("healthybowl.withdrawal.title", "Livestock — Medication Withdrawal Alerts"),
|
|
142
|
+
titleAccent: A("healthybowl.withdrawal.titleAccent", "Withdrawal"),
|
|
143
|
+
description: A("healthybowl.withdrawal.description", "Track treatment withdrawal periods so no milk, meat or eggs are sold or harvested before they are safe (organic compliance)."),
|
|
144
|
+
hero: !0,
|
|
145
|
+
purpose: "Log every medication treatment, and we count down the safe-by date per produce (milk / meat / eggs). An animal inside its withdrawal window is flagged BLOCKED and its produce can't be listed, harvested or trace-batched until it clears — protecting your organic certification.",
|
|
146
|
+
actions: /* @__PURE__ */ E("div", {
|
|
147
|
+
className: "flex flex-wrap gap-2",
|
|
148
|
+
children: [/* @__PURE__ */ E(D, {
|
|
149
|
+
variant: "outline",
|
|
150
|
+
onClick: ie,
|
|
151
|
+
disabled: K,
|
|
152
|
+
children: [/* @__PURE__ */ T(x, { className: K ? "h-4 w-4 animate-spin" : "h-4 w-4" }), K ? A("healthybowl.withdrawal.actions.scanning", "Checking…") : A("healthybowl.withdrawal.actions.scan", "Check clear dates")]
|
|
153
|
+
}), /* @__PURE__ */ E(D, {
|
|
154
|
+
onClick: () => G(!0),
|
|
155
|
+
children: [/* @__PURE__ */ T(S, { className: "h-4 w-4" }), A("healthybowl.withdrawal.actions.log", "Log a Treatment")]
|
|
156
|
+
})]
|
|
157
|
+
}),
|
|
158
|
+
children: [
|
|
159
|
+
/* @__PURE__ */ T(h, {}),
|
|
160
|
+
z.summary && !L ? /* @__PURE__ */ T(o, {
|
|
161
|
+
description: z.summary.message,
|
|
162
|
+
onRetry: () => void H()
|
|
163
|
+
}) : /* @__PURE__ */ E(w, { children: [
|
|
164
|
+
/* @__PURE__ */ E("div", {
|
|
165
|
+
className: "mt-4 grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",
|
|
166
|
+
children: [
|
|
167
|
+
/* @__PURE__ */ T(n, {
|
|
168
|
+
label: A("healthybowl.withdrawal.stats.underWithdrawal", "Animals under withdrawal"),
|
|
169
|
+
value: L?.animalsUnderWithdrawal ?? 0
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ T(n, {
|
|
172
|
+
label: A("healthybowl.withdrawal.stats.blocked", "Products blocked from sale"),
|
|
173
|
+
value: $
|
|
174
|
+
}),
|
|
175
|
+
/* @__PURE__ */ T(n, {
|
|
176
|
+
label: A("healthybowl.withdrawal.stats.next48h", "Clears in next 48h"),
|
|
177
|
+
value: L?.clearsNext48h ?? 0
|
|
178
|
+
}),
|
|
179
|
+
/* @__PURE__ */ T(n, {
|
|
180
|
+
label: A("healthybowl.withdrawal.stats.clearedWeek", "Cleared this week"),
|
|
181
|
+
value: L?.clearedThisWeek ?? 0,
|
|
182
|
+
hero: !0
|
|
183
|
+
})
|
|
184
|
+
]
|
|
185
|
+
}),
|
|
186
|
+
$ > 0 ? /* @__PURE__ */ E("div", {
|
|
187
|
+
className: "mt-4 flex items-center gap-2 rounded-lg border border-status-error-border bg-status-error-bg px-4 py-3 text-sm text-status-error-text",
|
|
188
|
+
children: [/* @__PURE__ */ T(b, { className: "h-4 w-4 shrink-0" }), /* @__PURE__ */ E("span", { children: [
|
|
189
|
+
/* @__PURE__ */ T("strong", {
|
|
190
|
+
className: "font-semibold",
|
|
191
|
+
children: $
|
|
192
|
+
}),
|
|
193
|
+
" ",
|
|
194
|
+
A("healthybowl.withdrawal.banner", "product(s) are currently BLOCKED from sale or harvest until their withdrawal period ends.")
|
|
195
|
+
] })]
|
|
196
|
+
}) : null,
|
|
197
|
+
/* @__PURE__ */ E("div", {
|
|
198
|
+
className: "mt-6 grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
199
|
+
children: [/* @__PURE__ */ E("div", {
|
|
200
|
+
className: "lg:col-span-2",
|
|
201
|
+
children: [/* @__PURE__ */ E("div", {
|
|
202
|
+
className: "mb-3 flex flex-wrap items-center justify-between gap-2",
|
|
203
|
+
children: [/* @__PURE__ */ T("h2", {
|
|
204
|
+
className: "text-lg font-semibold text-text-primary",
|
|
205
|
+
children: A("healthybowl.withdrawal.activeTitle", "Active Withdrawal Periods")
|
|
206
|
+
}), /* @__PURE__ */ T("div", {
|
|
207
|
+
className: "inline-flex rounded-lg border border-border-subtle p-0.5",
|
|
208
|
+
children: [
|
|
209
|
+
"ALL",
|
|
210
|
+
"BLOCKED",
|
|
211
|
+
"UNDER_WITHDRAWAL",
|
|
212
|
+
"CLEARED"
|
|
213
|
+
].map((e) => /* @__PURE__ */ T("button", {
|
|
214
|
+
type: "button",
|
|
215
|
+
onClick: () => Y(e),
|
|
216
|
+
className: `rounded-md px-2.5 py-1 text-xs transition-colors ${J === e ? "bg-bg-sunken font-medium text-text-primary" : "text-text-secondary hover:text-text-primary"}`,
|
|
217
|
+
children: e === "ALL" ? A("healthybowl.withdrawal.filter.all", "All") : e === "UNDER_WITHDRAWAL" ? A("healthybowl.withdrawal.filter.under", "Under") : e === "BLOCKED" ? A("healthybowl.withdrawal.filter.blocked", "Blocked") : A("healthybowl.withdrawal.filter.cleared", "Cleared")
|
|
218
|
+
}, e))
|
|
219
|
+
})]
|
|
220
|
+
}), I.length === 0 ? /* @__PURE__ */ T(a, {
|
|
221
|
+
icon: /* @__PURE__ */ T(te, { className: "h-8 w-8 text-status-success-text" }),
|
|
222
|
+
title: A("healthybowl.withdrawal.empty.title", "All clear — no animals under withdrawal"),
|
|
223
|
+
description: A("healthybowl.withdrawal.empty.description", "Every animal's milk, meat and eggs are currently safe to sell. When you log a medication treatment, its withdrawal countdown appears here automatically."),
|
|
224
|
+
action: /* @__PURE__ */ E(D, {
|
|
225
|
+
onClick: () => G(!0),
|
|
226
|
+
children: [/* @__PURE__ */ T(S, { className: "h-4 w-4" }), A("healthybowl.withdrawal.actions.log", "Log a Treatment")]
|
|
227
|
+
})
|
|
228
|
+
}) : /* @__PURE__ */ T(r, {
|
|
229
|
+
columns: ae,
|
|
230
|
+
data: Z,
|
|
231
|
+
keyField: "id",
|
|
232
|
+
onRowClick: (e) => j(M(`livestock/animals/${e.animalId}`)),
|
|
233
|
+
emptyMessage: A("healthybowl.withdrawal.table.emptyFilter", "No animals match this filter."),
|
|
234
|
+
pageSize: 10
|
|
235
|
+
})]
|
|
236
|
+
}), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h2", {
|
|
237
|
+
className: "mb-3 text-lg font-semibold text-text-primary",
|
|
238
|
+
children: A("healthybowl.withdrawal.upcomingTitle", "Upcoming clear dates")
|
|
239
|
+
}), /* @__PURE__ */ T("div", {
|
|
240
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
241
|
+
children: Q.length === 0 ? /* @__PURE__ */ T("p", {
|
|
242
|
+
className: "text-sm text-text-secondary",
|
|
243
|
+
children: A("healthybowl.withdrawal.upcomingEmpty", "Nothing pending — all produce is clear.")
|
|
244
|
+
}) : /* @__PURE__ */ T("ol", {
|
|
245
|
+
className: "space-y-3",
|
|
246
|
+
children: Q.map((e) => /* @__PURE__ */ E("li", {
|
|
247
|
+
className: "flex items-start gap-3",
|
|
248
|
+
children: [/* @__PURE__ */ T("span", { className: "mt-1.5 h-2 w-2 shrink-0 rounded-full bg-status-warning-text" }), /* @__PURE__ */ E("div", {
|
|
249
|
+
className: "text-sm",
|
|
250
|
+
children: [/* @__PURE__ */ T("div", {
|
|
251
|
+
className: "font-medium text-text-primary",
|
|
252
|
+
children: e.tag
|
|
253
|
+
}), /* @__PURE__ */ E("div", {
|
|
254
|
+
className: "text-text-secondary",
|
|
255
|
+
children: [
|
|
256
|
+
e.produce.toLowerCase(),
|
|
257
|
+
" — ",
|
|
258
|
+
A("healthybowl.withdrawal.clears", "clears"),
|
|
259
|
+
" ",
|
|
260
|
+
f(e.clear)
|
|
261
|
+
]
|
|
262
|
+
})]
|
|
263
|
+
})]
|
|
264
|
+
}, e.key))
|
|
265
|
+
})
|
|
266
|
+
})] })]
|
|
267
|
+
})
|
|
268
|
+
] }),
|
|
269
|
+
/* @__PURE__ */ T(g, {
|
|
270
|
+
open: W,
|
|
271
|
+
onClose: () => G(!1),
|
|
272
|
+
animals: X,
|
|
273
|
+
library: ne,
|
|
274
|
+
onSubmit: re
|
|
275
|
+
}),
|
|
276
|
+
/* @__PURE__ */ T(s, {
|
|
277
|
+
toasts: N,
|
|
278
|
+
onDismiss: F
|
|
279
|
+
})
|
|
280
|
+
]
|
|
281
|
+
});
|
|
282
|
+
};
|
|
283
|
+
//#endregion
|
|
284
|
+
export { A as WithdrawalAlertsPage };
|
|
285
|
+
|
|
286
|
+
//# sourceMappingURL=WithdrawalAlertsPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WithdrawalAlertsPage.js","names":[],"sources":["../../../../src/healthybowl/pages/livestock/WithdrawalAlertsPage.tsx"],"sourcesContent":["/**\n * Livestock — Medication Withdrawal Alerts dashboard.\n * Roadmap 13 · BOFF-2885 · gap L-2 (mock views 1 & 8).\n *\n * Every row is a real MedicationTreatment from the backend; the stat cards, the \"blocked\"\n * banner and the countdowns are all computed server-side. No fabricated data.\n */\nimport { useMemo, useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { AlertTriangle, RefreshCw, ShieldCheck, Syringe } from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { PageLayout, StatCard, DataTable, StatusBadge, EmptyState, ErrorState, PageLoader } from '../../components';\nimport type { Column } from '../../components';\nimport { ToastContainer } from '../../components/Toast';\nimport { useToast } from '../../hooks/useToast';\nimport { useBasePath } from '../../hooks/useBasePath';\nimport { useHealthyBowlData } from '../../hooks/useHealthyBowlData';\nimport { useHealthyBowlWithdrawal, type MedicationTreatment } from '../../hooks/useHealthyBowlWithdrawal';\nimport { LogTreatmentModal } from './withdrawal/LogTreatmentModal';\nimport { WithdrawalNav } from './withdrawal/WithdrawalNav';\nimport { PRODUCE_LABEL, formatClearDate, statusMeta, statusPillLabel } from './withdrawal/status';\n\n/** \"milk 4d · meat 28d\" from a treatment's applicable produce. */\nfunction withdrawalDaysSummary(tr: MedicationTreatment): string {\n const parts: string[] = [];\n if (tr.milkWithdrawalDays !== null) parts.push(`milk ${tr.milkWithdrawalDays}d`);\n if (tr.meatWithdrawalDays !== null) parts.push(`meat ${tr.meatWithdrawalDays}d`);\n if (tr.eggsWithdrawalDays !== null) parts.push(`eggs ${tr.eggsWithdrawalDays}d`);\n return parts.length ? parts.join(' · ') : '—';\n}\n\n/** The soonest still-blocked clear date, else the latest applicable clear date. */\nfunction primaryClearDate(tr: MedicationTreatment): string | null {\n const blocked = tr.produceStatuses.filter((p) => p.blocked && p.clearDate).map((p) => p.clearDate as string);\n if (blocked.length) return blocked.sort()[0];\n const any = tr.produceStatuses.filter((p) => p.clearDate).map((p) => p.clearDate as string);\n return any.length ? any.sort().slice(-1)[0] : null;\n}\n\nexport const WithdrawalAlertsPage = () => {\n const { t } = useI18n();\n const navigate = useNavigate();\n const { buildPath } = useBasePath();\n const { toasts, toast, dismiss } = useToast();\n\n const { activeWithdrawals, summary, library, loading, errors, logTreatment, runScan, refetchAll } =\n useHealthyBowlWithdrawal();\n const { animals } = useHealthyBowlData();\n\n const [modalOpen, setModalOpen] = useState(false);\n const [scanning, setScanning] = useState(false);\n const [statusFilter, setStatusFilter] = useState<'ALL' | 'BLOCKED' | 'UNDER_WITHDRAWAL' | 'CLEARED'>('ALL');\n\n const animalOptions = useMemo(\n () => animals.map((a) => ({ id: a.id, tagNumber: a.tagNumber, name: a.name, type: a.type })),\n [animals]\n );\n\n const rows = useMemo(\n () =>\n statusFilter === 'ALL' ? activeWithdrawals : activeWithdrawals.filter((r) => r.overallStatus === statusFilter),\n [activeWithdrawals, statusFilter]\n );\n\n const upcoming = useMemo(() => {\n const entries: Array<{ key: string; tag: string; produce: string; clear: string }> = [];\n for (const tr of activeWithdrawals) {\n for (const p of tr.produceStatuses) {\n if (p.blocked && p.clearDate) {\n entries.push({\n key: `${tr.id}-${p.produceType}`,\n tag: tr.animalTag,\n produce: PRODUCE_LABEL[p.produceType],\n clear: p.clearDate,\n });\n }\n }\n }\n return entries.sort((a, b) => a.clear.localeCompare(b.clear)).slice(0, 6);\n }, [activeWithdrawals]);\n\n const handleLog = async (input: Record<string, unknown>) => {\n const res = await logTreatment(input);\n if (res) {\n toast({\n title: t('healthybowl.withdrawal.toast.logged', 'Treatment logged — withdrawal started'),\n description: t('healthybowl.withdrawal.toast.loggedDesc', '{{tag}}: {{summary}}', {\n tag: res.animalTag,\n summary: withdrawalDaysSummary(res),\n }),\n variant: 'success',\n });\n }\n };\n\n const handleScan = async () => {\n setScanning(true);\n try {\n const result = await runScan();\n toast({\n title:\n result && result.cleared > 0\n ? t('healthybowl.withdrawal.scan.cleared', '{{count}} product(s) cleared', { count: result.cleared })\n : t('healthybowl.withdrawal.scan.none', 'No products newly cleared'),\n description: result\n ? t('healthybowl.withdrawal.scan.summary', '{{sent}} notification(s) sent.', {\n sent: result.notificationsSent,\n })\n : undefined,\n variant: result && result.cleared > 0 ? 'success' : 'info',\n });\n } catch (err) {\n toast({\n title: t('healthybowl.withdrawal.scan.failed', 'Scan failed'),\n description: err instanceof Error ? err.message : String(err),\n variant: 'error',\n });\n } finally {\n setScanning(false);\n }\n };\n\n const columns: Column<MedicationTreatment>[] = [\n {\n key: 'animal',\n header: t('healthybowl.withdrawal.table.animal', 'Animal'),\n render: (r) => (\n <div>\n <div className=\"font-medium text-text-primary\">{r.animalTag}</div>\n <div className=\"text-xs text-text-secondary\">{r.animalName}</div>\n </div>\n ),\n },\n {\n key: 'species',\n header: t('healthybowl.withdrawal.table.species', 'Species'),\n render: (r) => <span className=\"capitalize\">{r.animalType.toLowerCase()}</span>,\n },\n {\n key: 'medication',\n header: t('healthybowl.withdrawal.table.medication', 'Medication'),\n render: (r) => r.medicationName,\n },\n {\n key: 'treated',\n header: t('healthybowl.withdrawal.table.treatedOn', 'Treated on'),\n render: (r) => formatClearDate(r.treatmentDate),\n },\n {\n key: 'days',\n header: t('healthybowl.withdrawal.table.withdrawalDays', 'Withdrawal'),\n render: (r) => <span className=\"text-text-secondary\">{withdrawalDaysSummary(r)}</span>,\n },\n {\n key: 'clear',\n header: t('healthybowl.withdrawal.table.clearDate', 'Clear date'),\n render: (r) => formatClearDate(primaryClearDate(r)),\n },\n {\n key: 'daysLeft',\n header: t('healthybowl.withdrawal.table.daysLeft', 'Days left'),\n render: (r) => <span className=\"tabular-nums\">{r.overallStatus === 'CLEARED' ? '—' : `${r.daysLeft}`}</span>,\n },\n {\n key: 'status',\n header: t('healthybowl.withdrawal.table.status', 'Status'),\n render: (r) => (\n <StatusBadge\n variant={statusMeta(r.overallStatus).variant}\n label={statusPillLabel(r.overallStatus, r.daysLeft)}\n dot\n />\n ),\n },\n ];\n\n if (loading.summary && !summary && activeWithdrawals.length === 0) {\n return <PageLoader />;\n }\n\n const productsBlocked = summary?.productsBlocked ?? 0;\n\n return (\n <PageLayout\n title={t('healthybowl.withdrawal.title', 'Livestock — Medication Withdrawal Alerts')}\n titleAccent={t('healthybowl.withdrawal.titleAccent', 'Withdrawal')}\n description={t(\n 'healthybowl.withdrawal.description',\n 'Track treatment withdrawal periods so no milk, meat or eggs are sold or harvested before they are safe (organic compliance).'\n )}\n hero\n purpose=\"Log every medication treatment, and we count down the safe-by date per produce (milk / meat / eggs). An animal inside its withdrawal window is flagged BLOCKED and its produce can't be listed, harvested or trace-batched until it clears — protecting your organic certification.\"\n actions={\n <div className=\"flex flex-wrap gap-2\">\n <Button variant=\"outline\" onClick={handleScan} disabled={scanning}>\n <RefreshCw className={scanning ? 'h-4 w-4 animate-spin' : 'h-4 w-4'} />\n {scanning\n ? t('healthybowl.withdrawal.actions.scanning', 'Checking…')\n : t('healthybowl.withdrawal.actions.scan', 'Check clear dates')}\n </Button>\n <Button onClick={() => setModalOpen(true)}>\n <Syringe className=\"h-4 w-4\" />\n {t('healthybowl.withdrawal.actions.log', 'Log a Treatment')}\n </Button>\n </div>\n }\n >\n <WithdrawalNav />\n\n {errors.summary && !summary ? (\n <ErrorState description={errors.summary.message} onRetry={() => void refetchAll()} />\n ) : (\n <>\n {/* Stat cards */}\n <div className=\"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4\">\n <StatCard\n label={t('healthybowl.withdrawal.stats.underWithdrawal', 'Animals under withdrawal')}\n value={summary?.animalsUnderWithdrawal ?? 0}\n />\n <StatCard\n label={t('healthybowl.withdrawal.stats.blocked', 'Products blocked from sale')}\n value={productsBlocked}\n />\n <StatCard\n label={t('healthybowl.withdrawal.stats.next48h', 'Clears in next 48h')}\n value={summary?.clearsNext48h ?? 0}\n />\n <StatCard\n label={t('healthybowl.withdrawal.stats.clearedWeek', 'Cleared this week')}\n value={summary?.clearedThisWeek ?? 0}\n hero\n />\n </div>\n\n {/* Blocked banner */}\n {productsBlocked > 0 ? (\n <div className=\"mt-4 flex items-center gap-2 rounded-lg border border-status-error-border bg-status-error-bg px-4 py-3 text-sm text-status-error-text\">\n <AlertTriangle className=\"h-4 w-4 shrink-0\" />\n <span>\n <strong className=\"font-semibold\">{productsBlocked}</strong>{' '}\n {t(\n 'healthybowl.withdrawal.banner',\n 'product(s) are currently BLOCKED from sale or harvest until their withdrawal period ends.'\n )}\n </span>\n </div>\n ) : null}\n\n <div className=\"mt-6 grid grid-cols-1 gap-6 lg:grid-cols-3\">\n {/* Active withdrawal periods */}\n <div className=\"lg:col-span-2\">\n <div className=\"mb-3 flex flex-wrap items-center justify-between gap-2\">\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {t('healthybowl.withdrawal.activeTitle', 'Active Withdrawal Periods')}\n </h2>\n <div className=\"inline-flex rounded-lg border border-border-subtle p-0.5\">\n {(['ALL', 'BLOCKED', 'UNDER_WITHDRAWAL', 'CLEARED'] as const).map((v) => (\n <button\n key={v}\n type=\"button\"\n onClick={() => setStatusFilter(v)}\n className={`rounded-md px-2.5 py-1 text-xs transition-colors ${statusFilter === v ? 'bg-bg-sunken font-medium text-text-primary' : 'text-text-secondary hover:text-text-primary'}`}\n >\n {v === 'ALL'\n ? t('healthybowl.withdrawal.filter.all', 'All')\n : v === 'UNDER_WITHDRAWAL'\n ? t('healthybowl.withdrawal.filter.under', 'Under')\n : v === 'BLOCKED'\n ? t('healthybowl.withdrawal.filter.blocked', 'Blocked')\n : t('healthybowl.withdrawal.filter.cleared', 'Cleared')}\n </button>\n ))}\n </div>\n </div>\n\n {activeWithdrawals.length === 0 ? (\n <EmptyState\n icon={<ShieldCheck className=\"h-8 w-8 text-status-success-text\" />}\n title={t('healthybowl.withdrawal.empty.title', 'All clear — no animals under withdrawal')}\n description={t(\n 'healthybowl.withdrawal.empty.description',\n \"Every animal's milk, meat and eggs are currently safe to sell. When you log a medication treatment, its withdrawal countdown appears here automatically.\"\n )}\n action={\n <Button onClick={() => setModalOpen(true)}>\n <Syringe className=\"h-4 w-4\" />\n {t('healthybowl.withdrawal.actions.log', 'Log a Treatment')}\n </Button>\n }\n />\n ) : (\n <DataTable\n columns={columns}\n data={rows}\n keyField=\"id\"\n onRowClick={(r) => navigate(buildPath(`livestock/animals/${r.animalId}`))}\n emptyMessage={t('healthybowl.withdrawal.table.emptyFilter', 'No animals match this filter.')}\n pageSize={10}\n />\n )}\n </div>\n\n {/* Upcoming clear dates */}\n <div>\n <h2 className=\"mb-3 text-lg font-semibold text-text-primary\">\n {t('healthybowl.withdrawal.upcomingTitle', 'Upcoming clear dates')}\n </h2>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n {upcoming.length === 0 ? (\n <p className=\"text-sm text-text-secondary\">\n {t('healthybowl.withdrawal.upcomingEmpty', 'Nothing pending — all produce is clear.')}\n </p>\n ) : (\n <ol className=\"space-y-3\">\n {upcoming.map((u) => (\n <li key={u.key} className=\"flex items-start gap-3\">\n <span className=\"mt-1.5 h-2 w-2 shrink-0 rounded-full bg-status-warning-text\" />\n <div className=\"text-sm\">\n <div className=\"font-medium text-text-primary\">{u.tag}</div>\n <div className=\"text-text-secondary\">\n {u.produce.toLowerCase()} — {t('healthybowl.withdrawal.clears', 'clears')}{' '}\n {formatClearDate(u.clear)}\n </div>\n </div>\n </li>\n ))}\n </ol>\n )}\n </div>\n </div>\n </div>\n </>\n )}\n\n <LogTreatmentModal\n open={modalOpen}\n onClose={() => setModalOpen(false)}\n animals={animalOptions}\n library={library}\n onSubmit={handleLog}\n />\n <ToastContainer toasts={toasts} onDismiss={dismiss} />\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAS,EAAsB,GAAiC;CAC9D,IAAM,IAAkB,EAAE;AAI1B,QAHI,EAAG,uBAAuB,QAAM,EAAM,KAAK,QAAQ,EAAG,mBAAmB,GAAG,EAC5E,EAAG,uBAAuB,QAAM,EAAM,KAAK,QAAQ,EAAG,mBAAmB,GAAG,EAC5E,EAAG,uBAAuB,QAAM,EAAM,KAAK,QAAQ,EAAG,mBAAmB,GAAG,EACzE,EAAM,SAAS,EAAM,KAAK,MAAM,GAAG;;AAI5C,SAAS,EAAiB,GAAwC;CAChE,IAAM,IAAU,EAAG,gBAAgB,QAAQ,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,KAAK,MAAM,EAAE,UAAoB;AAC5G,KAAI,EAAQ,OAAQ,QAAO,EAAQ,MAAM,CAAC;CAC1C,IAAM,IAAM,EAAG,gBAAgB,QAAQ,MAAM,EAAE,UAAU,CAAC,KAAK,MAAM,EAAE,UAAoB;AAC3F,QAAO,EAAI,SAAS,EAAI,MAAM,CAAC,MAAM,GAAG,CAAC,KAAK;;AAGhD,IAAa,UAA6B;CACxC,IAAM,EAAE,SAAM,GAAS,EACjB,IAAW,GAAa,EACxB,EAAE,iBAAc,GAAa,EAC7B,EAAE,WAAQ,UAAO,eAAY,IAAU,EAEvC,EAAE,sBAAmB,YAAS,aAAS,YAAS,WAAQ,iBAAc,YAAS,kBACnF,GAA0B,EACtB,EAAE,eAAY,GAAoB,EAElC,CAAC,GAAW,KAAgB,EAAS,GAAM,EAC3C,CAAC,GAAU,KAAe,EAAS,GAAM,EACzC,CAAC,GAAc,KAAmB,EAA6D,MAAM,EAErG,IAAgB,QACd,EAAQ,KAAK,OAAO;EAAE,IAAI,EAAE;EAAI,WAAW,EAAE;EAAW,MA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AAI,WAAU;gBACX,EAAE,wCAAwC,uBAAuB;MAC/D,CAAA,EACL,kBAAC,OAAD;MAAK,WAAU;gBACZ,EAAS,WAAW,IACnB,kBAAC,KAAD;OAAG,WAAU;iBACV,EAAE,wCAAwC,0CAA0C;OACnF,CAAA,GAEJ,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAS,KAAK,MACb,kBAAC,MAAD;QAAgB,WAAU;kBAA1B,CACE,kBAAC,QAAD,EAAM,WAAU,+DAAgE,CAAA,EAChF,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,OAAD;UAAK,WAAU;oBAAiC,EAAE;UAAU,CAAA,EAC5D,kBAAC,OAAD;UAAK,WAAU;oBAAf;WACG,EAAE,QAAQ,aAAa;WAAC;WAAI,EAAE,iCAAiC,SAAS;WAAE;WAC1E,EAAgB,EAAE,MAAM;WACrB;YACF;WACH;UATI,EAAE,IASN,CACL;OACC,CAAA;MAEH,CAAA,CACF,EAAA,CAAA,CACF;;IACL,EAAA,CAAA;GAGL,kBAAC,GAAD;IACE,MAAM;IACN,eAAe,EAAa,GAAM;IAClC,SAAS;IACA;IACT,UAAU;IACV,CAAA;GACF,kBAAC,GAAD;IAAwB;IAAQ,WAAW;IAAW,CAAA;GAC3C"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { PageLayout as e } from "../../components/PageLayout.js";
|
|
2
|
+
import { ErrorState as t } from "../../components/ErrorState.js";
|
|
3
|
+
import { PageLoader as n } from "../../components/PageLoader.js";
|
|
4
|
+
import "../../components/index.js";
|
|
5
|
+
import { GET_CALENDAR as r, useHealthyBowlWithdrawal as i } from "../../hooks/useHealthyBowlWithdrawal.js";
|
|
6
|
+
import { PRODUCE_LABEL as a, formatClearDate as o } from "./withdrawal/status.js";
|
|
7
|
+
import { WithdrawalNav as s } from "./withdrawal/WithdrawalNav.js";
|
|
8
|
+
import { useMemo as c, useState as l } from "react";
|
|
9
|
+
import { useI18n as u } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
10
|
+
import { ChevronLeft as d, ChevronRight as f } from "lucide-react";
|
|
11
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
12
|
+
import { Button as h } from "@burdenoff/fe-libs/ui";
|
|
13
|
+
import { useQuery as g } from "@apollo/client/react";
|
|
14
|
+
//#region src/healthybowl/pages/livestock/WithdrawalCalendarPage.tsx
|
|
15
|
+
var _ = 864e5, v = [
|
|
16
|
+
"Sun",
|
|
17
|
+
"Mon",
|
|
18
|
+
"Tue",
|
|
19
|
+
"Wed",
|
|
20
|
+
"Thu",
|
|
21
|
+
"Fri",
|
|
22
|
+
"Sat"
|
|
23
|
+
], y = (e) => e.toISOString().slice(0, 10), b = {
|
|
24
|
+
BLOCKED: "bg-status-error-bg text-status-error-text",
|
|
25
|
+
UNDER_WITHDRAWAL: "bg-status-warning-bgSubtle text-status-warning-text",
|
|
26
|
+
CLEARED: "bg-status-success-bgSubtle text-status-success-text",
|
|
27
|
+
NOT_APPLICABLE: "bg-bg-sunken text-text-secondary"
|
|
28
|
+
}, x = {
|
|
29
|
+
BLOCKED: "bg-status-error-text",
|
|
30
|
+
UNDER_WITHDRAWAL: "bg-status-warning-text",
|
|
31
|
+
CLEARED: "bg-status-success-text",
|
|
32
|
+
NOT_APPLICABLE: "bg-text-tertiary"
|
|
33
|
+
}, S = () => {
|
|
34
|
+
let { t: S } = u(), { context: C } = i({ skipLibrary: !0 }), [w, T] = l(0), E = c(() => {
|
|
35
|
+
let e = /* @__PURE__ */ new Date();
|
|
36
|
+
return new Date(Date.UTC(e.getUTCFullYear(), e.getUTCMonth() + w, 1));
|
|
37
|
+
}, [w]), D = E, O = new Date(Date.UTC(E.getUTCFullYear(), E.getUTCMonth() + 1, 0)), k = new Date(D.getTime() - D.getUTCDay() * _), A = new Date(k.getTime() - _), j = new Date(O.getTime() + 14 * _), { data: M, loading: N, error: P, refetch: F } = g(r, {
|
|
38
|
+
variables: {
|
|
39
|
+
context: C,
|
|
40
|
+
from: y(A),
|
|
41
|
+
to: y(j)
|
|
42
|
+
},
|
|
43
|
+
fetchPolicy: "cache-and-network"
|
|
44
|
+
}), I = M?.getHealthyBowlWithdrawalCalendar ?? [], L = c(() => {
|
|
45
|
+
let e = /* @__PURE__ */ new Map();
|
|
46
|
+
for (let t of I) {
|
|
47
|
+
let n = e.get(t.date) ?? [];
|
|
48
|
+
n.push(t), e.set(t.date, n);
|
|
49
|
+
}
|
|
50
|
+
return e;
|
|
51
|
+
}, [I]), R = c(() => {
|
|
52
|
+
let e = [];
|
|
53
|
+
for (let t = 0; t < 42; t++) e.push(new Date(k.getTime() + t * _));
|
|
54
|
+
return e;
|
|
55
|
+
}, [k]), z = y(/* @__PURE__ */ new Date()), B = c(() => I.filter((e) => e.date >= z).sort((e, t) => e.date.localeCompare(t.date)).slice(0, 8), [I, z]), V = E.toLocaleDateString("en-GB", {
|
|
56
|
+
month: "long",
|
|
57
|
+
year: "numeric",
|
|
58
|
+
timeZone: "UTC"
|
|
59
|
+
});
|
|
60
|
+
return N && I.length === 0 ? /* @__PURE__ */ p(n, {}) : /* @__PURE__ */ m(e, {
|
|
61
|
+
title: S("healthybowl.withdrawal.calendar.title", "Withdrawal Clear-Date Calendar"),
|
|
62
|
+
description: S("healthybowl.withdrawal.calendar.description", "Upcoming dates when animals clear their medication withdrawal and produce becomes safe to sell."),
|
|
63
|
+
children: [/* @__PURE__ */ p(s, {}), P && I.length === 0 ? /* @__PURE__ */ p(t, {
|
|
64
|
+
description: P.message,
|
|
65
|
+
onRetry: () => void F()
|
|
66
|
+
}) : /* @__PURE__ */ m("div", {
|
|
67
|
+
className: "mt-4 grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
68
|
+
children: [/* @__PURE__ */ m("div", {
|
|
69
|
+
className: "lg:col-span-2",
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ m("div", {
|
|
72
|
+
className: "mb-3 flex items-center justify-between",
|
|
73
|
+
children: [/* @__PURE__ */ p("h2", {
|
|
74
|
+
className: "text-lg font-semibold text-text-primary",
|
|
75
|
+
children: V
|
|
76
|
+
}), /* @__PURE__ */ m("div", {
|
|
77
|
+
className: "flex gap-1",
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ p(h, {
|
|
80
|
+
variant: "outline",
|
|
81
|
+
size: "sm",
|
|
82
|
+
onClick: () => T((e) => e - 1),
|
|
83
|
+
"aria-label": "Previous month",
|
|
84
|
+
children: /* @__PURE__ */ p(d, { className: "h-4 w-4" })
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ p(h, {
|
|
87
|
+
variant: "outline",
|
|
88
|
+
size: "sm",
|
|
89
|
+
onClick: () => T(0),
|
|
90
|
+
children: S("healthybowl.withdrawal.calendar.today", "Today")
|
|
91
|
+
}),
|
|
92
|
+
/* @__PURE__ */ p(h, {
|
|
93
|
+
variant: "outline",
|
|
94
|
+
size: "sm",
|
|
95
|
+
onClick: () => T((e) => e + 1),
|
|
96
|
+
"aria-label": "Next month",
|
|
97
|
+
children: /* @__PURE__ */ p(f, { className: "h-4 w-4" })
|
|
98
|
+
})
|
|
99
|
+
]
|
|
100
|
+
})]
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ m("div", {
|
|
103
|
+
className: "overflow-hidden rounded-lg border border-border-subtle bg-bg-surface",
|
|
104
|
+
children: [/* @__PURE__ */ p("div", {
|
|
105
|
+
className: "grid grid-cols-7 border-b border-border-subtle bg-bg-sunken text-center text-xs font-medium text-text-secondary",
|
|
106
|
+
children: v.map((e) => /* @__PURE__ */ p("div", {
|
|
107
|
+
className: "py-2",
|
|
108
|
+
children: e
|
|
109
|
+
}, e))
|
|
110
|
+
}), /* @__PURE__ */ p("div", {
|
|
111
|
+
className: "grid grid-cols-7",
|
|
112
|
+
children: R.map((e) => {
|
|
113
|
+
let t = y(e), n = e.getUTCMonth() === E.getUTCMonth(), r = t === z, i = L.get(t) ?? [];
|
|
114
|
+
return /* @__PURE__ */ m("div", {
|
|
115
|
+
className: `min-h-24 border-b border-r border-border-subtle p-1.5 text-xs ${n ? "" : "bg-bg-sunken/40 text-text-tertiary"}`,
|
|
116
|
+
children: [/* @__PURE__ */ p("div", {
|
|
117
|
+
className: `mb-1 flex h-5 w-5 items-center justify-center rounded-full text-xs ${r ? "bg-action-primary-bg font-semibold text-action-primary-fg" : "text-text-secondary"}`,
|
|
118
|
+
children: e.getUTCDate()
|
|
119
|
+
}), /* @__PURE__ */ m("div", {
|
|
120
|
+
className: "space-y-1",
|
|
121
|
+
children: [i.slice(0, 3).map((e) => /* @__PURE__ */ m("div", {
|
|
122
|
+
className: `truncate rounded px-1.5 py-0.5 ${b[e.status] ?? b.NOT_APPLICABLE}`,
|
|
123
|
+
title: `${e.tagNumber} ${a[e.produceType]}`,
|
|
124
|
+
children: [
|
|
125
|
+
e.tagNumber,
|
|
126
|
+
" ",
|
|
127
|
+
a[e.produceType].toLowerCase()
|
|
128
|
+
]
|
|
129
|
+
}, `${e.treatmentId}-${e.produceType}`)), i.length > 3 ? /* @__PURE__ */ m("div", {
|
|
130
|
+
className: "px-1.5 text-text-tertiary",
|
|
131
|
+
children: ["+", i.length - 3]
|
|
132
|
+
}) : null]
|
|
133
|
+
})]
|
|
134
|
+
}, t);
|
|
135
|
+
})
|
|
136
|
+
})]
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ p("div", {
|
|
139
|
+
className: "mt-3 flex flex-wrap gap-4 text-xs text-text-secondary",
|
|
140
|
+
children: [
|
|
141
|
+
["BLOCKED", S("healthybowl.withdrawal.calendar.legend.blocked", "blocked")],
|
|
142
|
+
["UNDER_WITHDRAWAL", S("healthybowl.withdrawal.calendar.legend.under", "under withdrawal")],
|
|
143
|
+
["CLEARED", S("healthybowl.withdrawal.calendar.legend.cleared", "cleared")]
|
|
144
|
+
].map(([e, t]) => /* @__PURE__ */ m("span", {
|
|
145
|
+
className: "inline-flex items-center gap-1.5",
|
|
146
|
+
children: [/* @__PURE__ */ p("span", { className: `h-2.5 w-2.5 rounded-full ${x[e]}` }), t]
|
|
147
|
+
}, e))
|
|
148
|
+
})
|
|
149
|
+
]
|
|
150
|
+
}), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h2", {
|
|
151
|
+
className: "mb-3 text-lg font-semibold text-text-primary",
|
|
152
|
+
children: S("healthybowl.withdrawal.calendar.clearingSoon", "Clearing Soon")
|
|
153
|
+
}), /* @__PURE__ */ p("div", {
|
|
154
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
155
|
+
children: B.length === 0 ? /* @__PURE__ */ p("p", {
|
|
156
|
+
className: "text-sm text-text-secondary",
|
|
157
|
+
children: S("healthybowl.withdrawal.calendar.clearingEmpty", "No upcoming clear dates.")
|
|
158
|
+
}) : /* @__PURE__ */ p("ol", {
|
|
159
|
+
className: "space-y-3",
|
|
160
|
+
children: B.map((e) => /* @__PURE__ */ m("li", {
|
|
161
|
+
className: "flex items-start gap-3 text-sm",
|
|
162
|
+
children: [/* @__PURE__ */ p("span", { className: `mt-1.5 h-2 w-2 shrink-0 rounded-full ${x[e.status] ?? x.NOT_APPLICABLE}` }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("div", {
|
|
163
|
+
className: "font-medium text-text-primary",
|
|
164
|
+
children: [
|
|
165
|
+
e.tagNumber,
|
|
166
|
+
" · ",
|
|
167
|
+
a[e.produceType].toLowerCase()
|
|
168
|
+
]
|
|
169
|
+
}), /* @__PURE__ */ p("div", {
|
|
170
|
+
className: "text-text-secondary",
|
|
171
|
+
children: o(e.date)
|
|
172
|
+
})] })]
|
|
173
|
+
}, `${e.treatmentId}-${e.produceType}`))
|
|
174
|
+
})
|
|
175
|
+
})] })]
|
|
176
|
+
})]
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
//#endregion
|
|
180
|
+
export { S as WithdrawalCalendarPage };
|
|
181
|
+
|
|
182
|
+
//# sourceMappingURL=WithdrawalCalendarPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WithdrawalCalendarPage.js","names":[],"sources":["../../../../src/healthybowl/pages/livestock/WithdrawalCalendarPage.tsx"],"sourcesContent":["/**\n * Withdrawal Clear-Date Calendar — when animals clear their medication withdrawal.\n * Roadmap 13 · BOFF-2885 (mock view 6). Real clear dates from the backend; colour-coded by\n * status (red = blocked, amber = under withdrawal, green = cleared).\n */\nimport { useMemo, useState } from 'react';\nimport { useQuery } from '@apollo/client/react';\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { PageLayout, ErrorState, PageLoader } from '../../components';\nimport {\n useHealthyBowlWithdrawal,\n GET_CALENDAR,\n type WithdrawalCalendarData,\n type WithdrawalCalendarEntry,\n} from '../../hooks/useHealthyBowlWithdrawal';\nimport { WithdrawalNav } from './withdrawal/WithdrawalNav';\nimport { PRODUCE_LABEL, formatClearDate } from './withdrawal/status';\n\nconst DAY_MS = 86_400_000;\nconst WEEKDAYS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n\nconst iso = (d: Date) => d.toISOString().slice(0, 10);\n\nconst STATUS_CHIP: Record<string, string> = {\n BLOCKED: 'bg-status-error-bg text-status-error-text',\n UNDER_WITHDRAWAL: 'bg-status-warning-bgSubtle text-status-warning-text',\n CLEARED: 'bg-status-success-bgSubtle text-status-success-text',\n NOT_APPLICABLE: 'bg-bg-sunken text-text-secondary',\n};\nconst STATUS_DOT: Record<string, string> = {\n BLOCKED: 'bg-status-error-text',\n UNDER_WITHDRAWAL: 'bg-status-warning-text',\n CLEARED: 'bg-status-success-text',\n NOT_APPLICABLE: 'bg-text-tertiary',\n};\n\nexport const WithdrawalCalendarPage = () => {\n const { t } = useI18n();\n const { context } = useHealthyBowlWithdrawal({ skipLibrary: true });\n\n const [monthOffset, setMonthOffset] = useState(0);\n\n // Anchor month (offset from the current month). Built without Date.now-in-render concerns:\n // the initial `new Date()` is fine in a component body.\n const anchor = useMemo(() => {\n const now = new Date();\n return new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth() + monthOffset, 1));\n }, [monthOffset]);\n\n const monthStart = anchor;\n const monthEnd = new Date(Date.UTC(anchor.getUTCFullYear(), anchor.getUTCMonth() + 1, 0));\n // Grid spans the full weeks around the month.\n const gridStart = new Date(monthStart.getTime() - monthStart.getUTCDay() * DAY_MS);\n const from = new Date(gridStart.getTime() - DAY_MS);\n const to = new Date(monthEnd.getTime() + 14 * DAY_MS);\n\n const { data, loading, error, refetch } = useQuery<\n WithdrawalCalendarData,\n { context: { workspaceId: string }; from: string; to: string }\n >(GET_CALENDAR, { variables: { context, from: iso(from), to: iso(to) }, fetchPolicy: 'cache-and-network' });\n\n const entries = data?.getHealthyBowlWithdrawalCalendar ?? [];\n\n const byDate = useMemo(() => {\n const map = new Map<string, WithdrawalCalendarEntry[]>();\n for (const e of entries) {\n const list = map.get(e.date) ?? [];\n list.push(e);\n map.set(e.date, list);\n }\n return map;\n }, [entries]);\n\n // 6 weeks × 7 days grid.\n const cells = useMemo(() => {\n const out: Date[] = [];\n for (let i = 0; i < 42; i++) out.push(new Date(gridStart.getTime() + i * DAY_MS));\n return out;\n }, [gridStart]);\n\n const todayIso = iso(new Date());\n\n const clearingSoon = useMemo(() => {\n const future = entries.filter((e) => e.date >= todayIso).sort((a, b) => a.date.localeCompare(b.date));\n return future.slice(0, 8);\n }, [entries, todayIso]);\n\n const monthLabel = anchor.toLocaleDateString('en-GB', { month: 'long', year: 'numeric', timeZone: 'UTC' });\n\n if (loading && entries.length === 0) return <PageLoader />;\n\n return (\n <PageLayout\n title={t('healthybowl.withdrawal.calendar.title', 'Withdrawal Clear-Date Calendar')}\n description={t(\n 'healthybowl.withdrawal.calendar.description',\n 'Upcoming dates when animals clear their medication withdrawal and produce becomes safe to sell.'\n )}\n >\n <WithdrawalNav />\n\n {error && entries.length === 0 ? (\n <ErrorState description={error.message} onRetry={() => void refetch()} />\n ) : (\n <div className=\"mt-4 grid grid-cols-1 gap-6 lg:grid-cols-3\">\n <div className=\"lg:col-span-2\">\n <div className=\"mb-3 flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold text-text-primary\">{monthLabel}</h2>\n <div className=\"flex gap-1\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => setMonthOffset((m) => m - 1)}\n aria-label=\"Previous month\"\n >\n <ChevronLeft className=\"h-4 w-4\" />\n </Button>\n <Button variant=\"outline\" size=\"sm\" onClick={() => setMonthOffset(0)}>\n {t('healthybowl.withdrawal.calendar.today', 'Today')}\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => setMonthOffset((m) => m + 1)}\n aria-label=\"Next month\"\n >\n <ChevronRight className=\"h-4 w-4\" />\n </Button>\n </div>\n </div>\n\n <div className=\"overflow-hidden rounded-lg border border-border-subtle bg-bg-surface\">\n <div className=\"grid grid-cols-7 border-b border-border-subtle bg-bg-sunken text-center text-xs font-medium text-text-secondary\">\n {WEEKDAYS.map((w) => (\n <div key={w} className=\"py-2\">\n {w}\n </div>\n ))}\n </div>\n <div className=\"grid grid-cols-7\">\n {cells.map((cell) => {\n const key = iso(cell);\n const inMonth = cell.getUTCMonth() === anchor.getUTCMonth();\n const isToday = key === todayIso;\n const dayEntries = byDate.get(key) ?? [];\n return (\n <div\n key={key}\n className={`min-h-24 border-b border-r border-border-subtle p-1.5 text-xs ${inMonth ? '' : 'bg-bg-sunken/40 text-text-tertiary'}`}\n >\n <div\n className={`mb-1 flex h-5 w-5 items-center justify-center rounded-full text-xs ${isToday ? 'bg-action-primary-bg font-semibold text-action-primary-fg' : 'text-text-secondary'}`}\n >\n {cell.getUTCDate()}\n </div>\n <div className=\"space-y-1\">\n {dayEntries.slice(0, 3).map((e) => (\n <div\n key={`${e.treatmentId}-${e.produceType}`}\n className={`truncate rounded px-1.5 py-0.5 ${STATUS_CHIP[e.status] ?? STATUS_CHIP.NOT_APPLICABLE}`}\n title={`${e.tagNumber} ${PRODUCE_LABEL[e.produceType]}`}\n >\n {e.tagNumber} {PRODUCE_LABEL[e.produceType].toLowerCase()}\n </div>\n ))}\n {dayEntries.length > 3 ? (\n <div className=\"px-1.5 text-text-tertiary\">+{dayEntries.length - 3}</div>\n ) : null}\n </div>\n </div>\n );\n })}\n </div>\n </div>\n\n {/* Legend */}\n <div className=\"mt-3 flex flex-wrap gap-4 text-xs text-text-secondary\">\n {(\n [\n ['BLOCKED', t('healthybowl.withdrawal.calendar.legend.blocked', 'blocked')],\n ['UNDER_WITHDRAWAL', t('healthybowl.withdrawal.calendar.legend.under', 'under withdrawal')],\n ['CLEARED', t('healthybowl.withdrawal.calendar.legend.cleared', 'cleared')],\n ] as const\n ).map(([s, lbl]) => (\n <span key={s} className=\"inline-flex items-center gap-1.5\">\n <span className={`h-2.5 w-2.5 rounded-full ${STATUS_DOT[s]}`} />\n {lbl}\n </span>\n ))}\n </div>\n </div>\n\n {/* Clearing soon */}\n <div>\n <h2 className=\"mb-3 text-lg font-semibold text-text-primary\">\n {t('healthybowl.withdrawal.calendar.clearingSoon', 'Clearing Soon')}\n </h2>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n {clearingSoon.length === 0 ? (\n <p className=\"text-sm text-text-secondary\">\n {t('healthybowl.withdrawal.calendar.clearingEmpty', 'No upcoming clear dates.')}\n </p>\n ) : (\n <ol className=\"space-y-3\">\n {clearingSoon.map((e) => (\n <li key={`${e.treatmentId}-${e.produceType}`} className=\"flex items-start gap-3 text-sm\">\n <span\n className={`mt-1.5 h-2 w-2 shrink-0 rounded-full ${STATUS_DOT[e.status] ?? STATUS_DOT.NOT_APPLICABLE}`}\n />\n <div>\n <div className=\"font-medium text-text-primary\">\n {e.tagNumber} · {PRODUCE_LABEL[e.produceType].toLowerCase()}\n </div>\n <div className=\"text-text-secondary\">{formatClearDate(e.date)}</div>\n </div>\n </li>\n ))}\n </ol>\n )}\n </div>\n </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