@burdenoff/microfe-healthybowl 2026.1017.1 โ 2026.1017.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -24,7 +24,7 @@ import { Button as d, ResponsiveTable as Ee, Select as f, SelectContent as p, Se
|
|
|
24
24
|
import { useAssistantPageControls as De } from "@burdenoff/fe-libs/shared/assistant/appControls/useAssistantControl";
|
|
25
25
|
import { tabsOf as Oe } from "@burdenoff/fe-libs/shared/assistant/appControls/pageAdapters";
|
|
26
26
|
//#region src/healthybowl/pages/livestock/AnimalDetailsPage.tsx
|
|
27
|
-
var
|
|
27
|
+
var _ = (e) => {
|
|
28
28
|
switch (e) {
|
|
29
29
|
case "healthy": return "success";
|
|
30
30
|
case "pregnant": return "info";
|
|
@@ -33,7 +33,7 @@ var ke = (e) => {
|
|
|
33
33
|
case "quarantine": return "error";
|
|
34
34
|
default: return "muted";
|
|
35
35
|
}
|
|
36
|
-
},
|
|
36
|
+
}, ke = (e) => {
|
|
37
37
|
switch (e) {
|
|
38
38
|
case "cattle":
|
|
39
39
|
case "buffalo": return "๐";
|
|
@@ -43,124 +43,124 @@ var ke = (e) => {
|
|
|
43
43
|
case "poultry": return "๐";
|
|
44
44
|
default: return "๐พ";
|
|
45
45
|
}
|
|
46
|
-
},
|
|
47
|
-
let { animals:
|
|
46
|
+
}, v = () => {
|
|
47
|
+
let { animals: v, healthRecords: y, vaccinations: Ae, breedingRecords: je, productionRecords: Me, updateAnimal: Ne, deleteAnimal: Pe, errors: Fe, loadings: Ie, refetch: Le } = ue(), { t: b } = fe(), Re = ie(), { animalId: x } = we(), S = Ce(), { buildPath: C } = ee(), [w, T] = o("overview"), [ze, E] = o(!1), [D, O] = o(!1), { toasts: Be, toast: k, dismiss: Ve } = ce(), A = v.find((e) => e.id === x), [j, M] = o(""), [N, P] = o(""), [F, I] = o(""), [L, R] = o(""), [z, B] = o(""), [V, H] = o(""), [U, He] = o(""), [Ue, We] = o(""), [W, Ge] = o(""), [G, Ke] = o(""), [K, qe] = o(""), [Je, Ye] = o([]), q = a(() => [
|
|
48
48
|
{
|
|
49
49
|
id: "overview",
|
|
50
|
-
label:
|
|
50
|
+
label: b("healthybowl.livestock.animalDetails.tabs.overview", "Overview")
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
id: "health",
|
|
54
|
-
label:
|
|
54
|
+
label: b("healthybowl.livestock.animalDetails.tabs.health", "Health")
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
id: "breeding",
|
|
58
|
-
label:
|
|
58
|
+
label: b("healthybowl.livestock.animalDetails.tabs.breeding", "Breeding")
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
id: "production",
|
|
62
|
-
label:
|
|
62
|
+
label: b("healthybowl.livestock.animalDetails.tabs.production", "Production")
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
id: "timeline",
|
|
66
|
-
label:
|
|
66
|
+
label: b("healthybowl.livestock.animalDetails.tabs.timeline", "Timeline")
|
|
67
67
|
}
|
|
68
|
-
], [
|
|
69
|
-
De(a(() =>
|
|
70
|
-
page:
|
|
68
|
+
], [b]);
|
|
69
|
+
De(a(() => A ? {
|
|
70
|
+
page: b("healthybowl.livestock.animalDetails.assistant.page", "Animal details"),
|
|
71
71
|
tabs: Oe({
|
|
72
72
|
items: q,
|
|
73
|
-
value:
|
|
74
|
-
set:
|
|
73
|
+
value: w,
|
|
74
|
+
set: T
|
|
75
75
|
})
|
|
76
76
|
} : null, [
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
A,
|
|
78
|
+
b,
|
|
79
79
|
q,
|
|
80
|
-
|
|
80
|
+
w
|
|
81
81
|
]));
|
|
82
82
|
let Xe = () => {
|
|
83
|
-
|
|
83
|
+
A && (M(A.name), P(A.type), I(A.breed), R(A.gender), B(A.healthStatus), H(A.tagNumber), He(String(A.vaccinations ?? 0)), We(String(A.weight ?? 0)), Ge(A.dateOfBirth ?? ""), Ke(A.lastCheckup ?? ""), qe(A.productionType ?? ""), Ye(A.imageIds ?? []), E(!0));
|
|
84
84
|
}, Ze = async () => {
|
|
85
|
-
if (
|
|
86
|
-
if (!
|
|
87
|
-
|
|
88
|
-
title:
|
|
89
|
-
description:
|
|
85
|
+
if (A) {
|
|
86
|
+
if (!j.trim() || !V.trim()) {
|
|
87
|
+
k({
|
|
88
|
+
title: b("healthybowl.livestock.animalDetails.toast.missingFields.title", "Missing required fields"),
|
|
89
|
+
description: b("healthybowl.livestock.animalDetails.toast.missingFields.description", "Name and tag number are required."),
|
|
90
90
|
variant: "warning"
|
|
91
91
|
});
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
O(!0);
|
|
95
95
|
try {
|
|
96
|
-
await
|
|
97
|
-
id:
|
|
98
|
-
name:
|
|
99
|
-
type:
|
|
100
|
-
breed:
|
|
101
|
-
gender:
|
|
102
|
-
healthStatus:
|
|
103
|
-
tagNumber:
|
|
104
|
-
vaccinations: Number(
|
|
96
|
+
await Ne({
|
|
97
|
+
id: A.id,
|
|
98
|
+
name: j.trim(),
|
|
99
|
+
type: N.trim() || "unknown",
|
|
100
|
+
breed: F.trim() || "Unknown",
|
|
101
|
+
gender: L.trim() || "unknown",
|
|
102
|
+
healthStatus: z.trim() || "healthy",
|
|
103
|
+
tagNumber: V.trim(),
|
|
104
|
+
vaccinations: Number(U) || 0,
|
|
105
105
|
weight: Number(Ue) || 0,
|
|
106
106
|
imageIds: Je,
|
|
107
107
|
...W ? { dateOfBirth: W } : {},
|
|
108
108
|
...G ? { lastCheckup: G } : {},
|
|
109
109
|
...K.trim() ? { productionType: K.trim() } : {}
|
|
110
|
-
}),
|
|
111
|
-
title:
|
|
112
|
-
description:
|
|
110
|
+
}), k({
|
|
111
|
+
title: b("healthybowl.livestock.animalDetails.toast.updated.title", "Animal updated"),
|
|
112
|
+
description: b("healthybowl.livestock.animalDetails.toast.updated.description", "{{name}} has been saved.", { name: j.trim() }),
|
|
113
113
|
variant: "success"
|
|
114
|
-
}),
|
|
114
|
+
}), E(!1);
|
|
115
115
|
} catch (e) {
|
|
116
|
-
|
|
117
|
-
title:
|
|
116
|
+
k({
|
|
117
|
+
title: b("healthybowl.livestock.animalDetails.toast.updateFailed.title", "Update failed"),
|
|
118
118
|
description: String(e),
|
|
119
119
|
variant: "error"
|
|
120
120
|
});
|
|
121
121
|
} finally {
|
|
122
|
-
|
|
122
|
+
O(!1);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
}, J = a(() =>
|
|
126
|
-
if (
|
|
127
|
-
title:
|
|
128
|
-
message: $e > 0 ?
|
|
129
|
-
name:
|
|
130
|
-
tagNumber:
|
|
125
|
+
}, J = a(() => A ? y.filter((e) => e.animalId === A.id) : [], [y, A]), Y = a(() => A ? Ae.filter((e) => e.animalId === A.id) : [], [Ae, A]), X = a(() => A ? je.filter((e) => e.femaleId === A.id || e.maleId === A.id) : [], [je, A]), Z = a(() => A ? Me.filter((e) => e.animalId === A.id) : [], [Me, A]), Qe = a(() => A ? X.filter((e) => e.femaleId === A.id) : [], [X, A]), $e = J.length + Y.length + Qe.length + Z.length, et = async () => {
|
|
126
|
+
if (A && await Re({
|
|
127
|
+
title: b("healthybowl.livestock.animalDetails.confirmDelete.title", "Delete animal?"),
|
|
128
|
+
message: $e > 0 ? b("healthybowl.livestock.animalDetails.confirmDelete.messageWithRecords", "{{name}} ({{tagNumber}}) will be permanently removed. At least {{records}} of its records โ health, vaccination, breeding and production โ will stop appearing in your livestock totals. Feed records naming this animal cannot be counted here, so the real figure may be higher.", {
|
|
129
|
+
name: A.name,
|
|
130
|
+
tagNumber: A.tagNumber,
|
|
131
131
|
records: $e
|
|
132
|
-
}) :
|
|
133
|
-
name:
|
|
134
|
-
tagNumber:
|
|
132
|
+
}) : b("healthybowl.livestock.animalDetails.confirmDelete.message", "{{name}} ({{tagNumber}}) will be permanently removed.", {
|
|
133
|
+
name: A.name,
|
|
134
|
+
tagNumber: A.tagNumber
|
|
135
135
|
}),
|
|
136
|
-
okButtonTitle:
|
|
137
|
-
cancelButtonTitle:
|
|
136
|
+
okButtonTitle: b("healthybowl.common.delete", "Delete"),
|
|
137
|
+
cancelButtonTitle: b("healthybowl.common.cancel", "Cancel")
|
|
138
138
|
}) !== !1) {
|
|
139
|
-
|
|
139
|
+
O(!0);
|
|
140
140
|
try {
|
|
141
|
-
await
|
|
142
|
-
title:
|
|
143
|
-
description:
|
|
141
|
+
await Pe(A.id), k({
|
|
142
|
+
title: b("healthybowl.livestock.animalDetails.toast.deleted.title", "Animal deleted"),
|
|
143
|
+
description: b("healthybowl.livestock.animalDetails.toast.deleted.description", "{{name}} has been removed.", { name: A.name }),
|
|
144
144
|
variant: "success"
|
|
145
|
-
}),
|
|
145
|
+
}), S(C("livestock/animals"));
|
|
146
146
|
} catch (e) {
|
|
147
|
-
|
|
148
|
-
title:
|
|
147
|
+
k({
|
|
148
|
+
title: b("healthybowl.livestock.animalDetails.toast.deleteFailed.title", "Delete failed"),
|
|
149
149
|
description: String(e),
|
|
150
150
|
variant: "error"
|
|
151
|
-
}),
|
|
151
|
+
}), O(!1);
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
}, Q = Z.filter((e) => e.type === "milk"), tt = Q.length > 0 ? Q.reduce((e, t) => e + t.quantity, 0) / Q.length : 0, nt = J.length > 0 ? Math.max(0, 100 - J.filter((e) => e.status === "active" || e.status === "monitoring").length * 15) : 100, $ = Z.length > 0 ? Z[0] : null, rt = a(() => [
|
|
155
155
|
{
|
|
156
156
|
key: "date",
|
|
157
|
-
header:
|
|
157
|
+
header: b("healthybowl.livestock.animalDetails.production.table.date", "Date"),
|
|
158
158
|
cell: (t) => e(t.date),
|
|
159
159
|
priority: "primary"
|
|
160
160
|
},
|
|
161
161
|
{
|
|
162
162
|
key: "type",
|
|
163
|
-
header:
|
|
163
|
+
header: b("healthybowl.livestock.animalDetails.production.table.type", "Type"),
|
|
164
164
|
cell: (e) => /* @__PURE__ */ l("span", {
|
|
165
165
|
className: "capitalize",
|
|
166
166
|
children: e.type
|
|
@@ -169,7 +169,7 @@ var ke = (e) => {
|
|
|
169
169
|
},
|
|
170
170
|
{
|
|
171
171
|
key: "quantity",
|
|
172
|
-
header:
|
|
172
|
+
header: b("healthybowl.livestock.animalDetails.production.table.quantity", "Quantity"),
|
|
173
173
|
cell: (e) => /* @__PURE__ */ u("span", {
|
|
174
174
|
className: "tabular-nums",
|
|
175
175
|
children: [
|
|
@@ -184,20 +184,20 @@ var ke = (e) => {
|
|
|
184
184
|
},
|
|
185
185
|
{
|
|
186
186
|
key: "quality",
|
|
187
|
-
header:
|
|
187
|
+
header: b("healthybowl.livestock.animalDetails.production.table.quality", "Quality"),
|
|
188
188
|
cell: (e) => /* @__PURE__ */ l(i, {
|
|
189
189
|
label: (e.quality ?? "").replace("_", " "),
|
|
190
190
|
variant: e.quality === "premium" ? "success" : e.quality === "standard" ? "info" : "warning"
|
|
191
191
|
}),
|
|
192
192
|
priority: "secondary"
|
|
193
193
|
}
|
|
194
|
-
], [
|
|
194
|
+
], [b]), it = a(() => {
|
|
195
195
|
let e = [];
|
|
196
196
|
for (let t of J) e.push({
|
|
197
197
|
id: t.id,
|
|
198
198
|
date: t.date,
|
|
199
199
|
category: "Health",
|
|
200
|
-
categoryLabel:
|
|
200
|
+
categoryLabel: b("healthybowl.livestock.animalDetails.timeline.category.health", "Health"),
|
|
201
201
|
title: `${t.type} - ${t.diagnosis}`,
|
|
202
202
|
detail: t.veterinarian
|
|
203
203
|
});
|
|
@@ -205,7 +205,7 @@ var ke = (e) => {
|
|
|
205
205
|
id: t.id,
|
|
206
206
|
date: t.administrationDate,
|
|
207
207
|
category: "Vaccination",
|
|
208
|
-
categoryLabel:
|
|
208
|
+
categoryLabel: b("healthybowl.livestock.animalDetails.timeline.category.vaccination", "Vaccination"),
|
|
209
209
|
title: t.vaccineName,
|
|
210
210
|
detail: t.veterinarian
|
|
211
211
|
});
|
|
@@ -213,7 +213,7 @@ var ke = (e) => {
|
|
|
213
213
|
id: t.id,
|
|
214
214
|
date: t.date,
|
|
215
215
|
category: "Production",
|
|
216
|
-
categoryLabel:
|
|
216
|
+
categoryLabel: b("healthybowl.livestock.animalDetails.timeline.category.production", "Production"),
|
|
217
217
|
title: `${t.type} - ${t.quantity} ${t.unit}`,
|
|
218
218
|
detail: t.quality
|
|
219
219
|
});
|
|
@@ -222,26 +222,26 @@ var ke = (e) => {
|
|
|
222
222
|
J,
|
|
223
223
|
Y,
|
|
224
224
|
Z,
|
|
225
|
-
|
|
225
|
+
b
|
|
226
226
|
]);
|
|
227
|
-
return
|
|
228
|
-
title: `${
|
|
229
|
-
description: `${
|
|
227
|
+
return A ? /* @__PURE__ */ u(n, {
|
|
228
|
+
title: `${A.name} (${A.tagNumber})`,
|
|
229
|
+
description: `${A.breed} ${A.type}`,
|
|
230
230
|
actions: /* @__PURE__ */ u("div", {
|
|
231
|
-
className: "flex items-center gap-2",
|
|
231
|
+
className: "flex flex-wrap items-center gap-2",
|
|
232
232
|
children: [
|
|
233
233
|
/* @__PURE__ */ l(le, {
|
|
234
234
|
entityType: "ANIMAL",
|
|
235
|
-
entityId:
|
|
236
|
-
entityLabel: `${
|
|
235
|
+
entityId: A.id,
|
|
236
|
+
entityLabel: `${A.name} (${A.tagNumber})`
|
|
237
237
|
}),
|
|
238
238
|
/* @__PURE__ */ u(d, {
|
|
239
239
|
variant: "outline",
|
|
240
|
-
onClick: () =>
|
|
240
|
+
onClick: () => S(C("livestock/animals")),
|
|
241
241
|
children: [
|
|
242
242
|
/* @__PURE__ */ l(pe, { className: "h-4 w-4" }),
|
|
243
243
|
" ",
|
|
244
|
-
|
|
244
|
+
b("healthybowl.common.back", "Back")
|
|
245
245
|
]
|
|
246
246
|
}),
|
|
247
247
|
/* @__PURE__ */ u(d, {
|
|
@@ -249,17 +249,17 @@ var ke = (e) => {
|
|
|
249
249
|
children: [
|
|
250
250
|
/* @__PURE__ */ l(ge, { className: "h-4 w-4" }),
|
|
251
251
|
" ",
|
|
252
|
-
|
|
252
|
+
b("healthybowl.livestock.animalDetails.actions.editDetails", "Edit Details")
|
|
253
253
|
]
|
|
254
254
|
}),
|
|
255
255
|
/* @__PURE__ */ u(d, {
|
|
256
256
|
variant: "destructive",
|
|
257
257
|
onClick: et,
|
|
258
|
-
disabled:
|
|
258
|
+
disabled: D,
|
|
259
259
|
children: [
|
|
260
260
|
/* @__PURE__ */ l(be, { className: "h-4 w-4" }),
|
|
261
261
|
" ",
|
|
262
|
-
|
|
262
|
+
b("healthybowl.common.delete", "Delete")
|
|
263
263
|
]
|
|
264
264
|
})
|
|
265
265
|
]
|
|
@@ -268,21 +268,21 @@ var ke = (e) => {
|
|
|
268
268
|
nextSteps: [
|
|
269
269
|
{
|
|
270
270
|
id: "health",
|
|
271
|
-
label:
|
|
272
|
-
description:
|
|
273
|
-
onClick: () =>
|
|
271
|
+
label: b("healthybowl.livestock.animalDetails.nextSteps.health.label", "Review health records"),
|
|
272
|
+
description: b("healthybowl.livestock.animalDetails.nextSteps.health.desc", "Check treatments, vaccinations and any concerns for this animal."),
|
|
273
|
+
onClick: () => T("health")
|
|
274
274
|
},
|
|
275
275
|
{
|
|
276
276
|
id: "breeding",
|
|
277
|
-
label:
|
|
278
|
-
description:
|
|
279
|
-
onClick: () =>
|
|
277
|
+
label: b("healthybowl.livestock.animalDetails.nextSteps.breeding.label", "Check breeding history"),
|
|
278
|
+
description: b("healthybowl.livestock.animalDetails.nextSteps.breeding.desc", "See matings, pregnancies and offspring for this animal."),
|
|
279
|
+
onClick: () => T("breeding")
|
|
280
280
|
},
|
|
281
281
|
{
|
|
282
282
|
id: "production",
|
|
283
|
-
label:
|
|
284
|
-
description:
|
|
285
|
-
onClick: () =>
|
|
283
|
+
label: b("healthybowl.livestock.animalDetails.nextSteps.production.label", "Log production output"),
|
|
284
|
+
description: b("healthybowl.livestock.animalDetails.nextSteps.production.desc", "Record milk, eggs, wool or other output this animal produces."),
|
|
285
|
+
onClick: () => T("production")
|
|
286
286
|
}
|
|
287
287
|
],
|
|
288
288
|
nextStepsKey: "healthybowl-animal-detail",
|
|
@@ -291,16 +291,16 @@ var ke = (e) => {
|
|
|
291
291
|
className: "flex flex-wrap items-center gap-3",
|
|
292
292
|
children: [
|
|
293
293
|
/* @__PURE__ */ l(i, {
|
|
294
|
-
label: (
|
|
295
|
-
variant:
|
|
294
|
+
label: (A.healthStatus ?? "").replace("_", " "),
|
|
295
|
+
variant: _(A.healthStatus),
|
|
296
296
|
dot: !0
|
|
297
297
|
}),
|
|
298
298
|
/* @__PURE__ */ l(i, {
|
|
299
|
-
label:
|
|
299
|
+
label: A.gender,
|
|
300
300
|
variant: "muted"
|
|
301
301
|
}),
|
|
302
|
-
|
|
303
|
-
label:
|
|
302
|
+
A.productionType && /* @__PURE__ */ l(i, {
|
|
303
|
+
label: A.productionType,
|
|
304
304
|
variant: "info"
|
|
305
305
|
})
|
|
306
306
|
]
|
|
@@ -311,83 +311,83 @@ var ke = (e) => {
|
|
|
311
311
|
className: "-mb-px flex gap-6 overflow-x-auto",
|
|
312
312
|
children: q.map((e) => /* @__PURE__ */ l("button", {
|
|
313
313
|
type: "button",
|
|
314
|
-
onClick: () =>
|
|
315
|
-
className: `whitespace-nowrap border-b-2 py-2 px-1 text-sm font-medium ${
|
|
314
|
+
onClick: () => T(e.id),
|
|
315
|
+
className: `whitespace-nowrap border-b-2 py-2 px-1 text-sm font-medium ${w === e.id ? "border-primary text-primary" : "border-transparent text-text-secondary hover:text-text-primary hover:border-border-subtle"}`,
|
|
316
316
|
children: e.label
|
|
317
317
|
}, e.id))
|
|
318
318
|
})
|
|
319
319
|
}),
|
|
320
|
-
|
|
320
|
+
w === "overview" && /* @__PURE__ */ u("div", {
|
|
321
321
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
322
322
|
children: [/* @__PURE__ */ u("div", {
|
|
323
323
|
className: "lg:col-span-2 space-y-6",
|
|
324
324
|
children: [
|
|
325
|
-
|
|
325
|
+
x ? /* @__PURE__ */ l(de, { animalId: x }) : null,
|
|
326
326
|
/* @__PURE__ */ u("div", {
|
|
327
327
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm",
|
|
328
328
|
children: [
|
|
329
329
|
/* @__PURE__ */ l("h3", {
|
|
330
330
|
className: "mb-4 text-sm font-medium text-text-primary",
|
|
331
|
-
children:
|
|
331
|
+
children: b("healthybowl.livestock.animalDetails.basicInfo.title", "Basic Information")
|
|
332
332
|
}),
|
|
333
333
|
/* @__PURE__ */ u("div", {
|
|
334
334
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
335
335
|
children: [
|
|
336
336
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
337
337
|
className: "text-xs text-text-secondary",
|
|
338
|
-
children:
|
|
338
|
+
children: b("healthybowl.livestock.animalDetails.fields.type", "Type")
|
|
339
339
|
}), /* @__PURE__ */ u("p", {
|
|
340
340
|
className: "mt-1 flex items-center gap-2 text-sm font-medium capitalize text-text-primary",
|
|
341
341
|
children: [/* @__PURE__ */ l("span", {
|
|
342
342
|
className: "text-xl",
|
|
343
|
-
children:
|
|
344
|
-
}),
|
|
343
|
+
children: ke(A.type)
|
|
344
|
+
}), A.type]
|
|
345
345
|
})] }),
|
|
346
346
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
347
347
|
className: "text-xs text-text-secondary",
|
|
348
|
-
children:
|
|
348
|
+
children: b("healthybowl.livestock.animalDetails.fields.breed", "Breed")
|
|
349
349
|
}), /* @__PURE__ */ l("p", {
|
|
350
350
|
className: "mt-1 text-sm font-medium text-text-primary",
|
|
351
|
-
children:
|
|
351
|
+
children: A.breed
|
|
352
352
|
})] }),
|
|
353
353
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
354
354
|
className: "text-xs text-text-secondary",
|
|
355
|
-
children:
|
|
355
|
+
children: b("healthybowl.livestock.animalDetails.fields.gender", "Gender")
|
|
356
356
|
}), /* @__PURE__ */ l("p", {
|
|
357
357
|
className: "mt-1 text-sm font-medium capitalize text-text-primary",
|
|
358
|
-
children:
|
|
358
|
+
children: A.gender
|
|
359
359
|
})] }),
|
|
360
360
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
361
361
|
className: "text-xs text-text-secondary",
|
|
362
|
-
children:
|
|
362
|
+
children: b("healthybowl.livestock.animalDetails.fields.dateOfBirth", "Date of Birth")
|
|
363
363
|
}), /* @__PURE__ */ l("p", {
|
|
364
364
|
className: "mt-1 text-sm font-medium text-text-primary",
|
|
365
|
-
children: e(
|
|
365
|
+
children: e(A.dateOfBirth)
|
|
366
366
|
})] }),
|
|
367
367
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
368
368
|
className: "text-xs text-text-secondary",
|
|
369
|
-
children:
|
|
369
|
+
children: b("healthybowl.livestock.animalDetails.fields.currentWeight", "Current Weight")
|
|
370
370
|
}), /* @__PURE__ */ u("p", {
|
|
371
371
|
className: "mt-1 text-sm font-medium text-text-primary",
|
|
372
|
-
children: [t(
|
|
372
|
+
children: [t(A.weight ?? 0), " kg"]
|
|
373
373
|
})] }),
|
|
374
374
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
375
375
|
className: "text-xs text-text-secondary",
|
|
376
|
-
children:
|
|
376
|
+
children: b("healthybowl.livestock.animalDetails.fields.lastCheckup", "Last Checkup")
|
|
377
377
|
}), /* @__PURE__ */ l("p", {
|
|
378
378
|
className: "mt-1 text-sm font-medium text-text-primary",
|
|
379
|
-
children: e(
|
|
379
|
+
children: e(A.lastCheckup)
|
|
380
380
|
})] })
|
|
381
381
|
]
|
|
382
382
|
}),
|
|
383
|
-
(
|
|
383
|
+
(A.imageIds ?? []).length > 0 && /* @__PURE__ */ u("div", {
|
|
384
384
|
className: "mt-4",
|
|
385
385
|
children: [/* @__PURE__ */ l("p", {
|
|
386
386
|
className: "mb-2 text-xs text-text-secondary",
|
|
387
|
-
children:
|
|
387
|
+
children: b("healthybowl.livestock.animalDetails.fields.photos", "Photos")
|
|
388
388
|
}), /* @__PURE__ */ l(se, {
|
|
389
389
|
entity: "Animal",
|
|
390
|
-
imageIds:
|
|
390
|
+
imageIds: A.imageIds ?? [],
|
|
391
391
|
onChange: () => {},
|
|
392
392
|
readOnly: !0
|
|
393
393
|
})]
|
|
@@ -400,13 +400,13 @@ var ke = (e) => {
|
|
|
400
400
|
className: "mb-4 flex items-center justify-between",
|
|
401
401
|
children: [/* @__PURE__ */ l("h3", {
|
|
402
402
|
className: "text-sm font-medium text-text-primary",
|
|
403
|
-
children:
|
|
403
|
+
children: b("healthybowl.livestock.animalDetails.recentActivity.title", "Recent Activity")
|
|
404
404
|
}), /* @__PURE__ */ l(d, {
|
|
405
405
|
variant: "link",
|
|
406
406
|
size: "sm",
|
|
407
|
-
onClick: () =>
|
|
407
|
+
onClick: () => T("health"),
|
|
408
408
|
className: "text-xs",
|
|
409
|
-
children:
|
|
409
|
+
children: b("healthybowl.livestock.animalDetails.recentActivity.viewAll", "View All")
|
|
410
410
|
})]
|
|
411
411
|
}), J.length > 0 ? /* @__PURE__ */ l("div", {
|
|
412
412
|
className: "flex flex-col gap-3",
|
|
@@ -436,7 +436,7 @@ var ke = (e) => {
|
|
|
436
436
|
}, t.id))
|
|
437
437
|
}) : /* @__PURE__ */ l("p", {
|
|
438
438
|
className: "py-4 text-center text-sm text-text-secondary",
|
|
439
|
-
children:
|
|
439
|
+
children: b("healthybowl.livestock.animalDetails.recentActivity.empty", "No recent activity")
|
|
440
440
|
})]
|
|
441
441
|
})
|
|
442
442
|
]
|
|
@@ -446,34 +446,34 @@ var ke = (e) => {
|
|
|
446
446
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm",
|
|
447
447
|
children: [/* @__PURE__ */ l("h3", {
|
|
448
448
|
className: "mb-4 text-sm font-medium text-text-primary",
|
|
449
|
-
children:
|
|
449
|
+
children: b("healthybowl.livestock.animalDetails.quickStats.title", "Quick Stats")
|
|
450
450
|
}), /* @__PURE__ */ u("div", {
|
|
451
451
|
className: "space-y-4",
|
|
452
452
|
children: [
|
|
453
453
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
454
454
|
className: "text-xs text-text-secondary",
|
|
455
|
-
children:
|
|
455
|
+
children: b("healthybowl.livestock.animalDetails.quickStats.avgDailyMilk", "Average Daily Milk")
|
|
456
456
|
}), /* @__PURE__ */ u("p", {
|
|
457
457
|
className: "text-xl font-bold text-text-primary",
|
|
458
458
|
children: [tt.toFixed(1), " L"]
|
|
459
459
|
})] }),
|
|
460
460
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
461
461
|
className: "text-xs text-text-secondary",
|
|
462
|
-
children:
|
|
462
|
+
children: b("healthybowl.livestock.animalDetails.quickStats.vaccinationRecords", "Vaccination records")
|
|
463
463
|
}), /* @__PURE__ */ l("p", {
|
|
464
464
|
className: "text-xl font-bold text-text-primary",
|
|
465
465
|
children: Y.length
|
|
466
466
|
})] }),
|
|
467
467
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
468
468
|
className: "text-xs text-text-secondary",
|
|
469
|
-
children:
|
|
469
|
+
children: b("healthybowl.livestock.animalDetails.quickStats.breedingRecords", "Breeding Records")
|
|
470
470
|
}), /* @__PURE__ */ l("p", {
|
|
471
471
|
className: "text-xl font-bold text-text-primary",
|
|
472
472
|
children: X.length
|
|
473
473
|
})] }),
|
|
474
474
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
475
475
|
className: "text-xs text-text-secondary",
|
|
476
|
-
children:
|
|
476
|
+
children: b("healthybowl.livestock.animalDetails.quickStats.healthScore", "Health Score")
|
|
477
477
|
}), /* @__PURE__ */ u("div", {
|
|
478
478
|
className: "mt-1",
|
|
479
479
|
children: [/* @__PURE__ */ l("div", {
|
|
@@ -493,37 +493,37 @@ var ke = (e) => {
|
|
|
493
493
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm",
|
|
494
494
|
children: [/* @__PURE__ */ l("h3", {
|
|
495
495
|
className: "mb-4 text-sm font-medium text-text-primary",
|
|
496
|
-
children:
|
|
496
|
+
children: b("healthybowl.livestock.animalDetails.quickActions.title", "Quick Actions")
|
|
497
497
|
}), /* @__PURE__ */ l("div", {
|
|
498
498
|
className: "flex flex-col gap-2",
|
|
499
499
|
children: [
|
|
500
500
|
{
|
|
501
501
|
id: "recordHealthCheck",
|
|
502
|
-
label:
|
|
502
|
+
label: b("healthybowl.livestock.animalDetails.quickActions.recordHealthCheck", "Record Health Check"),
|
|
503
503
|
icon: _e,
|
|
504
504
|
path: "livestock/health"
|
|
505
505
|
},
|
|
506
506
|
{
|
|
507
507
|
id: "addVaccination",
|
|
508
|
-
label:
|
|
508
|
+
label: b("healthybowl.livestock.animalDetails.quickActions.addVaccination", "Add Vaccination"),
|
|
509
509
|
icon: ye,
|
|
510
510
|
path: "livestock/vaccinations"
|
|
511
511
|
},
|
|
512
512
|
{
|
|
513
513
|
id: "updateWeight",
|
|
514
|
-
label:
|
|
514
|
+
label: b("healthybowl.livestock.animalDetails.quickActions.updateWeight", "Update Weight"),
|
|
515
515
|
icon: Se,
|
|
516
|
-
path: `livestock/animals/${
|
|
516
|
+
path: `livestock/animals/${A.id}`
|
|
517
517
|
},
|
|
518
518
|
{
|
|
519
519
|
id: "recordProduction",
|
|
520
|
-
label:
|
|
520
|
+
label: b("healthybowl.livestock.animalDetails.quickActions.recordProduction", "Record Production"),
|
|
521
521
|
icon: s,
|
|
522
522
|
path: "livestock/production"
|
|
523
523
|
}
|
|
524
524
|
].map((e) => /* @__PURE__ */ u(d, {
|
|
525
525
|
variant: "outline",
|
|
526
|
-
onClick: () =>
|
|
526
|
+
onClick: () => S(C(e.path)),
|
|
527
527
|
className: "justify-start",
|
|
528
528
|
children: [/* @__PURE__ */ l(e.icon, { className: "h-4 w-4 text-text-secondary" }), e.label]
|
|
529
529
|
}, e.id))
|
|
@@ -531,7 +531,7 @@ var ke = (e) => {
|
|
|
531
531
|
})]
|
|
532
532
|
})]
|
|
533
533
|
}),
|
|
534
|
-
|
|
534
|
+
w === "health" && /* @__PURE__ */ u("div", {
|
|
535
535
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
536
536
|
children: [/* @__PURE__ */ u("div", {
|
|
537
537
|
className: "lg:col-span-2 space-y-6",
|
|
@@ -541,15 +541,15 @@ var ke = (e) => {
|
|
|
541
541
|
className: "mb-4 flex items-center justify-between",
|
|
542
542
|
children: [/* @__PURE__ */ l("h3", {
|
|
543
543
|
className: "text-sm font-medium text-text-primary",
|
|
544
|
-
children:
|
|
544
|
+
children: b("healthybowl.livestock.animalDetails.healthRecords.title", "Health Records")
|
|
545
545
|
}), /* @__PURE__ */ u(d, {
|
|
546
546
|
size: "sm",
|
|
547
|
-
onClick: () =>
|
|
547
|
+
onClick: () => S(C("livestock/health")),
|
|
548
548
|
className: "text-xs",
|
|
549
549
|
children: [
|
|
550
550
|
/* @__PURE__ */ l(c, { className: "h-3.5 w-3.5" }),
|
|
551
551
|
" ",
|
|
552
|
-
|
|
552
|
+
b("healthybowl.livestock.animalDetails.healthRecords.add", "Add Record")
|
|
553
553
|
]
|
|
554
554
|
})]
|
|
555
555
|
}), J.length > 0 ? /* @__PURE__ */ l("div", {
|
|
@@ -577,7 +577,7 @@ var ke = (e) => {
|
|
|
577
577
|
}),
|
|
578
578
|
t.treatment && /* @__PURE__ */ l("p", {
|
|
579
579
|
className: "text-xs text-text-secondary",
|
|
580
|
-
children:
|
|
580
|
+
children: b("healthybowl.livestock.animalDetails.healthRecords.treatment", "Treatment: {{treatment}}", { treatment: t.treatment })
|
|
581
581
|
}),
|
|
582
582
|
/* @__PURE__ */ u("p", {
|
|
583
583
|
className: "text-xs text-text-secondary",
|
|
@@ -593,7 +593,7 @@ var ke = (e) => {
|
|
|
593
593
|
}, t.id))
|
|
594
594
|
}) : /* @__PURE__ */ l("p", {
|
|
595
595
|
className: "py-4 text-center text-sm text-text-secondary",
|
|
596
|
-
children:
|
|
596
|
+
children: b("healthybowl.livestock.animalDetails.healthRecords.empty", "No health records")
|
|
597
597
|
})]
|
|
598
598
|
}), /* @__PURE__ */ u("div", {
|
|
599
599
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm",
|
|
@@ -601,16 +601,16 @@ var ke = (e) => {
|
|
|
601
601
|
className: "mb-4 flex items-center justify-between",
|
|
602
602
|
children: [/* @__PURE__ */ l("h3", {
|
|
603
603
|
className: "text-sm font-medium text-text-primary",
|
|
604
|
-
children:
|
|
604
|
+
children: b("healthybowl.livestock.animalDetails.vaccinations.title", "Vaccination History")
|
|
605
605
|
}), /* @__PURE__ */ u(d, {
|
|
606
606
|
variant: "outline",
|
|
607
607
|
size: "sm",
|
|
608
|
-
onClick: () =>
|
|
608
|
+
onClick: () => S(C("livestock/vaccinations")),
|
|
609
609
|
className: "text-xs",
|
|
610
610
|
children: [
|
|
611
611
|
/* @__PURE__ */ l(me, { className: "h-3.5 w-3.5" }),
|
|
612
612
|
" ",
|
|
613
|
-
|
|
613
|
+
b("healthybowl.livestock.animalDetails.vaccinations.schedule", "Schedule")
|
|
614
614
|
]
|
|
615
615
|
})]
|
|
616
616
|
}), Y.length > 0 ? /* @__PURE__ */ l("div", {
|
|
@@ -622,12 +622,12 @@ var ke = (e) => {
|
|
|
622
622
|
children: t.vaccineName
|
|
623
623
|
}), /* @__PURE__ */ l("p", {
|
|
624
624
|
className: "text-xs text-text-secondary",
|
|
625
|
-
children:
|
|
625
|
+
children: b("healthybowl.livestock.animalDetails.vaccinations.givenOn", "Given on {{date}}", { date: e(t.administrationDate) })
|
|
626
626
|
})] }), /* @__PURE__ */ u("div", {
|
|
627
627
|
className: "text-end",
|
|
628
628
|
children: [/* @__PURE__ */ l("p", {
|
|
629
629
|
className: "text-xs text-text-secondary",
|
|
630
|
-
children:
|
|
630
|
+
children: b("healthybowl.livestock.animalDetails.vaccinations.nextDue", "Next due")
|
|
631
631
|
}), /* @__PURE__ */ l("p", {
|
|
632
632
|
className: "text-sm font-medium text-text-primary",
|
|
633
633
|
children: e(t.nextDueDate)
|
|
@@ -636,7 +636,7 @@ var ke = (e) => {
|
|
|
636
636
|
}, t.id))
|
|
637
637
|
}) : /* @__PURE__ */ l("p", {
|
|
638
638
|
className: "py-4 text-center text-sm text-text-secondary",
|
|
639
|
-
children:
|
|
639
|
+
children: b("healthybowl.livestock.animalDetails.vaccinations.empty", "No vaccination records")
|
|
640
640
|
})]
|
|
641
641
|
})]
|
|
642
642
|
}), /* @__PURE__ */ l("div", {
|
|
@@ -645,48 +645,48 @@ var ke = (e) => {
|
|
|
645
645
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm",
|
|
646
646
|
children: [/* @__PURE__ */ l("h3", {
|
|
647
647
|
className: "mb-4 text-sm font-medium text-text-primary",
|
|
648
|
-
children:
|
|
648
|
+
children: b("healthybowl.livestock.animalDetails.healthSummary.title", "Health Summary")
|
|
649
649
|
}), /* @__PURE__ */ u("div", {
|
|
650
650
|
className: "space-y-4",
|
|
651
651
|
children: [
|
|
652
652
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
653
653
|
className: "text-xs text-text-secondary",
|
|
654
|
-
children:
|
|
654
|
+
children: b("healthybowl.livestock.animalDetails.healthSummary.currentStatus", "Current Status")
|
|
655
655
|
}), /* @__PURE__ */ l("div", {
|
|
656
656
|
className: "mt-1",
|
|
657
657
|
children: /* @__PURE__ */ l(i, {
|
|
658
|
-
label: (
|
|
659
|
-
variant:
|
|
658
|
+
label: (A.healthStatus ?? "").replace("_", " "),
|
|
659
|
+
variant: _(A.healthStatus),
|
|
660
660
|
dot: !0
|
|
661
661
|
})
|
|
662
662
|
})] }),
|
|
663
663
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
664
664
|
className: "text-xs text-text-secondary",
|
|
665
|
-
children:
|
|
665
|
+
children: b("healthybowl.livestock.animalDetails.fields.lastCheckup", "Last Checkup")
|
|
666
666
|
}), /* @__PURE__ */ l("p", {
|
|
667
667
|
className: "text-sm font-medium text-text-primary",
|
|
668
|
-
children: e(
|
|
668
|
+
children: e(A.lastCheckup)
|
|
669
669
|
})] }),
|
|
670
670
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
671
671
|
className: "text-xs text-text-secondary",
|
|
672
|
-
children:
|
|
672
|
+
children: b("healthybowl.livestock.animalDetails.healthSummary.nextVaccination", "Next Vaccination")
|
|
673
673
|
}), /* @__PURE__ */ l("p", {
|
|
674
674
|
className: "text-sm font-medium text-text-primary",
|
|
675
|
-
children: Y.find((e) => e.status === "scheduled") ? `${Y.find((e) => e.status === "scheduled").vaccineName} - ${e(Y.find((e) => e.status === "scheduled").nextDueDate)}` :
|
|
675
|
+
children: Y.find((e) => e.status === "scheduled") ? `${Y.find((e) => e.status === "scheduled").vaccineName} - ${e(Y.find((e) => e.status === "scheduled").nextDueDate)}` : b("healthybowl.livestock.animalDetails.healthSummary.noneScheduled", "None scheduled")
|
|
676
676
|
})] }),
|
|
677
677
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
678
678
|
className: "text-xs text-text-secondary",
|
|
679
|
-
children:
|
|
679
|
+
children: b("healthybowl.livestock.animalDetails.healthSummary.profileVaccinationCount", "Vaccination count on profile")
|
|
680
680
|
}), /* @__PURE__ */ l("p", {
|
|
681
681
|
className: "text-xl font-bold text-text-primary",
|
|
682
|
-
children:
|
|
682
|
+
children: A.vaccinations ?? 0
|
|
683
683
|
})] })
|
|
684
684
|
]
|
|
685
685
|
})]
|
|
686
686
|
})
|
|
687
687
|
})]
|
|
688
688
|
}),
|
|
689
|
-
|
|
689
|
+
w === "breeding" && /* @__PURE__ */ l("div", {
|
|
690
690
|
className: "space-y-6",
|
|
691
691
|
children: /* @__PURE__ */ u("div", {
|
|
692
692
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm",
|
|
@@ -694,15 +694,15 @@ var ke = (e) => {
|
|
|
694
694
|
className: "mb-4 flex items-center justify-between",
|
|
695
695
|
children: [/* @__PURE__ */ l("h3", {
|
|
696
696
|
className: "text-sm font-medium text-text-primary",
|
|
697
|
-
children:
|
|
697
|
+
children: b("healthybowl.livestock.animalDetails.breeding.title", "Breeding History")
|
|
698
698
|
}), /* @__PURE__ */ u(d, {
|
|
699
699
|
size: "sm",
|
|
700
|
-
onClick: () =>
|
|
700
|
+
onClick: () => S(C("livestock/breeding")),
|
|
701
701
|
className: "text-xs",
|
|
702
702
|
children: [
|
|
703
703
|
/* @__PURE__ */ l(c, { className: "h-3.5 w-3.5" }),
|
|
704
704
|
" ",
|
|
705
|
-
|
|
705
|
+
b("healthybowl.livestock.animalDetails.healthRecords.add", "Add Record")
|
|
706
706
|
]
|
|
707
707
|
})]
|
|
708
708
|
}), X.length > 0 ? /* @__PURE__ */ l("div", {
|
|
@@ -715,7 +715,7 @@ var ke = (e) => {
|
|
|
715
715
|
/* @__PURE__ */ u("div", { children: [
|
|
716
716
|
/* @__PURE__ */ l("p", {
|
|
717
717
|
className: "text-xs text-text-secondary",
|
|
718
|
-
children:
|
|
718
|
+
children: b("healthybowl.livestock.animalDetails.breeding.matingDate", "Mating Date")
|
|
719
719
|
}),
|
|
720
720
|
/* @__PURE__ */ l("p", {
|
|
721
721
|
className: "text-sm font-medium text-text-primary",
|
|
@@ -728,14 +728,14 @@ var ke = (e) => {
|
|
|
728
728
|
] }),
|
|
729
729
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
730
730
|
className: "text-xs text-text-secondary",
|
|
731
|
-
children:
|
|
731
|
+
children: b("healthybowl.livestock.animalDetails.breeding.female", "Female")
|
|
732
732
|
}), /* @__PURE__ */ l("p", {
|
|
733
733
|
className: "text-sm font-medium text-text-primary",
|
|
734
734
|
children: t.femaleName
|
|
735
735
|
})] }),
|
|
736
736
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
737
737
|
className: "text-xs text-text-secondary",
|
|
738
|
-
children:
|
|
738
|
+
children: b("healthybowl.livestock.animalDetails.breeding.male", "Male")
|
|
739
739
|
}), /* @__PURE__ */ l("p", {
|
|
740
740
|
className: "text-sm font-medium text-text-primary",
|
|
741
741
|
children: t.maleName
|
|
@@ -743,7 +743,7 @@ var ke = (e) => {
|
|
|
743
743
|
/* @__PURE__ */ u("div", { children: [
|
|
744
744
|
/* @__PURE__ */ l("p", {
|
|
745
745
|
className: "text-xs text-text-secondary",
|
|
746
|
-
children:
|
|
746
|
+
children: b("healthybowl.livestock.animalDetails.breeding.status", "Status")
|
|
747
747
|
}),
|
|
748
748
|
/* @__PURE__ */ l(i, {
|
|
749
749
|
label: t.status,
|
|
@@ -751,7 +751,7 @@ var ke = (e) => {
|
|
|
751
751
|
}),
|
|
752
752
|
t.expectedDeliveryDate && /* @__PURE__ */ l("p", {
|
|
753
753
|
className: "mt-1 text-xs text-text-secondary",
|
|
754
|
-
children:
|
|
754
|
+
children: b("healthybowl.livestock.animalDetails.breeding.expected", "Expected: {{date}}", { date: e(t.expectedDeliveryDate) })
|
|
755
755
|
})
|
|
756
756
|
] })
|
|
757
757
|
]
|
|
@@ -759,30 +759,30 @@ var ke = (e) => {
|
|
|
759
759
|
}, t.id))
|
|
760
760
|
}) : /* @__PURE__ */ l("p", {
|
|
761
761
|
className: "py-8 text-center text-sm text-text-secondary",
|
|
762
|
-
children:
|
|
762
|
+
children: b("healthybowl.livestock.animalDetails.breeding.empty", "No breeding records for this animal")
|
|
763
763
|
})]
|
|
764
764
|
})
|
|
765
765
|
}),
|
|
766
|
-
|
|
766
|
+
w === "production" && /* @__PURE__ */ u("div", {
|
|
767
767
|
className: "space-y-6",
|
|
768
768
|
children: [/* @__PURE__ */ u("div", {
|
|
769
769
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
770
770
|
children: [
|
|
771
771
|
/* @__PURE__ */ l(r, {
|
|
772
772
|
hero: !0,
|
|
773
|
-
label:
|
|
773
|
+
label: b("healthybowl.livestock.animalDetails.production.stats.latest", "Latest Production"),
|
|
774
774
|
value: $ ? $.quantity : 0,
|
|
775
775
|
unit: $ ? $.unit : "",
|
|
776
776
|
icon: /* @__PURE__ */ l(s, { className: "h-4 w-4" })
|
|
777
777
|
}),
|
|
778
778
|
/* @__PURE__ */ l(r, {
|
|
779
|
-
label:
|
|
779
|
+
label: b("healthybowl.livestock.animalDetails.production.stats.avg", "Avg Production"),
|
|
780
780
|
value: Z.length > 0 ? parseFloat((Z.reduce((e, t) => e + t.quantity, 0) / Z.length).toFixed(1)) : 0,
|
|
781
781
|
unit: Z.length > 0 ? Z[0].unit : "",
|
|
782
782
|
icon: /* @__PURE__ */ l(xe, { className: "h-4 w-4" })
|
|
783
783
|
}),
|
|
784
784
|
/* @__PURE__ */ l(r, {
|
|
785
|
-
label:
|
|
785
|
+
label: b("healthybowl.livestock.animalDetails.production.stats.totalRecords", "Total Records"),
|
|
786
786
|
value: Z.length,
|
|
787
787
|
icon: /* @__PURE__ */ l(ve, { className: "h-4 w-4" })
|
|
788
788
|
})
|
|
@@ -793,15 +793,15 @@ var ke = (e) => {
|
|
|
793
793
|
className: "mb-4 flex items-center justify-between",
|
|
794
794
|
children: [/* @__PURE__ */ l("h3", {
|
|
795
795
|
className: "text-sm font-medium text-text-primary",
|
|
796
|
-
children:
|
|
796
|
+
children: b("healthybowl.livestock.animalDetails.production.recent.title", "Recent Production")
|
|
797
797
|
}), /* @__PURE__ */ u(d, {
|
|
798
798
|
size: "sm",
|
|
799
|
-
onClick: () =>
|
|
799
|
+
onClick: () => S(C("livestock/production")),
|
|
800
800
|
className: "text-xs",
|
|
801
801
|
children: [
|
|
802
802
|
/* @__PURE__ */ l(c, { className: "h-3.5 w-3.5" }),
|
|
803
803
|
" ",
|
|
804
|
-
|
|
804
|
+
b("healthybowl.livestock.animalDetails.production.recordProduction", "Record Production")
|
|
805
805
|
]
|
|
806
806
|
})]
|
|
807
807
|
}), Z.length > 0 ? /* @__PURE__ */ l(Ee, {
|
|
@@ -810,11 +810,11 @@ var ke = (e) => {
|
|
|
810
810
|
rowKey: (e) => String(e.id)
|
|
811
811
|
}) : /* @__PURE__ */ l("p", {
|
|
812
812
|
className: "py-8 text-center text-sm text-text-secondary",
|
|
813
|
-
children:
|
|
813
|
+
children: b("healthybowl.livestock.animalDetails.production.empty", "No production records for this animal")
|
|
814
814
|
})]
|
|
815
815
|
})]
|
|
816
816
|
}),
|
|
817
|
-
|
|
817
|
+
w === "timeline" && /* @__PURE__ */ l("div", {
|
|
818
818
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm",
|
|
819
819
|
children: it.length > 0 ? /* @__PURE__ */ u("div", {
|
|
820
820
|
className: "relative",
|
|
@@ -849,142 +849,142 @@ var ke = (e) => {
|
|
|
849
849
|
})]
|
|
850
850
|
}) : /* @__PURE__ */ l("p", {
|
|
851
851
|
className: "py-8 text-center text-sm text-text-secondary",
|
|
852
|
-
children:
|
|
852
|
+
children: b("healthybowl.livestock.animalDetails.timeline.empty", "No timeline records for this animal")
|
|
853
853
|
})
|
|
854
854
|
}),
|
|
855
855
|
/* @__PURE__ */ l(oe, {
|
|
856
|
-
open:
|
|
857
|
-
onClose: () =>
|
|
858
|
-
title:
|
|
859
|
-
description:
|
|
856
|
+
open: ze,
|
|
857
|
+
onClose: () => E(!1),
|
|
858
|
+
title: b("healthybowl.livestock.animalDetails.editModal.title", "Edit Animal Details"),
|
|
859
|
+
description: b("healthybowl.livestock.animalDetails.editModal.description", "Update details for {{name}}", { name: A.name }),
|
|
860
860
|
size: "lg",
|
|
861
861
|
footer: /* @__PURE__ */ u(Te, { children: [/* @__PURE__ */ l(d, {
|
|
862
862
|
variant: "outline",
|
|
863
|
-
onClick: () =>
|
|
864
|
-
children:
|
|
863
|
+
onClick: () => E(!1),
|
|
864
|
+
children: b("healthybowl.common.cancel", "Cancel")
|
|
865
865
|
}), /* @__PURE__ */ l(d, {
|
|
866
866
|
onClick: Ze,
|
|
867
|
-
disabled:
|
|
868
|
-
children:
|
|
867
|
+
disabled: D,
|
|
868
|
+
children: D ? b("healthybowl.common.saving", "Saving...") : b("healthybowl.livestock.animalDetails.editModal.save", "Save Changes")
|
|
869
869
|
})] }),
|
|
870
870
|
children: /* @__PURE__ */ u("div", {
|
|
871
871
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
872
872
|
children: [
|
|
873
873
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("label", {
|
|
874
874
|
className: "text-sm font-medium text-text-primary",
|
|
875
|
-
children: [
|
|
875
|
+
children: [b("healthybowl.livestock.animalDetails.form.name", "Name"), " *"]
|
|
876
876
|
}), /* @__PURE__ */ l("input", {
|
|
877
877
|
type: "text",
|
|
878
|
-
value:
|
|
879
|
-
onChange: (e) =>
|
|
878
|
+
value: j,
|
|
879
|
+
onChange: (e) => M(e.target.value),
|
|
880
880
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
881
881
|
})] }),
|
|
882
882
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("label", {
|
|
883
883
|
className: "text-sm font-medium text-text-primary",
|
|
884
|
-
children: [
|
|
884
|
+
children: [b("healthybowl.livestock.animalDetails.form.tagNumber", "Tag Number"), " *"]
|
|
885
885
|
}), /* @__PURE__ */ l("input", {
|
|
886
886
|
type: "text",
|
|
887
|
-
value:
|
|
888
|
-
onChange: (e) =>
|
|
887
|
+
value: V,
|
|
888
|
+
onChange: (e) => H(e.target.value),
|
|
889
889
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
890
890
|
})] }),
|
|
891
891
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
892
892
|
className: "text-sm font-medium text-text-primary",
|
|
893
|
-
children:
|
|
893
|
+
children: b("healthybowl.livestock.animalDetails.fields.type", "Type")
|
|
894
894
|
}), /* @__PURE__ */ u(f, {
|
|
895
|
-
value:
|
|
896
|
-
onValueChange:
|
|
895
|
+
value: N,
|
|
896
|
+
onValueChange: P,
|
|
897
897
|
children: [/* @__PURE__ */ l(h, {
|
|
898
898
|
className: "mt-1 w-full",
|
|
899
|
-
children: /* @__PURE__ */ l(g, { placeholder:
|
|
899
|
+
children: /* @__PURE__ */ l(g, { placeholder: b("healthybowl.livestock.animalDetails.fields.type", "Type") })
|
|
900
900
|
}), /* @__PURE__ */ u(p, { children: [
|
|
901
901
|
/* @__PURE__ */ l(m, {
|
|
902
902
|
value: "cattle",
|
|
903
|
-
children:
|
|
903
|
+
children: b("healthybowl.livestock.animalDetails.types.cattle", "Cattle")
|
|
904
904
|
}),
|
|
905
905
|
/* @__PURE__ */ l(m, {
|
|
906
906
|
value: "buffalo",
|
|
907
|
-
children:
|
|
907
|
+
children: b("healthybowl.livestock.animalDetails.types.buffalo", "Buffalo")
|
|
908
908
|
}),
|
|
909
909
|
/* @__PURE__ */ l(m, {
|
|
910
910
|
value: "goat",
|
|
911
|
-
children:
|
|
911
|
+
children: b("healthybowl.livestock.animalDetails.types.goat", "Goat")
|
|
912
912
|
}),
|
|
913
913
|
/* @__PURE__ */ l(m, {
|
|
914
914
|
value: "sheep",
|
|
915
|
-
children:
|
|
915
|
+
children: b("healthybowl.livestock.animalDetails.types.sheep", "Sheep")
|
|
916
916
|
}),
|
|
917
917
|
/* @__PURE__ */ l(m, {
|
|
918
918
|
value: "pig",
|
|
919
|
-
children:
|
|
919
|
+
children: b("healthybowl.livestock.animalDetails.types.pig", "Pig")
|
|
920
920
|
}),
|
|
921
921
|
/* @__PURE__ */ l(m, {
|
|
922
922
|
value: "poultry",
|
|
923
|
-
children:
|
|
923
|
+
children: b("healthybowl.livestock.animalDetails.types.poultry", "Poultry")
|
|
924
924
|
})
|
|
925
925
|
] })]
|
|
926
926
|
})] }),
|
|
927
927
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
928
928
|
className: "text-sm font-medium text-text-primary",
|
|
929
|
-
children:
|
|
929
|
+
children: b("healthybowl.livestock.animalDetails.fields.breed", "Breed")
|
|
930
930
|
}), /* @__PURE__ */ l("input", {
|
|
931
931
|
type: "text",
|
|
932
|
-
value:
|
|
933
|
-
onChange: (e) =>
|
|
932
|
+
value: F,
|
|
933
|
+
onChange: (e) => I(e.target.value),
|
|
934
934
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
935
935
|
})] }),
|
|
936
936
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
937
937
|
className: "text-sm font-medium text-text-primary",
|
|
938
|
-
children:
|
|
938
|
+
children: b("healthybowl.livestock.animalDetails.fields.gender", "Gender")
|
|
939
939
|
}), /* @__PURE__ */ u(f, {
|
|
940
|
-
value:
|
|
941
|
-
onValueChange:
|
|
940
|
+
value: L,
|
|
941
|
+
onValueChange: R,
|
|
942
942
|
children: [/* @__PURE__ */ l(h, {
|
|
943
943
|
className: "mt-1 w-full",
|
|
944
|
-
children: /* @__PURE__ */ l(g, { placeholder:
|
|
944
|
+
children: /* @__PURE__ */ l(g, { placeholder: b("healthybowl.livestock.animalDetails.fields.gender", "Gender") })
|
|
945
945
|
}), /* @__PURE__ */ u(p, { children: [/* @__PURE__ */ l(m, {
|
|
946
946
|
value: "male",
|
|
947
|
-
children:
|
|
947
|
+
children: b("healthybowl.livestock.animalDetails.genders.male", "Male")
|
|
948
948
|
}), /* @__PURE__ */ l(m, {
|
|
949
949
|
value: "female",
|
|
950
|
-
children:
|
|
950
|
+
children: b("healthybowl.livestock.animalDetails.genders.female", "Female")
|
|
951
951
|
})] })]
|
|
952
952
|
})] }),
|
|
953
953
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
954
954
|
className: "text-sm font-medium text-text-primary",
|
|
955
|
-
children:
|
|
955
|
+
children: b("healthybowl.livestock.animalDetails.form.healthStatus", "Health Status")
|
|
956
956
|
}), /* @__PURE__ */ u(f, {
|
|
957
|
-
value:
|
|
958
|
-
onValueChange:
|
|
957
|
+
value: z,
|
|
958
|
+
onValueChange: B,
|
|
959
959
|
children: [/* @__PURE__ */ l(h, {
|
|
960
960
|
className: "mt-1 w-full",
|
|
961
|
-
children: /* @__PURE__ */ l(g, { placeholder:
|
|
961
|
+
children: /* @__PURE__ */ l(g, { placeholder: b("healthybowl.livestock.animalDetails.form.healthStatus", "Health Status") })
|
|
962
962
|
}), /* @__PURE__ */ u(p, { children: [
|
|
963
963
|
/* @__PURE__ */ l(m, {
|
|
964
964
|
value: "healthy",
|
|
965
|
-
children:
|
|
965
|
+
children: b("healthybowl.livestock.animalDetails.healthStatuses.healthy", "Healthy")
|
|
966
966
|
}),
|
|
967
967
|
/* @__PURE__ */ l(m, {
|
|
968
968
|
value: "pregnant",
|
|
969
|
-
children:
|
|
969
|
+
children: b("healthybowl.livestock.animalDetails.healthStatuses.pregnant", "Pregnant")
|
|
970
970
|
}),
|
|
971
971
|
/* @__PURE__ */ l(m, {
|
|
972
972
|
value: "under_treatment",
|
|
973
|
-
children:
|
|
973
|
+
children: b("healthybowl.livestock.animalDetails.healthStatuses.underTreatment", "Under Treatment")
|
|
974
974
|
}),
|
|
975
975
|
/* @__PURE__ */ l(m, {
|
|
976
976
|
value: "sick",
|
|
977
|
-
children:
|
|
977
|
+
children: b("healthybowl.livestock.animalDetails.healthStatuses.sick", "Sick")
|
|
978
978
|
}),
|
|
979
979
|
/* @__PURE__ */ l(m, {
|
|
980
980
|
value: "quarantine",
|
|
981
|
-
children:
|
|
981
|
+
children: b("healthybowl.livestock.animalDetails.healthStatuses.quarantine", "Quarantine")
|
|
982
982
|
})
|
|
983
983
|
] })]
|
|
984
984
|
})] }),
|
|
985
985
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
986
986
|
className: "text-sm font-medium text-text-primary",
|
|
987
|
-
children:
|
|
987
|
+
children: b("healthybowl.livestock.animalDetails.form.weight", "Weight (kg)")
|
|
988
988
|
}), /* @__PURE__ */ l("input", {
|
|
989
989
|
type: "number",
|
|
990
990
|
min: 0,
|
|
@@ -994,17 +994,17 @@ var ke = (e) => {
|
|
|
994
994
|
})] }),
|
|
995
995
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
996
996
|
className: "text-sm font-medium text-text-primary",
|
|
997
|
-
children:
|
|
997
|
+
children: b("healthybowl.livestock.animalDetails.form.vaccinations", "Vaccinations")
|
|
998
998
|
}), /* @__PURE__ */ l("input", {
|
|
999
999
|
type: "number",
|
|
1000
1000
|
min: 0,
|
|
1001
|
-
value:
|
|
1002
|
-
onChange: (e) =>
|
|
1001
|
+
value: U,
|
|
1002
|
+
onChange: (e) => He(e.target.value),
|
|
1003
1003
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
1004
1004
|
})] }),
|
|
1005
1005
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
1006
1006
|
className: "text-sm font-medium text-text-primary",
|
|
1007
|
-
children:
|
|
1007
|
+
children: b("healthybowl.livestock.animalDetails.fields.dateOfBirth", "Date of Birth")
|
|
1008
1008
|
}), /* @__PURE__ */ l("input", {
|
|
1009
1009
|
type: "date",
|
|
1010
1010
|
value: W,
|
|
@@ -1013,7 +1013,7 @@ var ke = (e) => {
|
|
|
1013
1013
|
})] }),
|
|
1014
1014
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
1015
1015
|
className: "text-sm font-medium text-text-primary",
|
|
1016
|
-
children:
|
|
1016
|
+
children: b("healthybowl.livestock.animalDetails.fields.lastCheckup", "Last Checkup")
|
|
1017
1017
|
}), /* @__PURE__ */ l("input", {
|
|
1018
1018
|
type: "date",
|
|
1019
1019
|
value: G,
|
|
@@ -1024,12 +1024,12 @@ var ke = (e) => {
|
|
|
1024
1024
|
className: "sm:col-span-2",
|
|
1025
1025
|
children: [/* @__PURE__ */ l("label", {
|
|
1026
1026
|
className: "text-sm font-medium text-text-primary",
|
|
1027
|
-
children:
|
|
1027
|
+
children: b("healthybowl.livestock.animalDetails.form.productionType", "Production Type")
|
|
1028
1028
|
}), /* @__PURE__ */ l("input", {
|
|
1029
1029
|
type: "text",
|
|
1030
1030
|
value: K,
|
|
1031
1031
|
onChange: (e) => qe(e.target.value),
|
|
1032
|
-
placeholder:
|
|
1032
|
+
placeholder: b("healthybowl.livestock.animalDetails.form.productionTypePlaceholder", "e.g. dairy, meat, eggs"),
|
|
1033
1033
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
1034
1034
|
})]
|
|
1035
1035
|
}),
|
|
@@ -1037,7 +1037,7 @@ var ke = (e) => {
|
|
|
1037
1037
|
className: "sm:col-span-2",
|
|
1038
1038
|
children: [/* @__PURE__ */ l("label", {
|
|
1039
1039
|
className: "text-sm font-medium text-text-primary",
|
|
1040
|
-
children:
|
|
1040
|
+
children: b("healthybowl.livestock.animalDetails.form.photos", "Photos")
|
|
1041
1041
|
}), /* @__PURE__ */ l("div", {
|
|
1042
1042
|
className: "mt-1",
|
|
1043
1043
|
children: /* @__PURE__ */ l(se, {
|
|
@@ -1051,21 +1051,21 @@ var ke = (e) => {
|
|
|
1051
1051
|
})
|
|
1052
1052
|
}),
|
|
1053
1053
|
/* @__PURE__ */ l(re, {
|
|
1054
|
-
toasts:
|
|
1055
|
-
onDismiss:
|
|
1054
|
+
toasts: Be,
|
|
1055
|
+
onDismiss: Ve
|
|
1056
1056
|
})
|
|
1057
1057
|
]
|
|
1058
1058
|
}) : /* @__PURE__ */ l(n, {
|
|
1059
|
-
title:
|
|
1060
|
-
children:
|
|
1061
|
-
title:
|
|
1062
|
-
description:
|
|
1059
|
+
title: Ie.livestock ? b("healthybowl.livestock.animalDetails.loading.pageTitle", "Loading animalโฆ") : Fe.livestock ? b("healthybowl.livestock.animalDetails.error.pageTitle", "Animal details") : b("healthybowl.livestock.animalDetails.notFound.pageTitle", "Animal Not Found"),
|
|
1060
|
+
children: Ie.livestock ? /* @__PURE__ */ l(ae, {}) : Fe.livestock ? /* @__PURE__ */ l(ne, { onRetry: Le }) : /* @__PURE__ */ l(te, {
|
|
1061
|
+
title: b("healthybowl.livestock.animalDetails.notFound.title", "Animal not found"),
|
|
1062
|
+
description: b("healthybowl.livestock.animalDetails.notFound.description", "The animal you are looking for does not exist."),
|
|
1063
1063
|
action: /* @__PURE__ */ l(d, {
|
|
1064
|
-
onClick: () =>
|
|
1065
|
-
children:
|
|
1064
|
+
onClick: () => S(C("livestock/animals")),
|
|
1065
|
+
children: b("healthybowl.livestock.animalDetails.notFound.backToRegistry", "Back to Registry")
|
|
1066
1066
|
})
|
|
1067
1067
|
})
|
|
1068
1068
|
});
|
|
1069
1069
|
};
|
|
1070
1070
|
//#endregion
|
|
1071
|
-
export {
|
|
1071
|
+
export { v as AnimalDetailsPage };
|