@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.
Files changed (23) hide show
  1. package/dist/healthybowl/HealthyBowlRoot.js +93 -85
  2. package/dist/healthybowl/HealthyBowlRoot.js.map +1 -1
  3. package/dist/healthybowl/HealthyBowlRoutes.js +98 -86
  4. package/dist/healthybowl/HealthyBowlRoutes.js.map +1 -1
  5. package/dist/healthybowl/hooks/useHealthyBowlWithdrawal.js +237 -0
  6. package/dist/healthybowl/hooks/useHealthyBowlWithdrawal.js.map +1 -0
  7. package/dist/healthybowl/pages/livestock/AnimalDetailsPage.js +532 -527
  8. package/dist/healthybowl/pages/livestock/AnimalDetailsPage.js.map +1 -1
  9. package/dist/healthybowl/pages/livestock/MedicationLibraryPage.js +387 -0
  10. package/dist/healthybowl/pages/livestock/MedicationLibraryPage.js.map +1 -0
  11. package/dist/healthybowl/pages/livestock/WithdrawalAlertsPage.js +286 -0
  12. package/dist/healthybowl/pages/livestock/WithdrawalAlertsPage.js.map +1 -0
  13. package/dist/healthybowl/pages/livestock/WithdrawalCalendarPage.js +182 -0
  14. package/dist/healthybowl/pages/livestock/WithdrawalCalendarPage.js.map +1 -0
  15. package/dist/healthybowl/pages/livestock/withdrawal/AnimalWithdrawalCard.js +166 -0
  16. package/dist/healthybowl/pages/livestock/withdrawal/AnimalWithdrawalCard.js.map +1 -0
  17. package/dist/healthybowl/pages/livestock/withdrawal/LogTreatmentModal.js +274 -0
  18. package/dist/healthybowl/pages/livestock/withdrawal/LogTreatmentModal.js.map +1 -0
  19. package/dist/healthybowl/pages/livestock/withdrawal/WithdrawalNav.js +40 -0
  20. package/dist/healthybowl/pages/livestock/withdrawal/WithdrawalNav.js.map +1 -0
  21. package/dist/healthybowl/pages/livestock/withdrawal/status.js +53 -0
  22. package/dist/healthybowl/pages/livestock/withdrawal/status.js.map +1 -0
  23. package/package.json +1 -1
@@ -0,0 +1,387 @@
1
+ import { PageLayout as e } from "../../components/PageLayout.js";
2
+ import { DataTable as t } from "../../components/DataTable.js";
3
+ import { StatusBadge as n } from "../../components/StatusBadge.js";
4
+ import { ErrorState as r } from "../../components/ErrorState.js";
5
+ import { ToastContainer as i } from "../../components/Toast.js";
6
+ import { useConfirm as a } from "../../components/ConfirmDialog.js";
7
+ import { PageLoader as o } from "../../components/PageLoader.js";
8
+ import { Modal as s } from "../../components/Modal.js";
9
+ import { useToast as c } from "../../hooks/useToast.js";
10
+ import "../../components/index.js";
11
+ import { useHealthyBowlWithdrawal as l } from "../../hooks/useHealthyBowlWithdrawal.js";
12
+ import { WithdrawalNav as u } from "./withdrawal/WithdrawalNav.js";
13
+ import { useMemo as d, useState as f } from "react";
14
+ import { useI18n as p } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
15
+ import { Pencil as m, Plus as h, Trash2 as g } from "lucide-react";
16
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
17
+ import { Button as b, Input as x, Select as S, SelectContent as C, SelectItem as w, SelectTrigger as T, SelectValue as E } from "@burdenoff/fe-libs/ui";
18
+ //#region src/healthybowl/pages/livestock/MedicationLibraryPage.tsx
19
+ var D = [
20
+ "Antibiotic",
21
+ "Dewormer",
22
+ "Antiparasitic",
23
+ "NSAID",
24
+ "Hormone",
25
+ "Vaccine",
26
+ "Other"
27
+ ], ee = [
28
+ "IM",
29
+ "IV",
30
+ "IM/IV",
31
+ "SC",
32
+ "Oral",
33
+ "Intramammary",
34
+ "Topical",
35
+ "Other"
36
+ ], O = [
37
+ "CATTLE",
38
+ "BUFFALO",
39
+ "GOAT",
40
+ "SHEEP",
41
+ "PIG",
42
+ "POULTRY"
43
+ ];
44
+ function k({ days: e }) {
45
+ return e === null ? /* @__PURE__ */ v("span", {
46
+ className: "text-text-tertiary",
47
+ children: "—"
48
+ }) : /* @__PURE__ */ v("span", {
49
+ className: `inline-block min-w-7 rounded-md px-2 py-0.5 text-center text-sm font-medium tabular-nums ${e <= 5 ? "bg-status-success-bgSubtle text-status-success-text" : e <= 20 ? "bg-status-warning-bgSubtle text-status-warning-text" : "bg-status-error-bg text-status-error-text"}`,
50
+ children: e
51
+ });
52
+ }
53
+ var A = () => ({
54
+ id: null,
55
+ name: "",
56
+ className: "Antibiotic",
57
+ route: "IM",
58
+ milk: "",
59
+ meat: "",
60
+ eggs: "",
61
+ species: [],
62
+ builtin: !1
63
+ }), j = () => {
64
+ let { t: j } = p(), { toasts: M, toast: N, dismiss: P } = c(), F = a(), { library: I, loading: L, errors: R, createMedication: z, updateMedication: B, deleteMedication: V, refetchLibrary: H } = l(), [U, W] = f(""), [G, K] = f("all"), [q, J] = f(null), [Y, X] = f(!1), Z = d(() => {
65
+ let e = U.trim().toLowerCase();
66
+ return I.filter((t) => !(e && !t.name.toLowerCase().includes(e) && !t.className.toLowerCase().includes(e) || G !== "all" && t.species.length > 0 && !t.species.includes(G)));
67
+ }, [
68
+ I,
69
+ U,
70
+ G
71
+ ]), Q = () => J(A()), te = (e) => J({
72
+ id: e.id,
73
+ name: e.name,
74
+ className: e.className,
75
+ route: e.route,
76
+ milk: e.milkWithdrawalDays === null ? "" : String(e.milkWithdrawalDays),
77
+ meat: e.meatWithdrawalDays === null ? "" : String(e.meatWithdrawalDays),
78
+ eggs: e.eggsWithdrawalDays === null ? "" : String(e.eggsWithdrawalDays),
79
+ species: e.species,
80
+ builtin: e.builtin
81
+ }), $ = (e) => {
82
+ let t = e.trim();
83
+ if (t === "") return null;
84
+ let n = Number(t);
85
+ return Number.isFinite(n) && n >= 0 ? Math.round(n) : null;
86
+ }, ne = async () => {
87
+ if (q) {
88
+ if (!q.name.trim()) {
89
+ N({
90
+ title: j("healthybowl.withdrawal.library.nameRequired", "A medication name is required"),
91
+ variant: "warning"
92
+ });
93
+ return;
94
+ }
95
+ X(!0);
96
+ try {
97
+ let e = {
98
+ className: q.className,
99
+ route: q.route,
100
+ milkWithdrawalDays: $(q.milk),
101
+ meatWithdrawalDays: $(q.meat),
102
+ eggsWithdrawalDays: $(q.eggs),
103
+ species: q.species
104
+ };
105
+ q.id ? (await B({
106
+ id: q.id,
107
+ ...e
108
+ }), N({
109
+ title: j("healthybowl.withdrawal.library.updated", "Medication updated"),
110
+ variant: "success"
111
+ })) : (await z({
112
+ name: q.name.trim(),
113
+ ...e
114
+ }), N({
115
+ title: j("healthybowl.withdrawal.library.added", "Medication added"),
116
+ variant: "success"
117
+ })), J(null);
118
+ } catch (e) {
119
+ N({
120
+ title: j("healthybowl.withdrawal.library.saveFailed", "Could not save the medication"),
121
+ description: e instanceof Error ? e.message : String(e),
122
+ variant: "error"
123
+ });
124
+ } finally {
125
+ X(!1);
126
+ }
127
+ }
128
+ }, re = async (e) => {
129
+ if (await F({
130
+ title: j("healthybowl.withdrawal.library.deleteTitle", "Delete medication?"),
131
+ message: j("healthybowl.withdrawal.library.deleteDesc", "This removes \"{{name}}\" from your library. Standard built-ins revert to their default periods.", { name: e.name }),
132
+ okButtonTitle: j("healthybowl.common.delete", "Delete"),
133
+ destructive: !0
134
+ })) try {
135
+ await V(e.id), N({
136
+ title: j("healthybowl.withdrawal.library.deleted", "Medication deleted"),
137
+ variant: "success"
138
+ });
139
+ } catch (e) {
140
+ N({
141
+ title: j("healthybowl.withdrawal.library.deleteFailed", "Could not delete"),
142
+ description: e instanceof Error ? e.message : String(e),
143
+ variant: "error"
144
+ });
145
+ }
146
+ }, ie = (e) => J((t) => t && {
147
+ ...t,
148
+ species: t.species.includes(e) ? t.species.filter((t) => t !== e) : [...t.species, e]
149
+ }), ae = [
150
+ {
151
+ key: "name",
152
+ header: j("healthybowl.withdrawal.library.col.medication", "Medication"),
153
+ render: (e) => /* @__PURE__ */ v("span", {
154
+ className: "font-medium text-text-primary",
155
+ children: e.name
156
+ })
157
+ },
158
+ {
159
+ key: "class",
160
+ header: j("healthybowl.withdrawal.library.col.class", "Class"),
161
+ render: (e) => e.className
162
+ },
163
+ {
164
+ key: "route",
165
+ header: j("healthybowl.withdrawal.library.col.route", "Route"),
166
+ render: (e) => e.route
167
+ },
168
+ {
169
+ key: "milk",
170
+ header: j("healthybowl.withdrawal.library.col.milk", "Milk (d)"),
171
+ render: (e) => /* @__PURE__ */ v(k, { days: e.milkWithdrawalDays })
172
+ },
173
+ {
174
+ key: "meat",
175
+ header: j("healthybowl.withdrawal.library.col.meat", "Meat (d)"),
176
+ render: (e) => /* @__PURE__ */ v(k, { days: e.meatWithdrawalDays })
177
+ },
178
+ {
179
+ key: "eggs",
180
+ header: j("healthybowl.withdrawal.library.col.eggs", "Eggs (d)"),
181
+ render: (e) => /* @__PURE__ */ v(k, { days: e.eggsWithdrawalDays })
182
+ },
183
+ {
184
+ key: "source",
185
+ header: j("healthybowl.withdrawal.library.col.source", "Source"),
186
+ render: (e) => /* @__PURE__ */ v(n, {
187
+ variant: e.source === "STANDARD" ? "info" : "success",
188
+ label: e.source === "STANDARD" ? "Standard" : "Custom"
189
+ })
190
+ },
191
+ {
192
+ key: "actions",
193
+ header: j("healthybowl.withdrawal.library.col.actions", "Actions"),
194
+ render: (e) => /* @__PURE__ */ y("div", {
195
+ className: "flex items-center gap-1",
196
+ children: [/* @__PURE__ */ v(b, {
197
+ variant: "ghost",
198
+ size: "sm",
199
+ onClick: () => te(e),
200
+ "aria-label": "Edit",
201
+ children: /* @__PURE__ */ v(m, { className: "h-4 w-4" })
202
+ }), e.builtin ? null : /* @__PURE__ */ v(b, {
203
+ variant: "ghost",
204
+ size: "sm",
205
+ onClick: () => void re(e),
206
+ "aria-label": "Delete",
207
+ className: "text-status-error-text",
208
+ children: /* @__PURE__ */ v(g, { className: "h-4 w-4" })
209
+ })]
210
+ })
211
+ }
212
+ ];
213
+ return L.library && I.length === 0 ? /* @__PURE__ */ v(o, {}) : /* @__PURE__ */ y(e, {
214
+ title: j("healthybowl.withdrawal.library.title", "Medication Library — Standard Withdrawal Periods"),
215
+ description: j("healthybowl.withdrawal.library.description", "Standard veterinary withdrawal days used to auto-fill treatment logs. Farmers can override per treatment."),
216
+ actions: /* @__PURE__ */ y(b, {
217
+ onClick: Q,
218
+ children: [/* @__PURE__ */ v(h, { className: "h-4 w-4" }), j("healthybowl.withdrawal.library.add", "Add Medication")]
219
+ }),
220
+ children: [
221
+ /* @__PURE__ */ v(u, {}),
222
+ R.library && I.length === 0 ? /* @__PURE__ */ v(r, {
223
+ description: R.library.message,
224
+ onRetry: () => void H()
225
+ }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ y("div", {
226
+ className: "mt-4 flex flex-col gap-3 sm:flex-row sm:items-center",
227
+ children: [/* @__PURE__ */ v(x, {
228
+ className: "sm:max-w-xs",
229
+ value: U,
230
+ onChange: (e) => W(e.target.value),
231
+ placeholder: j("healthybowl.withdrawal.library.search", "Search medicines…")
232
+ }), /* @__PURE__ */ y(S, {
233
+ value: G,
234
+ onValueChange: K,
235
+ children: [/* @__PURE__ */ v(T, {
236
+ className: "sm:w-48",
237
+ children: /* @__PURE__ */ v(E, {})
238
+ }), /* @__PURE__ */ y(C, { children: [/* @__PURE__ */ v(w, {
239
+ value: "all",
240
+ children: j("healthybowl.withdrawal.library.allSpecies", "All species")
241
+ }), O.map((e) => /* @__PURE__ */ v(w, {
242
+ value: e,
243
+ className: "capitalize",
244
+ children: e.toLowerCase()
245
+ }, e))] })]
246
+ })]
247
+ }), /* @__PURE__ */ v("div", {
248
+ className: "mt-4",
249
+ children: /* @__PURE__ */ v(t, {
250
+ columns: ae,
251
+ data: Z,
252
+ keyField: "id",
253
+ emptyMessage: j("healthybowl.withdrawal.library.empty", "No medications match."),
254
+ pageSize: 12
255
+ })
256
+ })] }),
257
+ /* @__PURE__ */ v(s, {
258
+ open: q !== null,
259
+ onClose: () => J(null),
260
+ title: q?.id ? j("healthybowl.withdrawal.library.editTitle", "Edit medication") : j("healthybowl.withdrawal.library.addTitle", "Add medication"),
261
+ size: "md",
262
+ footer: /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(b, {
263
+ variant: "outline",
264
+ onClick: () => J(null),
265
+ disabled: Y,
266
+ children: j("healthybowl.common.cancel", "Cancel")
267
+ }), /* @__PURE__ */ v(b, {
268
+ onClick: ne,
269
+ disabled: Y,
270
+ children: Y ? j("healthybowl.common.saving", "Saving…") : j("healthybowl.common.save", "Save")
271
+ })] }),
272
+ children: q ? /* @__PURE__ */ y("div", {
273
+ className: "space-y-4",
274
+ children: [
275
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
276
+ className: "mb-1 block text-sm font-medium text-text-primary",
277
+ children: j("healthybowl.withdrawal.library.name", "Name")
278
+ }), /* @__PURE__ */ v(x, {
279
+ value: q.name,
280
+ disabled: !!q.id,
281
+ onChange: (e) => J({
282
+ ...q,
283
+ name: e.target.value
284
+ }),
285
+ placeholder: "Oxytetracycline"
286
+ })] }),
287
+ /* @__PURE__ */ y("div", {
288
+ className: "grid grid-cols-2 gap-3",
289
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
290
+ className: "mb-1 block text-sm font-medium text-text-primary",
291
+ children: j("healthybowl.withdrawal.library.class", "Class")
292
+ }), /* @__PURE__ */ y(S, {
293
+ value: q.className,
294
+ onValueChange: (e) => J({
295
+ ...q,
296
+ className: e
297
+ }),
298
+ children: [/* @__PURE__ */ v(T, { children: /* @__PURE__ */ v(E, {}) }), /* @__PURE__ */ v(C, { children: D.map((e) => /* @__PURE__ */ v(w, {
299
+ value: e,
300
+ children: e
301
+ }, e)) })]
302
+ })] }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
303
+ className: "mb-1 block text-sm font-medium text-text-primary",
304
+ children: j("healthybowl.withdrawal.library.route", "Route")
305
+ }), /* @__PURE__ */ y(S, {
306
+ value: q.route,
307
+ onValueChange: (e) => J({
308
+ ...q,
309
+ route: e
310
+ }),
311
+ children: [/* @__PURE__ */ v(T, { children: /* @__PURE__ */ v(E, {}) }), /* @__PURE__ */ v(C, { children: ee.map((e) => /* @__PURE__ */ v(w, {
312
+ value: e,
313
+ children: e
314
+ }, e)) })]
315
+ })] })]
316
+ }),
317
+ /* @__PURE__ */ v("div", {
318
+ className: "grid grid-cols-3 gap-3",
319
+ children: [
320
+ [
321
+ "Milk",
322
+ q.milk,
323
+ (e) => J({
324
+ ...q,
325
+ milk: e
326
+ })
327
+ ],
328
+ [
329
+ "Meat",
330
+ q.meat,
331
+ (e) => J({
332
+ ...q,
333
+ meat: e
334
+ })
335
+ ],
336
+ [
337
+ "Eggs",
338
+ q.eggs,
339
+ (e) => J({
340
+ ...q,
341
+ eggs: e
342
+ })
343
+ ]
344
+ ].map(([e, t, n]) => /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
345
+ className: "mb-1 block text-xs text-text-secondary",
346
+ children: [e, " (days)"]
347
+ }), /* @__PURE__ */ v(x, {
348
+ type: "number",
349
+ min: 0,
350
+ value: t,
351
+ onChange: (e) => n(e.target.value),
352
+ placeholder: "—"
353
+ })] }, e))
354
+ }),
355
+ /* @__PURE__ */ y("div", { children: [
356
+ /* @__PURE__ */ v("label", {
357
+ className: "mb-1 block text-sm font-medium text-text-primary",
358
+ children: j("healthybowl.withdrawal.library.species", "Applicable species")
359
+ }),
360
+ /* @__PURE__ */ v("div", {
361
+ className: "flex flex-wrap gap-2",
362
+ children: O.map((e) => /* @__PURE__ */ v("button", {
363
+ type: "button",
364
+ onClick: () => ie(e),
365
+ className: `rounded-full border px-3 py-1 text-xs capitalize transition-colors ${q.species.includes(e) ? "border-border-default bg-bg-sunken font-medium text-text-primary" : "border-border-subtle text-text-secondary hover:text-text-primary"}`,
366
+ children: e.toLowerCase()
367
+ }, e))
368
+ }),
369
+ /* @__PURE__ */ v("p", {
370
+ className: "mt-1 text-xs text-text-tertiary",
371
+ children: j("healthybowl.withdrawal.library.speciesHint", "Leave empty to apply to all species.")
372
+ })
373
+ ] })
374
+ ]
375
+ }) : null
376
+ }),
377
+ /* @__PURE__ */ v(i, {
378
+ toasts: M,
379
+ onDismiss: P
380
+ })
381
+ ]
382
+ });
383
+ };
384
+ //#endregion
385
+ export { j as MedicationLibraryPage };
386
+
387
+ //# sourceMappingURL=MedicationLibraryPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MedicationLibraryPage.js","names":[],"sources":["../../../../src/healthybowl/pages/livestock/MedicationLibraryPage.tsx"],"sourcesContent":["/**\n * Medication Library — standard withdrawal periods used to auto-fill treatment logs.\n * Roadmap 13 · BOFF-2885 (mock view 5). Farmers can add custom medicines and override the\n * standard withdrawal days per produce. Built-ins come from the backend catalog; there is no\n * fabricated data.\n */\nimport { useMemo, useState } from 'react';\nimport { Pencil, Plus, Trash2 } from 'lucide-react';\nimport { Button, Input, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { PageLayout, DataTable, StatusBadge, ErrorState, PageLoader, Modal, useConfirm } from '../../components';\nimport type { Column } from '../../components';\nimport { ToastContainer } from '../../components/Toast';\nimport { useToast } from '../../hooks/useToast';\nimport { useHealthyBowlWithdrawal, type MedicationLibraryItem } from '../../hooks/useHealthyBowlWithdrawal';\nimport { WithdrawalNav } from './withdrawal/WithdrawalNav';\n\nconst CLASSES = ['Antibiotic', 'Dewormer', 'Antiparasitic', 'NSAID', 'Hormone', 'Vaccine', 'Other'];\nconst ROUTES = ['IM', 'IV', 'IM/IV', 'SC', 'Oral', 'Intramammary', 'Topical', 'Other'];\nconst SPECIES = ['CATTLE', 'BUFFALO', 'GOAT', 'SHEEP', 'PIG', 'POULTRY'];\n\n/** A day cell: em-dash when N/A, else a magnitude-coloured chip (semantic tokens only). */\nfunction DayCell({ days }: { days: number | null }) {\n if (days === null) return <span className=\"text-text-tertiary\">—</span>;\n const tone =\n days <= 5\n ? 'bg-status-success-bgSubtle text-status-success-text'\n : days <= 20\n ? 'bg-status-warning-bgSubtle text-status-warning-text'\n : 'bg-status-error-bg text-status-error-text';\n return (\n <span\n className={`inline-block min-w-7 rounded-md px-2 py-0.5 text-center text-sm font-medium tabular-nums ${tone}`}\n >\n {days}\n </span>\n );\n}\n\ninterface EditState {\n id: string | null; // null = new\n name: string;\n className: string;\n route: string;\n milk: string;\n meat: string;\n eggs: string;\n species: string[];\n builtin: boolean;\n}\n\nconst emptyEdit = (): EditState => ({\n id: null,\n name: '',\n className: 'Antibiotic',\n route: 'IM',\n milk: '',\n meat: '',\n eggs: '',\n species: [],\n builtin: false,\n});\n\nexport const MedicationLibraryPage = () => {\n const { t } = useI18n();\n const { toasts, toast, dismiss } = useToast();\n const confirm = useConfirm();\n const { library, loading, errors, createMedication, updateMedication, deleteMedication, refetchLibrary } =\n useHealthyBowlWithdrawal();\n\n const [search, setSearch] = useState('');\n const [speciesFilter, setSpeciesFilter] = useState('all');\n const [edit, setEdit] = useState<EditState | null>(null);\n const [saving, setSaving] = useState(false);\n\n const filtered = useMemo(() => {\n const q = search.trim().toLowerCase();\n return library.filter((m) => {\n if (q && !m.name.toLowerCase().includes(q) && !m.className.toLowerCase().includes(q)) return false;\n if (speciesFilter !== 'all' && m.species.length > 0 && !m.species.includes(speciesFilter)) return false;\n return true;\n });\n }, [library, search, speciesFilter]);\n\n const openNew = () => setEdit(emptyEdit());\n const openEdit = (m: MedicationLibraryItem) =>\n setEdit({\n id: m.id,\n name: m.name,\n className: m.className,\n route: m.route,\n milk: m.milkWithdrawalDays === null ? '' : String(m.milkWithdrawalDays),\n meat: m.meatWithdrawalDays === null ? '' : String(m.meatWithdrawalDays),\n eggs: m.eggsWithdrawalDays === null ? '' : String(m.eggsWithdrawalDays),\n species: m.species,\n builtin: m.builtin,\n });\n\n const parseDays = (v: string): number | null => {\n const s = v.trim();\n if (s === '') return null;\n const n = Number(s);\n return Number.isFinite(n) && n >= 0 ? Math.round(n) : null;\n };\n\n const saveEdit = async () => {\n if (!edit) return;\n if (!edit.name.trim()) {\n toast({\n title: t('healthybowl.withdrawal.library.nameRequired', 'A medication name is required'),\n variant: 'warning',\n });\n return;\n }\n setSaving(true);\n try {\n const payload = {\n className: edit.className,\n route: edit.route,\n milkWithdrawalDays: parseDays(edit.milk),\n meatWithdrawalDays: parseDays(edit.meat),\n eggsWithdrawalDays: parseDays(edit.eggs),\n species: edit.species,\n };\n if (edit.id) {\n await updateMedication({ id: edit.id, ...payload });\n toast({ title: t('healthybowl.withdrawal.library.updated', 'Medication updated'), variant: 'success' });\n } else {\n await createMedication({ name: edit.name.trim(), ...payload });\n toast({ title: t('healthybowl.withdrawal.library.added', 'Medication added'), variant: 'success' });\n }\n setEdit(null);\n } catch (err) {\n toast({\n title: t('healthybowl.withdrawal.library.saveFailed', 'Could not save the medication'),\n description: err instanceof Error ? err.message : String(err),\n variant: 'error',\n });\n } finally {\n setSaving(false);\n }\n };\n\n const handleDelete = async (m: MedicationLibraryItem) => {\n const ok = await confirm({\n title: t('healthybowl.withdrawal.library.deleteTitle', 'Delete medication?'),\n message: t(\n 'healthybowl.withdrawal.library.deleteDesc',\n 'This removes \"{{name}}\" from your library. Standard built-ins revert to their default periods.',\n { name: m.name }\n ),\n okButtonTitle: t('healthybowl.common.delete', 'Delete'),\n destructive: true,\n });\n if (!ok) return;\n try {\n await deleteMedication(m.id);\n toast({ title: t('healthybowl.withdrawal.library.deleted', 'Medication deleted'), variant: 'success' });\n } catch (err) {\n toast({\n title: t('healthybowl.withdrawal.library.deleteFailed', 'Could not delete'),\n description: err instanceof Error ? err.message : String(err),\n variant: 'error',\n });\n }\n };\n\n const toggleSpecies = (sp: string) =>\n setEdit((prev) =>\n prev\n ? { ...prev, species: prev.species.includes(sp) ? prev.species.filter((s) => s !== sp) : [...prev.species, sp] }\n : prev\n );\n\n const columns: Column<MedicationLibraryItem>[] = [\n {\n key: 'name',\n header: t('healthybowl.withdrawal.library.col.medication', 'Medication'),\n render: (m) => <span className=\"font-medium text-text-primary\">{m.name}</span>,\n },\n { key: 'class', header: t('healthybowl.withdrawal.library.col.class', 'Class'), render: (m) => m.className },\n { key: 'route', header: t('healthybowl.withdrawal.library.col.route', 'Route'), render: (m) => m.route },\n {\n key: 'milk',\n header: t('healthybowl.withdrawal.library.col.milk', 'Milk (d)'),\n render: (m) => <DayCell days={m.milkWithdrawalDays} />,\n },\n {\n key: 'meat',\n header: t('healthybowl.withdrawal.library.col.meat', 'Meat (d)'),\n render: (m) => <DayCell days={m.meatWithdrawalDays} />,\n },\n {\n key: 'eggs',\n header: t('healthybowl.withdrawal.library.col.eggs', 'Eggs (d)'),\n render: (m) => <DayCell days={m.eggsWithdrawalDays} />,\n },\n {\n key: 'source',\n header: t('healthybowl.withdrawal.library.col.source', 'Source'),\n render: (m) => (\n <StatusBadge\n variant={m.source === 'STANDARD' ? 'info' : 'success'}\n label={m.source === 'STANDARD' ? 'Standard' : 'Custom'}\n />\n ),\n },\n {\n key: 'actions',\n header: t('healthybowl.withdrawal.library.col.actions', 'Actions'),\n render: (m) => (\n <div className=\"flex items-center gap-1\">\n <Button variant=\"ghost\" size=\"sm\" onClick={() => openEdit(m)} aria-label=\"Edit\">\n <Pencil className=\"h-4 w-4\" />\n </Button>\n {!m.builtin ? (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => void handleDelete(m)}\n aria-label=\"Delete\"\n className=\"text-status-error-text\"\n >\n <Trash2 className=\"h-4 w-4\" />\n </Button>\n ) : null}\n </div>\n ),\n },\n ];\n\n if (loading.library && library.length === 0) return <PageLoader />;\n\n return (\n <PageLayout\n title={t('healthybowl.withdrawal.library.title', 'Medication Library — Standard Withdrawal Periods')}\n description={t(\n 'healthybowl.withdrawal.library.description',\n 'Standard veterinary withdrawal days used to auto-fill treatment logs. Farmers can override per treatment.'\n )}\n actions={\n <Button onClick={openNew}>\n <Plus className=\"h-4 w-4\" />\n {t('healthybowl.withdrawal.library.add', 'Add Medication')}\n </Button>\n }\n >\n <WithdrawalNav />\n\n {errors.library && library.length === 0 ? (\n <ErrorState description={errors.library.message} onRetry={() => void refetchLibrary()} />\n ) : (\n <>\n <div className=\"mt-4 flex flex-col gap-3 sm:flex-row sm:items-center\">\n <Input\n className=\"sm:max-w-xs\"\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n placeholder={t('healthybowl.withdrawal.library.search', 'Search medicines…')}\n />\n <Select value={speciesFilter} onValueChange={setSpeciesFilter}>\n <SelectTrigger className=\"sm:w-48\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"all\">{t('healthybowl.withdrawal.library.allSpecies', 'All species')}</SelectItem>\n {SPECIES.map((s) => (\n <SelectItem key={s} value={s} className=\"capitalize\">\n {s.toLowerCase()}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n\n <div className=\"mt-4\">\n <DataTable\n columns={columns}\n data={filtered}\n keyField=\"id\"\n emptyMessage={t('healthybowl.withdrawal.library.empty', 'No medications match.')}\n pageSize={12}\n />\n </div>\n </>\n )}\n\n <Modal\n open={edit !== null}\n onClose={() => setEdit(null)}\n title={\n edit?.id\n ? t('healthybowl.withdrawal.library.editTitle', 'Edit medication')\n : t('healthybowl.withdrawal.library.addTitle', 'Add medication')\n }\n size=\"md\"\n footer={\n <>\n <Button variant=\"outline\" onClick={() => setEdit(null)} disabled={saving}>\n {t('healthybowl.common.cancel', 'Cancel')}\n </Button>\n <Button onClick={saveEdit} disabled={saving}>\n {saving ? t('healthybowl.common.saving', 'Saving…') : t('healthybowl.common.save', 'Save')}\n </Button>\n </>\n }\n >\n {edit ? (\n <div className=\"space-y-4\">\n <div>\n <label className=\"mb-1 block text-sm font-medium text-text-primary\">\n {t('healthybowl.withdrawal.library.name', 'Name')}\n </label>\n <Input\n value={edit.name}\n disabled={!!edit.id}\n onChange={(e) => setEdit({ ...edit, name: e.target.value })}\n placeholder=\"Oxytetracycline\"\n />\n </div>\n <div className=\"grid grid-cols-2 gap-3\">\n <div>\n <label className=\"mb-1 block text-sm font-medium text-text-primary\">\n {t('healthybowl.withdrawal.library.class', 'Class')}\n </label>\n <Select value={edit.className} onValueChange={(v) => setEdit({ ...edit, className: v })}>\n <SelectTrigger>\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {CLASSES.map((c) => (\n <SelectItem key={c} value={c}>\n {c}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div>\n <label className=\"mb-1 block text-sm font-medium text-text-primary\">\n {t('healthybowl.withdrawal.library.route', 'Route')}\n </label>\n <Select value={edit.route} onValueChange={(v) => setEdit({ ...edit, route: v })}>\n <SelectTrigger>\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {ROUTES.map((r) => (\n <SelectItem key={r} value={r}>\n {r}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n </div>\n <div className=\"grid grid-cols-3 gap-3\">\n {(\n [\n ['Milk', edit.milk, (v: string) => setEdit({ ...edit, milk: v })],\n ['Meat', edit.meat, (v: string) => setEdit({ ...edit, meat: v })],\n ['Eggs', edit.eggs, (v: string) => setEdit({ ...edit, eggs: v })],\n ] as const\n ).map(([lbl, val, setter]) => (\n <div key={lbl}>\n <label className=\"mb-1 block text-xs text-text-secondary\">{lbl} (days)</label>\n <Input type=\"number\" min={0} value={val} onChange={(e) => setter(e.target.value)} placeholder=\"—\" />\n </div>\n ))}\n </div>\n <div>\n <label className=\"mb-1 block text-sm font-medium text-text-primary\">\n {t('healthybowl.withdrawal.library.species', 'Applicable species')}\n </label>\n <div className=\"flex flex-wrap gap-2\">\n {SPECIES.map((sp) => {\n const active = edit.species.includes(sp);\n return (\n <button\n key={sp}\n type=\"button\"\n onClick={() => toggleSpecies(sp)}\n className={`rounded-full border px-3 py-1 text-xs capitalize transition-colors ${active ? 'border-border-default bg-bg-sunken font-medium text-text-primary' : 'border-border-subtle text-text-secondary hover:text-text-primary'}`}\n >\n {sp.toLowerCase()}\n </button>\n );\n })}\n </div>\n <p className=\"mt-1 text-xs text-text-tertiary\">\n {t('healthybowl.withdrawal.library.speciesHint', 'Leave empty to apply to all species.')}\n </p>\n </div>\n </div>\n ) : null}\n </Modal>\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