@burdenoff/microfe-healthybowl 2026.714.3 → 2026.714.4
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/HealthyBowlRoutes.js +137 -113
- package/dist/healthybowl/HealthyBowlRoutes.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlContacts.js +149 -0
- package/dist/healthybowl/hooks/useHealthyBowlContacts.js.map +1 -0
- package/dist/healthybowl/hooks/useHealthyBowlLivestockDepth.js +200 -0
- package/dist/healthybowl/hooks/useHealthyBowlLivestockDepth.js.map +1 -0
- package/dist/healthybowl/hooks/useHealthyBowlStorage.js +162 -0
- package/dist/healthybowl/hooks/useHealthyBowlStorage.js.map +1 -0
- package/dist/healthybowl/pages/contacts/ContactDetailPage.js +224 -0
- package/dist/healthybowl/pages/contacts/ContactDetailPage.js.map +1 -0
- package/dist/healthybowl/pages/contacts/ContactFormModal.js +147 -0
- package/dist/healthybowl/pages/contacts/ContactFormModal.js.map +1 -0
- package/dist/healthybowl/pages/contacts/ContactsPage.js +241 -0
- package/dist/healthybowl/pages/contacts/ContactsPage.js.map +1 -0
- package/dist/healthybowl/pages/contacts/CsvImportModal.js +155 -0
- package/dist/healthybowl/pages/contacts/CsvImportModal.js.map +1 -0
- package/dist/healthybowl/pages/contacts/RecordOrderModal.js +131 -0
- package/dist/healthybowl/pages/contacts/RecordOrderModal.js.map +1 -0
- package/dist/healthybowl/pages/contacts/labels.js +46 -0
- package/dist/healthybowl/pages/contacts/labels.js.map +1 -0
- package/dist/healthybowl/pages/livestock/AnimalDepthFormModal.js +152 -0
- package/dist/healthybowl/pages/livestock/AnimalDepthFormModal.js.map +1 -0
- package/dist/healthybowl/pages/livestock/AnimalDepthPage.js +245 -0
- package/dist/healthybowl/pages/livestock/AnimalDepthPage.js.map +1 -0
- package/dist/healthybowl/pages/livestock/AnimalGroupModal.js +210 -0
- package/dist/healthybowl/pages/livestock/AnimalGroupModal.js.map +1 -0
- package/dist/healthybowl/pages/livestock/HerdDepthPage.js +189 -0
- package/dist/healthybowl/pages/livestock/HerdDepthPage.js.map +1 -0
- package/dist/healthybowl/pages/livestock/RecordWeightModal.js +100 -0
- package/dist/healthybowl/pages/livestock/RecordWeightModal.js.map +1 -0
- package/dist/healthybowl/pages/livestock/depthLabels.js +31 -0
- package/dist/healthybowl/pages/livestock/depthLabels.js.map +1 -0
- package/dist/healthybowl/pages/storage/PlaceLotModal.js +150 -0
- package/dist/healthybowl/pages/storage/PlaceLotModal.js.map +1 -0
- package/dist/healthybowl/pages/storage/RecordMovementModal.js +140 -0
- package/dist/healthybowl/pages/storage/RecordMovementModal.js.map +1 -0
- package/dist/healthybowl/pages/storage/StorageLocationFormModal.js +139 -0
- package/dist/healthybowl/pages/storage/StorageLocationFormModal.js.map +1 -0
- package/dist/healthybowl/pages/storage/StorageLotDetailPage.js +150 -0
- package/dist/healthybowl/pages/storage/StorageLotDetailPage.js.map +1 -0
- package/dist/healthybowl/pages/storage/StoragePage.js +251 -0
- package/dist/healthybowl/pages/storage/StoragePage.js.map +1 -0
- package/dist/healthybowl/pages/storage/labels.js +67 -0
- package/dist/healthybowl/pages/storage/labels.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { useBasePath as e } from "../../hooks/useBasePath.js";
|
|
2
|
+
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
|
+
import { StatusBadge as n } from "../../components/StatusBadge.js";
|
|
4
|
+
import { ErrorState as r } from "../../components/ErrorState.js";
|
|
5
|
+
import { useConfirm as i } from "../../components/ConfirmDialog.js";
|
|
6
|
+
import { Breadcrumbs as a } from "../../components/Breadcrumbs.js";
|
|
7
|
+
import { PageLoader as o } from "../../components/PageLoader.js";
|
|
8
|
+
import { useToast as s } from "../../hooks/useToast.js";
|
|
9
|
+
import "../../components/index.js";
|
|
10
|
+
import { useHealthyBowlLivestockDepth as c } from "../../hooks/useHealthyBowlLivestockDepth.js";
|
|
11
|
+
import { AnimalDepthFormModal as l } from "./AnimalDepthFormModal.js";
|
|
12
|
+
import { formatAdg as u, formatBcs as d, formatShortDate as f, formatWeight as p, withdrawalBadgeVariant as m } from "./depthLabels.js";
|
|
13
|
+
import { RecordWeightModal as h } from "./RecordWeightModal.js";
|
|
14
|
+
import { useMemo as g, useState as _ } from "react";
|
|
15
|
+
import { useI18n as v } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
16
|
+
import { AlertTriangle as y, ArrowLeft as b, Pencil as x, Scale as S, TrendingUp as C } from "lucide-react";
|
|
17
|
+
import { useNavigate as w, useParams as T } from "react-router-dom";
|
|
18
|
+
import { jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
19
|
+
import { Button as O } from "@burdenoff/fe-libs/ui";
|
|
20
|
+
//#region src/healthybowl/pages/livestock/AnimalDepthPage.tsx
|
|
21
|
+
var k = ({ label: e, value: t }) => /* @__PURE__ */ D("div", {
|
|
22
|
+
className: "flex items-center justify-between gap-4 border-b border-border-subtle py-3 last:border-0",
|
|
23
|
+
children: [/* @__PURE__ */ E("span", {
|
|
24
|
+
className: "text-sm text-text-secondary",
|
|
25
|
+
children: e
|
|
26
|
+
}), /* @__PURE__ */ E("span", {
|
|
27
|
+
className: "text-right text-sm font-medium text-text-primary",
|
|
28
|
+
children: t
|
|
29
|
+
})]
|
|
30
|
+
}), A = () => {
|
|
31
|
+
let { t: A } = v(), j = w(), { buildPath: M } = e(), { toast: N } = s(), P = i(), { animalId: ee } = T(), { animalDepth: F, herd: I, groups: L, loading: R, errors: z, refetchAnimal: B, updateAnimalDepth: V, recordWeight: H, deleteWeight: U } = c({
|
|
32
|
+
animalId: ee ?? null,
|
|
33
|
+
herd: !0,
|
|
34
|
+
groups: !0
|
|
35
|
+
}), [W, G] = _(!1), [K, q] = _(!1), J = g(() => (I?.rows ?? []).map((e) => ({
|
|
36
|
+
animalId: e.animalId,
|
|
37
|
+
tagNumber: e.tagNumber,
|
|
38
|
+
name: e.name
|
|
39
|
+
})), [I]);
|
|
40
|
+
if (R.animal && !F) return /* @__PURE__ */ E(o, {});
|
|
41
|
+
if (z.animal && !F || !F) return /* @__PURE__ */ E(t, {
|
|
42
|
+
title: A("healthybowl.livestock.depth.detail.title", "Animal Record"),
|
|
43
|
+
children: /* @__PURE__ */ E(r, {
|
|
44
|
+
description: z.animal?.message ?? A("healthybowl.livestock.depth.detail.notFound", "Animal not found."),
|
|
45
|
+
onRetry: () => void B()
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
let Y = F, X = Y.name.slice(0, 2).toUpperCase(), Z = async (e) => {
|
|
49
|
+
await V(e), N({
|
|
50
|
+
title: A("healthybowl.livestock.depth.toast.updated", "Record updated"),
|
|
51
|
+
description: Y.name,
|
|
52
|
+
variant: "success"
|
|
53
|
+
});
|
|
54
|
+
}, Q = async (e) => {
|
|
55
|
+
await H({
|
|
56
|
+
...e,
|
|
57
|
+
animalId: Y.animalId
|
|
58
|
+
}), N({
|
|
59
|
+
title: A("healthybowl.livestock.depth.toast.weightSaved", "Weight recorded"),
|
|
60
|
+
description: `${String(e.weightKg)} kg`,
|
|
61
|
+
variant: "success"
|
|
62
|
+
});
|
|
63
|
+
}, $ = async (e) => {
|
|
64
|
+
if (await P({
|
|
65
|
+
title: A("healthybowl.livestock.depth.confirm.delWeightTitle", "Delete weight?"),
|
|
66
|
+
message: A("healthybowl.livestock.depth.confirm.delWeight", "Remove this weight measurement?")
|
|
67
|
+
})) try {
|
|
68
|
+
await U(e), N({
|
|
69
|
+
title: A("healthybowl.livestock.depth.toast.weightDeleted", "Weight removed"),
|
|
70
|
+
variant: "success"
|
|
71
|
+
});
|
|
72
|
+
} catch (e) {
|
|
73
|
+
N({
|
|
74
|
+
title: A("healthybowl.livestock.depth.toast.error", "Something went wrong"),
|
|
75
|
+
description: e instanceof Error ? e.message : String(e),
|
|
76
|
+
variant: "error"
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
return /* @__PURE__ */ D(t, {
|
|
81
|
+
title: Y.name,
|
|
82
|
+
description: `${Y.type} · ${Y.tagNumber}`,
|
|
83
|
+
actions: /* @__PURE__ */ D("div", {
|
|
84
|
+
className: "flex items-center gap-2",
|
|
85
|
+
children: [/* @__PURE__ */ D(O, {
|
|
86
|
+
variant: "outline",
|
|
87
|
+
onClick: () => q(!0),
|
|
88
|
+
children: [/* @__PURE__ */ E(S, { className: "h-4 w-4" }), A("healthybowl.livestock.depth.detail.logWeight", "Record weight")]
|
|
89
|
+
}), /* @__PURE__ */ D(O, {
|
|
90
|
+
onClick: () => G(!0),
|
|
91
|
+
children: [/* @__PURE__ */ E(x, { className: "h-4 w-4" }), A("healthybowl.livestock.depth.detail.edit", "Edit")]
|
|
92
|
+
})]
|
|
93
|
+
}),
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ E(a, { items: [{
|
|
96
|
+
label: A("healthybowl.livestock.depth.title", "Livestock Records"),
|
|
97
|
+
href: M("livestock/records")
|
|
98
|
+
}, { label: Y.name }] }),
|
|
99
|
+
/* @__PURE__ */ E("div", {
|
|
100
|
+
className: "mt-2",
|
|
101
|
+
children: /* @__PURE__ */ D(O, {
|
|
102
|
+
variant: "ghost",
|
|
103
|
+
size: "sm",
|
|
104
|
+
onClick: () => j(M("livestock/records")),
|
|
105
|
+
children: [/* @__PURE__ */ E(b, { className: "h-4 w-4" }), A("common.back", "Back")]
|
|
106
|
+
})
|
|
107
|
+
}),
|
|
108
|
+
Y.withdrawal.blocked ? /* @__PURE__ */ D("div", {
|
|
109
|
+
role: "alert",
|
|
110
|
+
className: "mt-3 flex items-center gap-3 rounded-lg border border-status-error-border bg-status-error-bg px-4 py-3 text-status-error-text",
|
|
111
|
+
children: [/* @__PURE__ */ E(y, { className: "h-5 w-5 shrink-0" }), /* @__PURE__ */ E("span", {
|
|
112
|
+
className: "text-sm font-semibold",
|
|
113
|
+
children: A("healthybowl.livestock.depth.detail.withdrawalBanner", "In medication withdrawal — Withdrawal ends {{date}} · do not sell milk or meat", { date: f(Y.withdrawal.endDate) })
|
|
114
|
+
})]
|
|
115
|
+
}) : null,
|
|
116
|
+
/* @__PURE__ */ D("div", {
|
|
117
|
+
className: "mt-4 grid grid-cols-1 gap-4 lg:grid-cols-3",
|
|
118
|
+
children: [/* @__PURE__ */ D("div", {
|
|
119
|
+
className: "rounded-xl border border-border-subtle bg-bg-surface p-5 lg:col-span-2",
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ D("div", {
|
|
122
|
+
className: "mb-2 flex items-center gap-3",
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ E("div", {
|
|
125
|
+
className: "flex h-14 w-14 items-center justify-center rounded-full bg-accent-teal/10 text-lg font-semibold text-accent-teal",
|
|
126
|
+
children: X
|
|
127
|
+
}),
|
|
128
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("div", {
|
|
129
|
+
className: "text-lg font-semibold text-text-primary",
|
|
130
|
+
children: Y.name
|
|
131
|
+
}), /* @__PURE__ */ D("div", {
|
|
132
|
+
className: "text-sm text-text-secondary",
|
|
133
|
+
children: [
|
|
134
|
+
Y.type,
|
|
135
|
+
" #",
|
|
136
|
+
Y.tagNumber
|
|
137
|
+
]
|
|
138
|
+
})] }),
|
|
139
|
+
/* @__PURE__ */ E("div", {
|
|
140
|
+
className: "ml-auto",
|
|
141
|
+
children: /* @__PURE__ */ E(n, {
|
|
142
|
+
variant: m(Y.withdrawal.status),
|
|
143
|
+
label: Y.withdrawal.blocked ? A("healthybowl.livestock.depth.detail.inWithdrawal", "In withdrawal") : A("healthybowl.livestock.depth.detail.clear", "Clear to sell"),
|
|
144
|
+
dot: !0
|
|
145
|
+
})
|
|
146
|
+
})
|
|
147
|
+
]
|
|
148
|
+
}),
|
|
149
|
+
/* @__PURE__ */ E(k, {
|
|
150
|
+
label: A("healthybowl.livestock.depth.detail.eid", "EID / RFID Tag"),
|
|
151
|
+
value: Y.eidTag ?? "—"
|
|
152
|
+
}),
|
|
153
|
+
/* @__PURE__ */ E(k, {
|
|
154
|
+
label: A("healthybowl.livestock.depth.detail.bcs", "Body Condition Score"),
|
|
155
|
+
value: d(Y.bodyConditionScore)
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ E(k, {
|
|
158
|
+
label: A("healthybowl.livestock.depth.detail.group", "Group"),
|
|
159
|
+
value: Y.groupName ?? "—"
|
|
160
|
+
}),
|
|
161
|
+
/* @__PURE__ */ E(k, {
|
|
162
|
+
label: A("healthybowl.livestock.depth.detail.grazing", "Grazing / Rotation"),
|
|
163
|
+
value: Y.grazingPaddock ? `${Y.grazingPaddock}${Y.rotationDate ? ` (rotates ${f(Y.rotationDate)})` : ""}` : "—"
|
|
164
|
+
}),
|
|
165
|
+
/* @__PURE__ */ E(k, {
|
|
166
|
+
label: A("healthybowl.livestock.depth.detail.genealogy", "Genealogy — Dam · Sire"),
|
|
167
|
+
value: `${Y.damTag ? `Dam ${Y.damTag}` : "Dam —"} · ${Y.sireTag ? `Sire ${Y.sireTag}` : "Sire —"}`
|
|
168
|
+
}),
|
|
169
|
+
/* @__PURE__ */ E(k, {
|
|
170
|
+
label: A("healthybowl.livestock.depth.detail.adg", "Average Daily Gain (ADG)"),
|
|
171
|
+
value: /* @__PURE__ */ D("span", {
|
|
172
|
+
className: "inline-flex items-center gap-1",
|
|
173
|
+
children: [Y.adgKgPerDay === null ? null : /* @__PURE__ */ E(C, { className: "h-4 w-4 text-accent-teal" }), u(Y.adgKgPerDay)]
|
|
174
|
+
})
|
|
175
|
+
}),
|
|
176
|
+
/* @__PURE__ */ E(k, {
|
|
177
|
+
label: A("healthybowl.livestock.depth.detail.latestWeight", "Latest Weight"),
|
|
178
|
+
value: p(Y.latestWeightKg, Y.latestWeightAt)
|
|
179
|
+
}),
|
|
180
|
+
Y.grazingNotes ? /* @__PURE__ */ E(k, {
|
|
181
|
+
label: A("healthybowl.livestock.depth.detail.notes", "Grazing notes"),
|
|
182
|
+
value: Y.grazingNotes
|
|
183
|
+
}) : null
|
|
184
|
+
]
|
|
185
|
+
}), /* @__PURE__ */ D("div", {
|
|
186
|
+
className: "rounded-xl border border-border-subtle bg-bg-surface p-5",
|
|
187
|
+
children: [/* @__PURE__ */ D("div", {
|
|
188
|
+
className: "mb-3 flex items-center justify-between",
|
|
189
|
+
children: [/* @__PURE__ */ E("h3", {
|
|
190
|
+
className: "text-sm font-semibold text-text-primary",
|
|
191
|
+
children: A("healthybowl.livestock.depth.detail.weightHistory", "Weight history")
|
|
192
|
+
}), /* @__PURE__ */ D(O, {
|
|
193
|
+
variant: "outline",
|
|
194
|
+
size: "sm",
|
|
195
|
+
onClick: () => q(!0),
|
|
196
|
+
children: [/* @__PURE__ */ E(S, { className: "h-3.5 w-3.5" }), A("healthybowl.livestock.depth.detail.add", "Add")]
|
|
197
|
+
})]
|
|
198
|
+
}), Y.weightHistory.length === 0 ? /* @__PURE__ */ E("p", {
|
|
199
|
+
className: "text-sm text-text-secondary",
|
|
200
|
+
children: A("healthybowl.livestock.depth.detail.noWeights", "No weights logged yet — record two or more to compute ADG.")
|
|
201
|
+
}) : /* @__PURE__ */ E("ul", {
|
|
202
|
+
className: "space-y-2",
|
|
203
|
+
children: Y.weightHistory.map((e) => /* @__PURE__ */ D("li", {
|
|
204
|
+
className: "flex items-center justify-between rounded-md bg-bg-sunken px-3 py-2 text-sm",
|
|
205
|
+
children: [
|
|
206
|
+
/* @__PURE__ */ D("span", {
|
|
207
|
+
className: "tabular-nums text-text-primary",
|
|
208
|
+
children: [e.weightKg, " kg"]
|
|
209
|
+
}),
|
|
210
|
+
/* @__PURE__ */ E("span", {
|
|
211
|
+
className: "text-text-secondary",
|
|
212
|
+
children: f(e.measuredAt)
|
|
213
|
+
}),
|
|
214
|
+
/* @__PURE__ */ E("button", {
|
|
215
|
+
type: "button",
|
|
216
|
+
onClick: () => void $(e.id),
|
|
217
|
+
className: "text-xs text-text-secondary hover:text-status-error-text",
|
|
218
|
+
children: A("common.remove", "Remove")
|
|
219
|
+
})
|
|
220
|
+
]
|
|
221
|
+
}, e.id))
|
|
222
|
+
})]
|
|
223
|
+
})]
|
|
224
|
+
}),
|
|
225
|
+
/* @__PURE__ */ E(l, {
|
|
226
|
+
open: W,
|
|
227
|
+
onClose: () => G(!1),
|
|
228
|
+
animal: Y,
|
|
229
|
+
groups: L,
|
|
230
|
+
animalOptions: J,
|
|
231
|
+
onSubmit: Z
|
|
232
|
+
}),
|
|
233
|
+
/* @__PURE__ */ E(h, {
|
|
234
|
+
open: K,
|
|
235
|
+
onClose: () => q(!1),
|
|
236
|
+
animalName: Y.name,
|
|
237
|
+
onSubmit: Q
|
|
238
|
+
})
|
|
239
|
+
]
|
|
240
|
+
});
|
|
241
|
+
};
|
|
242
|
+
//#endregion
|
|
243
|
+
export { A as AnimalDepthPage };
|
|
244
|
+
|
|
245
|
+
//# sourceMappingURL=AnimalDepthPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnimalDepthPage.js","names":[],"sources":["../../../../src/healthybowl/pages/livestock/AnimalDepthPage.tsx"],"sourcesContent":["/**\n * Single-animal deep record (BOFF-2890 · L-1).\n * EID/RFID, body-condition score, group, grazing/rotation, dam/sire genealogy, ADG, latest\n * weight and weight history, plus the medication-withdrawal compliance badge (reused from\n * BOFF-2885). Edit the record or log a new weight in place. No fabricated data.\n */\nimport { useMemo, useState } from 'react';\nimport { useNavigate, useParams } from 'react-router-dom';\nimport { AlertTriangle, ArrowLeft, Pencil, Scale, TrendingUp } from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { PageLayout, StatusBadge, ErrorState, PageLoader, Breadcrumbs, useConfirm } from '../../components';\nimport { useToast } from '../../hooks/useToast';\nimport { useBasePath } from '../../hooks/useBasePath';\nimport { useHealthyBowlLivestockDepth } from '../../hooks/useHealthyBowlLivestockDepth';\nimport { AnimalDepthFormModal, type AnimalOption } from './AnimalDepthFormModal';\nimport { RecordWeightModal } from './RecordWeightModal';\nimport { formatAdg, formatBcs, formatShortDate, formatWeight, withdrawalBadgeVariant } from './depthLabels';\n\nconst DetailRow = ({ label, value }: { label: string; value: React.ReactNode }) => (\n <div className=\"flex items-center justify-between gap-4 border-b border-border-subtle py-3 last:border-0\">\n <span className=\"text-sm text-text-secondary\">{label}</span>\n <span className=\"text-right text-sm font-medium text-text-primary\">{value}</span>\n </div>\n);\n\nexport const AnimalDepthPage = () => {\n const { t } = useI18n();\n const navigate = useNavigate();\n const { buildPath } = useBasePath();\n const { toast } = useToast();\n const confirm = useConfirm();\n const { animalId } = useParams<{ animalId: string }>();\n\n const { animalDepth, herd, groups, loading, errors, refetchAnimal, updateAnimalDepth, recordWeight, deleteWeight } =\n useHealthyBowlLivestockDepth({ animalId: animalId ?? null, herd: true, groups: true });\n\n const [editOpen, setEditOpen] = useState(false);\n const [weightOpen, setWeightOpen] = useState(false);\n\n const animalOptions = useMemo<AnimalOption[]>(\n () => (herd?.rows ?? []).map((r) => ({ animalId: r.animalId, tagNumber: r.tagNumber, name: r.name })),\n [herd]\n );\n\n if (loading.animal && !animalDepth) {\n return <PageLoader />;\n }\n if ((errors.animal && !animalDepth) || !animalDepth) {\n return (\n <PageLayout title={t('healthybowl.livestock.depth.detail.title', 'Animal Record')}>\n <ErrorState\n description={errors.animal?.message ?? t('healthybowl.livestock.depth.detail.notFound', 'Animal not found.')}\n onRetry={() => void refetchAnimal()}\n />\n </PageLayout>\n );\n }\n\n const a = animalDepth;\n const initials = a.name.slice(0, 2).toUpperCase();\n\n const handleEdit = async (input: Record<string, unknown>) => {\n await updateAnimalDepth(input);\n toast({\n title: t('healthybowl.livestock.depth.toast.updated', 'Record updated'),\n description: a.name,\n variant: 'success',\n });\n };\n\n const handleWeight = async (input: Record<string, unknown>) => {\n await recordWeight({ ...input, animalId: a.animalId });\n toast({\n title: t('healthybowl.livestock.depth.toast.weightSaved', 'Weight recorded'),\n description: `${String(input.weightKg)} kg`,\n variant: 'success',\n });\n };\n\n const handleDeleteWeight = async (id: string) => {\n if (\n !(await confirm({\n title: t('healthybowl.livestock.depth.confirm.delWeightTitle', 'Delete weight?'),\n message: t('healthybowl.livestock.depth.confirm.delWeight', 'Remove this weight measurement?'),\n }))\n ) {\n return;\n }\n try {\n await deleteWeight(id);\n toast({ title: t('healthybowl.livestock.depth.toast.weightDeleted', 'Weight removed'), variant: 'success' });\n } catch (err) {\n toast({\n title: t('healthybowl.livestock.depth.toast.error', 'Something went wrong'),\n description: err instanceof Error ? err.message : String(err),\n variant: 'error',\n });\n }\n };\n\n return (\n <PageLayout\n title={a.name}\n description={`${a.type} · ${a.tagNumber}`}\n actions={\n <div className=\"flex items-center gap-2\">\n <Button variant=\"outline\" onClick={() => setWeightOpen(true)}>\n <Scale className=\"h-4 w-4\" />\n {t('healthybowl.livestock.depth.detail.logWeight', 'Record weight')}\n </Button>\n <Button onClick={() => setEditOpen(true)}>\n <Pencil className=\"h-4 w-4\" />\n {t('healthybowl.livestock.depth.detail.edit', 'Edit')}\n </Button>\n </div>\n }\n >\n <Breadcrumbs\n items={[\n { label: t('healthybowl.livestock.depth.title', 'Livestock Records'), href: buildPath('livestock/records') },\n { label: a.name },\n ]}\n />\n\n <div className=\"mt-2\">\n <Button variant=\"ghost\" size=\"sm\" onClick={() => navigate(buildPath('livestock/records'))}>\n <ArrowLeft className=\"h-4 w-4\" />\n {t('common.back', 'Back')}\n </Button>\n </div>\n\n {a.withdrawal.blocked ? (\n <div\n role=\"alert\"\n className=\"mt-3 flex items-center gap-3 rounded-lg border border-status-error-border bg-status-error-bg px-4 py-3 text-status-error-text\"\n >\n <AlertTriangle className=\"h-5 w-5 shrink-0\" />\n <span className=\"text-sm font-semibold\">\n {t(\n 'healthybowl.livestock.depth.detail.withdrawalBanner',\n 'In medication withdrawal — Withdrawal ends {{date}} · do not sell milk or meat',\n {\n date: formatShortDate(a.withdrawal.endDate),\n }\n )}\n </span>\n </div>\n ) : null}\n\n <div className=\"mt-4 grid grid-cols-1 gap-4 lg:grid-cols-3\">\n <div className=\"rounded-xl border border-border-subtle bg-bg-surface p-5 lg:col-span-2\">\n <div className=\"mb-2 flex items-center gap-3\">\n <div className=\"flex h-14 w-14 items-center justify-center rounded-full bg-accent-teal/10 text-lg font-semibold text-accent-teal\">\n {initials}\n </div>\n <div>\n <div className=\"text-lg font-semibold text-text-primary\">{a.name}</div>\n <div className=\"text-sm text-text-secondary\">\n {a.type} #{a.tagNumber}\n </div>\n </div>\n <div className=\"ml-auto\">\n <StatusBadge\n variant={withdrawalBadgeVariant(a.withdrawal.status)}\n label={\n a.withdrawal.blocked\n ? t('healthybowl.livestock.depth.detail.inWithdrawal', 'In withdrawal')\n : t('healthybowl.livestock.depth.detail.clear', 'Clear to sell')\n }\n dot\n />\n </div>\n </div>\n\n <DetailRow label={t('healthybowl.livestock.depth.detail.eid', 'EID / RFID Tag')} value={a.eidTag ?? '—'} />\n <DetailRow\n label={t('healthybowl.livestock.depth.detail.bcs', 'Body Condition Score')}\n value={formatBcs(a.bodyConditionScore)}\n />\n <DetailRow label={t('healthybowl.livestock.depth.detail.group', 'Group')} value={a.groupName ?? '—'} />\n <DetailRow\n label={t('healthybowl.livestock.depth.detail.grazing', 'Grazing / Rotation')}\n value={\n a.grazingPaddock\n ? `${a.grazingPaddock}${a.rotationDate ? ` (rotates ${formatShortDate(a.rotationDate)})` : ''}`\n : '—'\n }\n />\n <DetailRow\n label={t('healthybowl.livestock.depth.detail.genealogy', 'Genealogy — Dam · Sire')}\n value={`${a.damTag ? `Dam ${a.damTag}` : 'Dam —'} · ${a.sireTag ? `Sire ${a.sireTag}` : 'Sire —'}`}\n />\n <DetailRow\n label={t('healthybowl.livestock.depth.detail.adg', 'Average Daily Gain (ADG)')}\n value={\n <span className=\"inline-flex items-center gap-1\">\n {a.adgKgPerDay !== null ? <TrendingUp className=\"h-4 w-4 text-accent-teal\" /> : null}\n {formatAdg(a.adgKgPerDay)}\n </span>\n }\n />\n <DetailRow\n label={t('healthybowl.livestock.depth.detail.latestWeight', 'Latest Weight')}\n value={formatWeight(a.latestWeightKg, a.latestWeightAt)}\n />\n {a.grazingNotes ? (\n <DetailRow label={t('healthybowl.livestock.depth.detail.notes', 'Grazing notes')} value={a.grazingNotes} />\n ) : null}\n </div>\n\n <div className=\"rounded-xl border border-border-subtle bg-bg-surface p-5\">\n <div className=\"mb-3 flex items-center justify-between\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.livestock.depth.detail.weightHistory', 'Weight history')}\n </h3>\n <Button variant=\"outline\" size=\"sm\" onClick={() => setWeightOpen(true)}>\n <Scale className=\"h-3.5 w-3.5\" />\n {t('healthybowl.livestock.depth.detail.add', 'Add')}\n </Button>\n </div>\n {a.weightHistory.length === 0 ? (\n <p className=\"text-sm text-text-secondary\">\n {t(\n 'healthybowl.livestock.depth.detail.noWeights',\n 'No weights logged yet — record two or more to compute ADG.'\n )}\n </p>\n ) : (\n <ul className=\"space-y-2\">\n {a.weightHistory.map((w) => (\n <li key={w.id} className=\"flex items-center justify-between rounded-md bg-bg-sunken px-3 py-2 text-sm\">\n <span className=\"tabular-nums text-text-primary\">{w.weightKg} kg</span>\n <span className=\"text-text-secondary\">{formatShortDate(w.measuredAt)}</span>\n <button\n type=\"button\"\n onClick={() => void handleDeleteWeight(w.id)}\n className=\"text-xs text-text-secondary hover:text-status-error-text\"\n >\n {t('common.remove', 'Remove')}\n </button>\n </li>\n ))}\n </ul>\n )}\n </div>\n </div>\n\n <AnimalDepthFormModal\n open={editOpen}\n onClose={() => setEditOpen(false)}\n animal={a}\n groups={groups}\n animalOptions={animalOptions}\n onSubmit={handleEdit}\n />\n <RecordWeightModal\n open={weightOpen}\n onClose={() => setWeightOpen(false)}\n animalName={a.name}\n onSubmit={handleWeight}\n />\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBA,IAAM,KAAa,EAAE,UAAO,eAC1B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E,WAAW;SAAQ,CAAA;QAC5E,kBAAC,UAAD;SACE,MAAK;SACL,eAAe,KAAK,EAAmB,EAAE,GAAG;SAC5C,WAAU;mBAET,EAAE,iBAAiB,SAAS;SACtB,CAAA;QACN;SAVI,EAAE,GAUN,CACL;MACC,CAAA,CAEH;OACF;;GAEN,kBAAC,GAAD;IACE,MAAM;IACN,eAAe,EAAY,GAAM;IACjC,QAAQ;IACA;IACO;IACf,UAAU;IACV,CAAA;GACF,kBAAC,GAAD;IACE,MAAM;IACN,eAAe,EAAc,GAAM;IACnC,YAAY,EAAE;IACd,UAAU;IACV,CAAA;GACS"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { StatusBadge as e } from "../../components/StatusBadge.js";
|
|
2
|
+
import { useConfirm as t } from "../../components/ConfirmDialog.js";
|
|
3
|
+
import { Modal as n } from "../../components/Modal.js";
|
|
4
|
+
import { useToast as r } from "../../hooks/useToast.js";
|
|
5
|
+
import "../../components/index.js";
|
|
6
|
+
import { useHealthyBowlLivestockDepth as i } from "../../hooks/useHealthyBowlLivestockDepth.js";
|
|
7
|
+
import { ANIMAL_TYPES as a, GROUP_KINDS as o, groupKindVariant as s } from "./depthLabels.js";
|
|
8
|
+
import { useEffect as c, useState as l } from "react";
|
|
9
|
+
import { useI18n as u } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
10
|
+
import { Network as d, Plus as f, Trash2 as p } from "lucide-react";
|
|
11
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
|
+
import { Button as g, Input as _, Select as v, SelectContent as y, SelectItem as b, SelectTrigger as x, SelectValue as S, Textarea as C } from "@burdenoff/fe-libs/ui";
|
|
13
|
+
//#region src/healthybowl/pages/livestock/AnimalGroupModal.tsx
|
|
14
|
+
var w = "mb-1 block text-sm font-medium text-text-primary", T = ({ open: T, onClose: E, onChanged: D }) => {
|
|
15
|
+
let { t: O } = u(), { toast: k } = r(), A = t(), { groups: j, createGroup: M, updateGroup: N, deleteGroup: P, refetchGroups: F } = i({ groups: !0 }), [I, L] = l(null), [R, z] = l(""), [B, V] = l(""), [H, U] = l("MANUAL"), [W, G] = l(""), [K, q] = l(""), [J, Y] = l(!1), X = () => {
|
|
16
|
+
L(null), z(""), V(""), U("MANUAL"), G(""), q("");
|
|
17
|
+
};
|
|
18
|
+
c(() => {
|
|
19
|
+
T || X();
|
|
20
|
+
}, [T]);
|
|
21
|
+
let Z = (e) => {
|
|
22
|
+
L(e), z(e.name), V(e.description ?? ""), U(e.kind), G(typeof e.smartRule?.animalType == "string" ? e.smartRule.animalType : ""), q(typeof e.smartRule?.productionType == "string" ? e.smartRule.productionType : "");
|
|
23
|
+
}, Q = () => {
|
|
24
|
+
if (H !== "SMART") return;
|
|
25
|
+
let e = {};
|
|
26
|
+
return W && (e.animalType = W), K.trim() && (e.productionType = K.trim()), e;
|
|
27
|
+
}, $ = async () => {
|
|
28
|
+
if (R.trim()) {
|
|
29
|
+
Y(!0);
|
|
30
|
+
try {
|
|
31
|
+
let e = {
|
|
32
|
+
name: R.trim(),
|
|
33
|
+
description: B.trim() || null,
|
|
34
|
+
kind: H,
|
|
35
|
+
smartRule: Q()
|
|
36
|
+
};
|
|
37
|
+
I ? (await N({
|
|
38
|
+
id: I.id,
|
|
39
|
+
...e
|
|
40
|
+
}), k({
|
|
41
|
+
title: O("healthybowl.livestock.depth.groups.toast.updated", "Group updated"),
|
|
42
|
+
variant: "success"
|
|
43
|
+
})) : (await M(e), k({
|
|
44
|
+
title: O("healthybowl.livestock.depth.groups.toast.created", "Group created"),
|
|
45
|
+
variant: "success"
|
|
46
|
+
})), X(), await F(), D?.();
|
|
47
|
+
} catch (e) {
|
|
48
|
+
k({
|
|
49
|
+
title: O("healthybowl.livestock.depth.groups.toast.failed", "Could not save group"),
|
|
50
|
+
description: e instanceof Error ? e.message : String(e),
|
|
51
|
+
variant: "error"
|
|
52
|
+
});
|
|
53
|
+
} finally {
|
|
54
|
+
Y(!1);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}, ee = async (e) => {
|
|
58
|
+
if (await A({
|
|
59
|
+
title: O("healthybowl.livestock.depth.groups.confirm.title", "Delete group?"),
|
|
60
|
+
message: O("healthybowl.livestock.depth.groups.confirm.message", "Delete \"{{name}}\"? Its animals are detached (not deleted).", { name: e.name })
|
|
61
|
+
})) {
|
|
62
|
+
Y(!0);
|
|
63
|
+
try {
|
|
64
|
+
await P(e.id), k({
|
|
65
|
+
title: O("healthybowl.livestock.depth.groups.toast.deleted", "Group deleted"),
|
|
66
|
+
variant: "success"
|
|
67
|
+
}), I?.id === e.id && X(), await F(), D?.();
|
|
68
|
+
} catch (e) {
|
|
69
|
+
k({
|
|
70
|
+
title: O("healthybowl.livestock.depth.groups.toast.deleteFailed", "Could not delete group"),
|
|
71
|
+
description: e instanceof Error ? e.message : String(e),
|
|
72
|
+
variant: "error"
|
|
73
|
+
});
|
|
74
|
+
} finally {
|
|
75
|
+
Y(!1);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
return /* @__PURE__ */ m(n, {
|
|
80
|
+
open: T,
|
|
81
|
+
onClose: E,
|
|
82
|
+
title: O("healthybowl.livestock.depth.groups.manage", "Manage animal groups"),
|
|
83
|
+
size: "lg",
|
|
84
|
+
children: /* @__PURE__ */ h("div", {
|
|
85
|
+
className: "space-y-4",
|
|
86
|
+
children: [/* @__PURE__ */ m("div", {
|
|
87
|
+
className: "space-y-2",
|
|
88
|
+
children: j.length === 0 ? /* @__PURE__ */ m("p", {
|
|
89
|
+
className: "text-sm text-text-secondary",
|
|
90
|
+
children: O("healthybowl.livestock.depth.groups.none", "No groups yet. Create one below.")
|
|
91
|
+
}) : j.map((t) => /* @__PURE__ */ h("div", {
|
|
92
|
+
className: "flex items-center justify-between rounded-md border border-border-subtle bg-bg-surface px-3 py-2",
|
|
93
|
+
children: [/* @__PURE__ */ h("div", {
|
|
94
|
+
className: "flex items-center gap-2",
|
|
95
|
+
children: [
|
|
96
|
+
t.kind === "SMART" ? /* @__PURE__ */ m(d, { className: "h-4 w-4 text-text-secondary" }) : null,
|
|
97
|
+
/* @__PURE__ */ m("span", {
|
|
98
|
+
className: "font-medium text-text-primary",
|
|
99
|
+
children: t.name
|
|
100
|
+
}),
|
|
101
|
+
/* @__PURE__ */ m(e, {
|
|
102
|
+
variant: s(t.kind),
|
|
103
|
+
label: t.kind
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ m("span", {
|
|
106
|
+
className: "text-xs tabular-nums text-text-secondary",
|
|
107
|
+
children: O("healthybowl.livestock.depth.groups.count", "{{n}} animals", { n: t.animalCount })
|
|
108
|
+
})
|
|
109
|
+
]
|
|
110
|
+
}), /* @__PURE__ */ h("div", {
|
|
111
|
+
className: "flex items-center gap-1",
|
|
112
|
+
children: [/* @__PURE__ */ m(g, {
|
|
113
|
+
variant: "ghost",
|
|
114
|
+
size: "sm",
|
|
115
|
+
onClick: () => Z(t),
|
|
116
|
+
disabled: J,
|
|
117
|
+
children: O("healthybowl.livestock.depth.groups.edit", "Edit")
|
|
118
|
+
}), /* @__PURE__ */ m(g, {
|
|
119
|
+
variant: "ghost",
|
|
120
|
+
size: "icon-sm",
|
|
121
|
+
onClick: () => void ee(t),
|
|
122
|
+
disabled: J,
|
|
123
|
+
"aria-label": O("healthybowl.livestock.depth.groups.delete", "Delete group"),
|
|
124
|
+
className: "text-text-secondary hover:text-status-error-text",
|
|
125
|
+
children: /* @__PURE__ */ m(p, { className: "h-4 w-4" })
|
|
126
|
+
})]
|
|
127
|
+
})]
|
|
128
|
+
}, t.id))
|
|
129
|
+
}), /* @__PURE__ */ h("div", {
|
|
130
|
+
className: "rounded-lg border border-border-subtle p-3",
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ m("h4", {
|
|
133
|
+
className: "mb-2 text-sm font-semibold text-text-primary",
|
|
134
|
+
children: I ? O("healthybowl.livestock.depth.groups.editHeading", "Edit group") : O("healthybowl.livestock.depth.groups.newHeading", "New group")
|
|
135
|
+
}),
|
|
136
|
+
/* @__PURE__ */ h("div", {
|
|
137
|
+
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
138
|
+
children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
139
|
+
className: w,
|
|
140
|
+
children: O("healthybowl.livestock.depth.groups.name", "Name")
|
|
141
|
+
}), /* @__PURE__ */ m(_, {
|
|
142
|
+
value: R,
|
|
143
|
+
onChange: (e) => z(e.target.value),
|
|
144
|
+
placeholder: "Milking Herd"
|
|
145
|
+
})] }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
146
|
+
className: w,
|
|
147
|
+
children: O("healthybowl.livestock.depth.groups.kind", "Type")
|
|
148
|
+
}), /* @__PURE__ */ h(v, {
|
|
149
|
+
value: H,
|
|
150
|
+
onValueChange: U,
|
|
151
|
+
children: [/* @__PURE__ */ m(x, { children: /* @__PURE__ */ m(S, {}) }), /* @__PURE__ */ m(y, { children: o.map((e) => /* @__PURE__ */ m(b, {
|
|
152
|
+
value: e,
|
|
153
|
+
children: e
|
|
154
|
+
}, e)) })]
|
|
155
|
+
})] })]
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ h("div", {
|
|
158
|
+
className: "mt-3",
|
|
159
|
+
children: [/* @__PURE__ */ m("label", {
|
|
160
|
+
className: w,
|
|
161
|
+
children: O("healthybowl.livestock.depth.groups.description", "Description")
|
|
162
|
+
}), /* @__PURE__ */ m(C, {
|
|
163
|
+
value: B,
|
|
164
|
+
onChange: (e) => V(e.target.value),
|
|
165
|
+
rows: 2
|
|
166
|
+
})]
|
|
167
|
+
}),
|
|
168
|
+
H === "SMART" ? /* @__PURE__ */ h("div", {
|
|
169
|
+
className: "mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
170
|
+
children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
171
|
+
className: w,
|
|
172
|
+
children: O("healthybowl.livestock.depth.groups.ruleType", "Rule: species")
|
|
173
|
+
}), /* @__PURE__ */ h(v, {
|
|
174
|
+
value: W,
|
|
175
|
+
onValueChange: G,
|
|
176
|
+
children: [/* @__PURE__ */ m(x, { children: /* @__PURE__ */ m(S, { placeholder: O("healthybowl.livestock.depth.groups.anySpecies", "Any species") }) }), /* @__PURE__ */ m(y, { children: a.map((e) => /* @__PURE__ */ m(b, {
|
|
177
|
+
value: e,
|
|
178
|
+
children: e
|
|
179
|
+
}, e)) })]
|
|
180
|
+
})] }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
181
|
+
className: w,
|
|
182
|
+
children: O("healthybowl.livestock.depth.groups.ruleProduction", "Rule: production type")
|
|
183
|
+
}), /* @__PURE__ */ m(_, {
|
|
184
|
+
value: K,
|
|
185
|
+
onChange: (e) => q(e.target.value),
|
|
186
|
+
placeholder: "DAIRY"
|
|
187
|
+
})] })]
|
|
188
|
+
}) : null,
|
|
189
|
+
/* @__PURE__ */ h("div", {
|
|
190
|
+
className: "mt-4 flex items-center gap-2",
|
|
191
|
+
children: [/* @__PURE__ */ h(g, {
|
|
192
|
+
onClick: () => void $(),
|
|
193
|
+
disabled: J || !R.trim(),
|
|
194
|
+
children: [/* @__PURE__ */ m(f, { className: "h-4 w-4" }), I ? O("healthybowl.livestock.depth.groups.save", "Save group") : O("healthybowl.livestock.depth.groups.create", "Create group")]
|
|
195
|
+
}), I ? /* @__PURE__ */ m(g, {
|
|
196
|
+
variant: "ghost",
|
|
197
|
+
onClick: X,
|
|
198
|
+
disabled: J,
|
|
199
|
+
children: O("healthybowl.livestock.depth.groups.cancel", "Cancel")
|
|
200
|
+
}) : null]
|
|
201
|
+
})
|
|
202
|
+
]
|
|
203
|
+
})]
|
|
204
|
+
})
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
//#endregion
|
|
208
|
+
export { T as AnimalGroupModal };
|
|
209
|
+
|
|
210
|
+
//# sourceMappingURL=AnimalGroupModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnimalGroupModal.js","names":[],"sources":["../../../../src/healthybowl/pages/livestock/AnimalGroupModal.tsx"],"sourcesContent":["/**\n * Manage animal groups (BOFF-2890 · L-1).\n * List existing manual/smart groups with their live member counts, delete them, and\n * create/edit a group. A SMART group carries a rule (species + production type) evaluated\n * server-side; a MANUAL group is an explicit membership set assigned from an animal's record.\n * Every value is a real record — no fabricated data.\n */\nimport { useEffect, useState } from 'react';\nimport { Network, Plus, Trash2 } from 'lucide-react';\nimport {\n Button,\n Input,\n Textarea,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Modal, StatusBadge, useConfirm } from '../../components';\nimport { useToast } from '../../hooks/useToast';\nimport { useHealthyBowlLivestockDepth, type AnimalGroup } from '../../hooks/useHealthyBowlLivestockDepth';\nimport { ANIMAL_TYPES, GROUP_KINDS, groupKindVariant } from './depthLabels';\n\ninterface AnimalGroupModalProps {\n open: boolean;\n onClose: () => void;\n /** Called after any group mutation so the caller can refetch the herd view. */\n onChanged?: () => void;\n}\n\nconst fieldLabel = 'mb-1 block text-sm font-medium text-text-primary';\n\nexport const AnimalGroupModal = ({ open, onClose, onChanged }: AnimalGroupModalProps) => {\n const { t } = useI18n();\n const { toast } = useToast();\n const confirm = useConfirm();\n const { groups, createGroup, updateGroup, deleteGroup, refetchGroups } = useHealthyBowlLivestockDepth({\n groups: true,\n });\n\n const [editing, setEditing] = useState<AnimalGroup | null>(null);\n const [name, setName] = useState('');\n const [description, setDescription] = useState('');\n const [kind, setKind] = useState('MANUAL');\n const [ruleType, setRuleType] = useState('');\n const [ruleProduction, setRuleProduction] = useState('');\n const [busy, setBusy] = useState(false);\n\n const resetForm = () => {\n setEditing(null);\n setName('');\n setDescription('');\n setKind('MANUAL');\n setRuleType('');\n setRuleProduction('');\n };\n\n useEffect(() => {\n if (!open) resetForm();\n }, [open]);\n\n const startEdit = (g: AnimalGroup) => {\n setEditing(g);\n setName(g.name);\n setDescription(g.description ?? '');\n setKind(g.kind);\n setRuleType(typeof g.smartRule?.animalType === 'string' ? (g.smartRule.animalType as string) : '');\n setRuleProduction(typeof g.smartRule?.productionType === 'string' ? (g.smartRule.productionType as string) : '');\n };\n\n const buildSmartRule = (): Record<string, unknown> | undefined => {\n if (kind !== 'SMART') return undefined;\n const rule: Record<string, unknown> = {};\n if (ruleType) rule.animalType = ruleType;\n if (ruleProduction.trim()) rule.productionType = ruleProduction.trim();\n return rule;\n };\n\n const handleSubmit = async () => {\n if (!name.trim()) return;\n setBusy(true);\n try {\n const base = { name: name.trim(), description: description.trim() || null, kind, smartRule: buildSmartRule() };\n if (editing) {\n await updateGroup({ id: editing.id, ...base });\n toast({ title: t('healthybowl.livestock.depth.groups.toast.updated', 'Group updated'), variant: 'success' });\n } else {\n await createGroup(base);\n toast({ title: t('healthybowl.livestock.depth.groups.toast.created', 'Group created'), variant: 'success' });\n }\n resetForm();\n await refetchGroups();\n onChanged?.();\n } catch (err) {\n toast({\n title: t('healthybowl.livestock.depth.groups.toast.failed', 'Could not save group'),\n description: err instanceof Error ? err.message : String(err),\n variant: 'error',\n });\n } finally {\n setBusy(false);\n }\n };\n\n const handleDelete = async (g: AnimalGroup) => {\n if (\n !(await confirm({\n title: t('healthybowl.livestock.depth.groups.confirm.title', 'Delete group?'),\n message: t(\n 'healthybowl.livestock.depth.groups.confirm.message',\n 'Delete \"{{name}}\"? Its animals are detached (not deleted).',\n { name: g.name }\n ),\n }))\n )\n return;\n setBusy(true);\n try {\n await deleteGroup(g.id);\n toast({ title: t('healthybowl.livestock.depth.groups.toast.deleted', 'Group deleted'), variant: 'success' });\n if (editing?.id === g.id) resetForm();\n await refetchGroups();\n onChanged?.();\n } catch (err) {\n toast({\n title: t('healthybowl.livestock.depth.groups.toast.deleteFailed', 'Could not delete group'),\n description: err instanceof Error ? err.message : String(err),\n variant: 'error',\n });\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <Modal\n open={open}\n onClose={onClose}\n title={t('healthybowl.livestock.depth.groups.manage', 'Manage animal groups')}\n size=\"lg\"\n >\n <div className=\"space-y-4\">\n <div className=\"space-y-2\">\n {groups.length === 0 ? (\n <p className=\"text-sm text-text-secondary\">\n {t('healthybowl.livestock.depth.groups.none', 'No groups yet. Create one below.')}\n </p>\n ) : (\n groups.map((g) => (\n <div\n key={g.id}\n className=\"flex items-center justify-between rounded-md border border-border-subtle bg-bg-surface px-3 py-2\"\n >\n <div className=\"flex items-center gap-2\">\n {g.kind === 'SMART' ? <Network className=\"h-4 w-4 text-text-secondary\" /> : null}\n <span className=\"font-medium text-text-primary\">{g.name}</span>\n <StatusBadge variant={groupKindVariant(g.kind)} label={g.kind} />\n <span className=\"text-xs tabular-nums text-text-secondary\">\n {t('healthybowl.livestock.depth.groups.count', '{{n}} animals', { n: g.animalCount })}\n </span>\n </div>\n <div className=\"flex items-center gap-1\">\n <Button variant=\"ghost\" size=\"sm\" onClick={() => startEdit(g)} disabled={busy}>\n {t('healthybowl.livestock.depth.groups.edit', 'Edit')}\n </Button>\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n onClick={() => void handleDelete(g)}\n disabled={busy}\n aria-label={t('healthybowl.livestock.depth.groups.delete', 'Delete group')}\n className=\"text-text-secondary hover:text-status-error-text\"\n >\n <Trash2 className=\"h-4 w-4\" />\n </Button>\n </div>\n </div>\n ))\n )}\n </div>\n\n <div className=\"rounded-lg border border-border-subtle p-3\">\n <h4 className=\"mb-2 text-sm font-semibold text-text-primary\">\n {editing\n ? t('healthybowl.livestock.depth.groups.editHeading', 'Edit group')\n : t('healthybowl.livestock.depth.groups.newHeading', 'New group')}\n </h4>\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2\">\n <div>\n <label className={fieldLabel}>{t('healthybowl.livestock.depth.groups.name', 'Name')}</label>\n <Input value={name} onChange={(e) => setName(e.target.value)} placeholder=\"Milking Herd\" />\n </div>\n <div>\n <label className={fieldLabel}>{t('healthybowl.livestock.depth.groups.kind', 'Type')}</label>\n <Select value={kind} onValueChange={setKind}>\n <SelectTrigger>\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {GROUP_KINDS.map((k) => (\n <SelectItem key={k} value={k}>\n {k}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n </div>\n <div className=\"mt-3\">\n <label className={fieldLabel}>{t('healthybowl.livestock.depth.groups.description', 'Description')}</label>\n <Textarea value={description} onChange={(e) => setDescription(e.target.value)} rows={2} />\n </div>\n {kind === 'SMART' ? (\n <div className=\"mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2\">\n <div>\n <label className={fieldLabel}>\n {t('healthybowl.livestock.depth.groups.ruleType', 'Rule: species')}\n </label>\n <Select value={ruleType} onValueChange={setRuleType}>\n <SelectTrigger>\n <SelectValue placeholder={t('healthybowl.livestock.depth.groups.anySpecies', 'Any species')} />\n </SelectTrigger>\n <SelectContent>\n {ANIMAL_TYPES.map((a) => (\n <SelectItem key={a} value={a}>\n {a}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div>\n <label className={fieldLabel}>\n {t('healthybowl.livestock.depth.groups.ruleProduction', 'Rule: production type')}\n </label>\n <Input value={ruleProduction} onChange={(e) => setRuleProduction(e.target.value)} placeholder=\"DAIRY\" />\n </div>\n </div>\n ) : null}\n <div className=\"mt-4 flex items-center gap-2\">\n <Button onClick={() => void handleSubmit()} disabled={busy || !name.trim()}>\n <Plus className=\"h-4 w-4\" />\n {editing\n ? t('healthybowl.livestock.depth.groups.save', 'Save group')\n : t('healthybowl.livestock.depth.groups.create', 'Create group')}\n </Button>\n {editing ? (\n <Button variant=\"ghost\" onClick={resetForm} disabled={busy}>\n {t('healthybowl.livestock.depth.groups.cancel', 'Cancel')}\n </Button>\n ) : null}\n </div>\n </div>\n </div>\n </Modal>\n );\n};\n"],"mappings":";;;;;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