@burdenoff/microfe-healthybowl 2026.820.3 → 2026.822.1
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/pages/distribution/CsaPlanDetailPage.js +192 -188
- package/dist/healthybowl/pages/distribution/CsaPlanDetailPage.js.map +1 -1
- package/dist/healthybowl/pages/distribution/DeliveryRouteDetailPage.js +85 -75
- package/dist/healthybowl/pages/distribution/DeliveryRouteDetailPage.js.map +1 -1
- package/dist/healthybowl/pages/distribution/PickupLocationFormModal.js +177 -116
- package/dist/healthybowl/pages/distribution/PickupLocationFormModal.js.map +1 -1
- package/dist/healthybowl/pages/distribution/PickupManifestPage.js +224 -188
- package/dist/healthybowl/pages/distribution/PickupManifestPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/SchemeDiscoveryPage.js +181 -181
- package/dist/healthybowl/pages/government-schemes/SchemeDiscoveryPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/schemeDiscoveryFilters.js +4 -1
- package/dist/healthybowl/pages/government-schemes/schemeDiscoveryFilters.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,349 +11,353 @@ import { Breadcrumbs as u } from "../../components/Breadcrumbs.js";
|
|
|
11
11
|
import { PageLoader as d } from "../../components/PageLoader.js";
|
|
12
12
|
import { useToast as ee } from "../../hooks/useToast.js";
|
|
13
13
|
import "../../components/index.js";
|
|
14
|
-
import { GET_CSA_MEMBERSHIPS as
|
|
15
|
-
import { useHealthyBowlCsaPickup as
|
|
16
|
-
import { DistributionNav as
|
|
17
|
-
import { EnrollMemberModal as
|
|
18
|
-
import { billingStatusVariant as
|
|
19
|
-
import { useState as
|
|
20
|
-
import { useI18n as
|
|
21
|
-
import { CalendarClock as S, PauseCircle as C, PlayCircle as w, RefreshCw as T, UserPlus as E, XCircle as
|
|
22
|
-
import { useParams as
|
|
23
|
-
import { jsx as
|
|
24
|
-
import { Button as
|
|
25
|
-
import { useQuery as
|
|
14
|
+
import { GET_CSA_MEMBERSHIPS as te, GET_CSA_PLAN as f, useHealthyBowlDistribution as p } from "../../hooks/useHealthyBowlDistribution.js";
|
|
15
|
+
import { useHealthyBowlCsaPickup as m } from "../../hooks/useHealthyBowlCsaPickup.js";
|
|
16
|
+
import { DistributionNav as h } from "./DistributionNav.js";
|
|
17
|
+
import { EnrollMemberModal as g } from "./EnrollMemberModal.js";
|
|
18
|
+
import { billingStatusVariant as _, dayName as v, membershipStatusVariant as y, planStatusVariant as b } from "./labels.js";
|
|
19
|
+
import { useState as x } from "react";
|
|
20
|
+
import { useI18n as ne } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
21
|
+
import { CalendarClock as S, PauseCircle as C, PlayCircle as w, RefreshCw as T, UserPlus as E, XCircle as re } from "lucide-react";
|
|
22
|
+
import { useParams as ie } from "react-router";
|
|
23
|
+
import { jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
24
|
+
import { Button as k } from "@burdenoff/fe-libs/ui";
|
|
25
|
+
import { useQuery as A } from "@apollo/client/react";
|
|
26
26
|
//#region src/healthybowl/pages/distribution/CsaPlanDetailPage.tsx
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
function j(e, t) {
|
|
28
|
+
return `${e}: ${t}`;
|
|
29
|
+
}
|
|
30
|
+
var M = () => {
|
|
31
|
+
let { t: M } = ne(), { planId: N } = ie(), { buildPath: P } = r(), { toast: F } = ee(), I = l(), { context: L, enrollMember: R, updateMembership: z, cancelMembership: B, renewMembership: V } = p({}), { locations: H, assignPickupLocation: U } = m({ locations: !0 }), W = A(f, {
|
|
29
32
|
variables: {
|
|
30
|
-
context:
|
|
31
|
-
id:
|
|
33
|
+
context: L,
|
|
34
|
+
id: N ?? ""
|
|
32
35
|
},
|
|
33
|
-
skip: !
|
|
36
|
+
skip: !N,
|
|
34
37
|
fetchPolicy: "cache-and-network"
|
|
35
|
-
}),
|
|
38
|
+
}), G = A(te, {
|
|
36
39
|
variables: {
|
|
37
|
-
context:
|
|
38
|
-
csaPlanId:
|
|
40
|
+
context: L,
|
|
41
|
+
csaPlanId: N ?? "",
|
|
39
42
|
status: null,
|
|
40
43
|
limit: 100,
|
|
41
44
|
offset: 0
|
|
42
45
|
},
|
|
43
|
-
skip: !
|
|
46
|
+
skip: !N,
|
|
44
47
|
fetchPolicy: "cache-and-network"
|
|
45
|
-
}), [
|
|
46
|
-
await Promise.all([
|
|
47
|
-
},
|
|
48
|
+
}), [K, q] = x(!1), [J, Y] = x(null), X = W.data?.getHealthyBowlCsaPlan ?? null, Z = G.data?.getHealthyBowlCsaMemberships ?? [], Q = async () => {
|
|
49
|
+
await Promise.all([W.refetch().catch(() => void 0), G.refetch().catch(() => void 0)]);
|
|
50
|
+
}, ae = async (e) => {
|
|
48
51
|
try {
|
|
49
|
-
await
|
|
52
|
+
await R({
|
|
50
53
|
...e,
|
|
51
|
-
csaPlanId:
|
|
54
|
+
csaPlanId: N
|
|
52
55
|
});
|
|
53
56
|
} catch (t) {
|
|
54
57
|
let n = t instanceof Error ? t.message : String(t);
|
|
55
|
-
if (!/is at capacity/i.test(n) || !await
|
|
56
|
-
title:
|
|
57
|
-
message:
|
|
58
|
+
if (!/is at capacity/i.test(n) || !await I({
|
|
59
|
+
title: M("healthybowl.distribution.detail.confirmPlanOverCapacity.title", "This plan is full"),
|
|
60
|
+
message: M("healthybowl.distribution.detail.confirmPlanOverCapacity.message", "{{error}} Enroll {{member}} anyway? The plan will show as over capacity.", {
|
|
58
61
|
error: n,
|
|
59
62
|
member: String(e.memberName ?? "")
|
|
60
63
|
}),
|
|
61
|
-
okButtonTitle:
|
|
64
|
+
okButtonTitle: M("healthybowl.distribution.detail.confirmPlanOverCapacity.confirm", "Enroll anyway")
|
|
62
65
|
})) throw t;
|
|
63
|
-
await
|
|
66
|
+
await R({
|
|
64
67
|
...e,
|
|
65
|
-
csaPlanId:
|
|
68
|
+
csaPlanId: N,
|
|
66
69
|
allowOverCapacity: !0
|
|
67
70
|
});
|
|
68
71
|
}
|
|
69
|
-
await
|
|
70
|
-
title:
|
|
72
|
+
await Q(), F({
|
|
73
|
+
title: M("healthybowl.distribution.detail.toast.enrolled", "Member enrolled"),
|
|
71
74
|
description: String(e.memberName ?? ""),
|
|
72
75
|
variant: "success"
|
|
73
76
|
});
|
|
74
|
-
},
|
|
75
|
-
let n =
|
|
77
|
+
}, oe = async (e, t) => {
|
|
78
|
+
let n = H.find((e) => e.id === t), r = !1;
|
|
76
79
|
if (n?.atCapacity) {
|
|
77
|
-
if (!await
|
|
78
|
-
title:
|
|
79
|
-
message:
|
|
80
|
+
if (!await I({
|
|
81
|
+
title: M("healthybowl.distribution.detail.confirmOverCapacity.title", "This collection point is full"),
|
|
82
|
+
message: M("healthybowl.distribution.detail.confirmOverCapacity.message", "{{name}} has no places left. Assigning {{member}} anyway over-subscribes it — the shortfall will show on the collection points list.", {
|
|
80
83
|
name: n.name,
|
|
81
84
|
member: e.memberName
|
|
82
85
|
}),
|
|
83
|
-
okButtonTitle:
|
|
86
|
+
okButtonTitle: M("healthybowl.distribution.detail.confirmOverCapacity.confirm", "Assign anyway")
|
|
84
87
|
})) return;
|
|
85
88
|
r = !0;
|
|
86
89
|
}
|
|
87
|
-
|
|
90
|
+
Y(e.id);
|
|
88
91
|
try {
|
|
89
|
-
await
|
|
90
|
-
title: t ?
|
|
92
|
+
await U(e.id, t, r), await Q(), F({
|
|
93
|
+
title: t ? M("healthybowl.distribution.detail.toast.pickupAssigned", "{{member}} now collects from {{name}}.", {
|
|
91
94
|
member: e.memberName,
|
|
92
95
|
name: n?.name ?? ""
|
|
93
|
-
}) :
|
|
96
|
+
}) : M("healthybowl.distribution.detail.toast.pickupCleared", "{{member}} moved back to home delivery.", { member: e.memberName }),
|
|
94
97
|
variant: "success"
|
|
95
98
|
});
|
|
96
99
|
} catch (e) {
|
|
97
|
-
|
|
98
|
-
title:
|
|
100
|
+
F({
|
|
101
|
+
title: M("healthybowl.distribution.detail.toast.pickupFailed", "Could not change the collection point"),
|
|
99
102
|
description: e instanceof Error ? e.message : String(e),
|
|
100
103
|
variant: "error"
|
|
101
104
|
});
|
|
102
105
|
} finally {
|
|
103
|
-
|
|
106
|
+
Y((t) => t === e.id ? null : t);
|
|
104
107
|
}
|
|
105
|
-
},
|
|
108
|
+
}, se = async (e) => {
|
|
106
109
|
let t = e.status === "PAUSED" ? "ACTIVE" : "PAUSED";
|
|
107
|
-
|
|
110
|
+
Y(e.id);
|
|
108
111
|
try {
|
|
109
|
-
await
|
|
112
|
+
await z({
|
|
110
113
|
id: e.id,
|
|
111
114
|
status: t
|
|
112
|
-
}), await
|
|
113
|
-
title: t === "ACTIVE" ?
|
|
115
|
+
}), await Q(), F({
|
|
116
|
+
title: t === "ACTIVE" ? M("healthybowl.distribution.detail.toast.resumed", "Membership resumed") : M("healthybowl.distribution.detail.toast.paused", "Membership paused"),
|
|
114
117
|
description: e.memberName,
|
|
115
118
|
variant: "success"
|
|
116
119
|
});
|
|
117
120
|
} catch (e) {
|
|
118
|
-
|
|
119
|
-
title:
|
|
121
|
+
F({
|
|
122
|
+
title: M("healthybowl.distribution.detail.toast.updateFailed", "Update failed"),
|
|
120
123
|
description: e instanceof Error ? e.message : String(e),
|
|
121
124
|
variant: "error"
|
|
122
125
|
});
|
|
123
126
|
} finally {
|
|
124
|
-
|
|
127
|
+
Y(null);
|
|
125
128
|
}
|
|
126
|
-
},
|
|
127
|
-
|
|
129
|
+
}, ce = async (e) => {
|
|
130
|
+
Y(e.id);
|
|
128
131
|
try {
|
|
129
|
-
let t = await
|
|
130
|
-
await
|
|
131
|
-
title:
|
|
132
|
-
description: t ?
|
|
132
|
+
let t = await V(e.id);
|
|
133
|
+
await Q(), F({
|
|
134
|
+
title: M("healthybowl.distribution.detail.toast.renewed", "Membership renewed"),
|
|
135
|
+
description: t ? M("healthybowl.distribution.detail.toast.renewedCycle", "{{name}} advanced to cycle {{cycle}}.", {
|
|
133
136
|
name: e.memberName,
|
|
134
137
|
cycle: t.cycleCount
|
|
135
138
|
}) : e.memberName,
|
|
136
139
|
variant: "success"
|
|
137
140
|
});
|
|
138
141
|
} catch (e) {
|
|
139
|
-
|
|
140
|
-
title:
|
|
142
|
+
F({
|
|
143
|
+
title: M("healthybowl.distribution.detail.toast.renewFailed", "Renewal failed"),
|
|
141
144
|
description: e instanceof Error ? e.message : String(e),
|
|
142
145
|
variant: "error"
|
|
143
146
|
});
|
|
144
147
|
} finally {
|
|
145
|
-
|
|
148
|
+
Y(null);
|
|
146
149
|
}
|
|
147
|
-
},
|
|
148
|
-
if (await
|
|
149
|
-
title:
|
|
150
|
-
message:
|
|
150
|
+
}, le = async (e) => {
|
|
151
|
+
if (await I({
|
|
152
|
+
title: M("healthybowl.distribution.detail.confirm.cancelTitle", "Cancel membership?"),
|
|
153
|
+
message: M("healthybowl.distribution.detail.confirm.cancel", "Cancel {{name}}’s membership? This stops future deliveries and billing.", { name: e.memberName })
|
|
151
154
|
})) {
|
|
152
|
-
|
|
155
|
+
Y(e.id);
|
|
153
156
|
try {
|
|
154
|
-
await
|
|
155
|
-
title:
|
|
157
|
+
await B(e.id), await Q(), F({
|
|
158
|
+
title: M("healthybowl.distribution.detail.toast.cancelled", "Membership cancelled"),
|
|
156
159
|
description: e.memberName,
|
|
157
160
|
variant: "success"
|
|
158
161
|
});
|
|
159
162
|
} catch (e) {
|
|
160
|
-
|
|
161
|
-
title:
|
|
163
|
+
F({
|
|
164
|
+
title: M("healthybowl.distribution.detail.toast.cancelFailed", "Could not cancel"),
|
|
162
165
|
description: e instanceof Error ? e.message : String(e),
|
|
163
166
|
variant: "error"
|
|
164
167
|
});
|
|
165
168
|
} finally {
|
|
166
|
-
|
|
169
|
+
Y(null);
|
|
167
170
|
}
|
|
168
171
|
}
|
|
169
|
-
},
|
|
172
|
+
}, $ = [
|
|
170
173
|
{
|
|
171
174
|
key: "member",
|
|
172
|
-
header:
|
|
173
|
-
render: (e) => /* @__PURE__ */
|
|
175
|
+
header: M("healthybowl.distribution.detail.table.member", "Member"),
|
|
176
|
+
render: (e) => /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("div", {
|
|
174
177
|
className: "font-medium text-text-primary",
|
|
175
178
|
children: e.memberName
|
|
176
|
-
}), /* @__PURE__ */
|
|
179
|
+
}), /* @__PURE__ */ D("div", {
|
|
177
180
|
className: "text-xs text-text-secondary",
|
|
178
181
|
children: e.memberEmail ?? e.memberPhone ?? "—"
|
|
179
182
|
})] })
|
|
180
183
|
},
|
|
181
184
|
{
|
|
182
185
|
key: "status",
|
|
183
|
-
header:
|
|
184
|
-
render: (e) => /* @__PURE__ */
|
|
185
|
-
variant:
|
|
186
|
+
header: M("healthybowl.distribution.detail.table.status", "Status"),
|
|
187
|
+
render: (e) => /* @__PURE__ */ D(o, {
|
|
188
|
+
variant: y(e.status),
|
|
186
189
|
label: e.status,
|
|
187
190
|
dot: !0
|
|
188
191
|
})
|
|
189
192
|
},
|
|
190
193
|
{
|
|
191
194
|
key: "fulfilment",
|
|
192
|
-
header:
|
|
193
|
-
render: (e) => /* @__PURE__ */
|
|
195
|
+
header: M("healthybowl.distribution.detail.table.fulfilment", "Collection"),
|
|
196
|
+
render: (e) => /* @__PURE__ */ O("select", {
|
|
197
|
+
"aria-label": j(M("healthybowl.distribution.detail.collectionPointForMember", "Collection point"), e.memberName),
|
|
194
198
|
value: e.pickupLocationId ?? "",
|
|
195
|
-
disabled:
|
|
196
|
-
onChange: (t) => void
|
|
199
|
+
disabled: J === e.id,
|
|
200
|
+
onChange: (t) => void oe(e, t.target.value || null),
|
|
197
201
|
className: "rounded-md border border-border-subtle bg-bg-surface px-2 py-1 text-xs text-text-primary disabled:opacity-60",
|
|
198
|
-
children: [/* @__PURE__ */
|
|
202
|
+
children: [/* @__PURE__ */ D("option", {
|
|
199
203
|
value: "",
|
|
200
|
-
children:
|
|
201
|
-
}),
|
|
204
|
+
children: M("healthybowl.distribution.detail.homeDelivery", "Home delivery")
|
|
205
|
+
}), H.filter((e) => e.status === "ACTIVE").map((e) => /* @__PURE__ */ O("option", {
|
|
202
206
|
value: e.id,
|
|
203
|
-
children: [e.name, e.atCapacity ? ` ${
|
|
207
|
+
children: [e.name, e.atCapacity ? ` ${M("healthybowl.distribution.detail.full", "(full)")}` : ""]
|
|
204
208
|
}, e.id))]
|
|
205
209
|
})
|
|
206
210
|
},
|
|
207
211
|
{
|
|
208
212
|
key: "nextDelivery",
|
|
209
|
-
header:
|
|
213
|
+
header: M("healthybowl.distribution.detail.table.nextDelivery", "Next delivery"),
|
|
210
214
|
render: (e) => e.nextDeliveryDate ? t(e.nextDeliveryDate) : "—"
|
|
211
215
|
},
|
|
212
216
|
{
|
|
213
217
|
key: "cycles",
|
|
214
|
-
header:
|
|
215
|
-
render: (e) => /* @__PURE__ */
|
|
218
|
+
header: M("healthybowl.distribution.detail.table.cycles", "Cycles"),
|
|
219
|
+
render: (e) => /* @__PURE__ */ D("span", {
|
|
216
220
|
className: "tabular-nums",
|
|
217
221
|
children: e.cycleCount
|
|
218
222
|
})
|
|
219
223
|
},
|
|
220
224
|
{
|
|
221
225
|
key: "billing",
|
|
222
|
-
header:
|
|
223
|
-
render: (e) => /* @__PURE__ */
|
|
224
|
-
variant:
|
|
226
|
+
header: M("healthybowl.distribution.detail.table.billing", "Billing"),
|
|
227
|
+
render: (e) => /* @__PURE__ */ D(o, {
|
|
228
|
+
variant: _(e.billingSyncStatus),
|
|
225
229
|
label: e.billingSyncStatus
|
|
226
230
|
})
|
|
227
231
|
},
|
|
228
232
|
{
|
|
229
233
|
key: "actions",
|
|
230
234
|
header: "",
|
|
231
|
-
render: (e) => e.status === "CANCELLED" ? /* @__PURE__ */
|
|
235
|
+
render: (e) => e.status === "CANCELLED" ? /* @__PURE__ */ D("span", {
|
|
232
236
|
className: "text-xs text-text-secondary",
|
|
233
|
-
children:
|
|
234
|
-
}) : /* @__PURE__ */
|
|
237
|
+
children: M("healthybowl.distribution.detail.table.ended", "Ended")
|
|
238
|
+
}) : /* @__PURE__ */ O("div", {
|
|
235
239
|
className: "flex items-center justify-end gap-1",
|
|
236
240
|
children: [
|
|
237
|
-
/* @__PURE__ */ k
|
|
241
|
+
/* @__PURE__ */ D(k, {
|
|
238
242
|
variant: "ghost",
|
|
239
243
|
size: "icon-sm",
|
|
240
|
-
disabled:
|
|
244
|
+
disabled: J === e.id,
|
|
241
245
|
onClick: (t) => {
|
|
242
|
-
t.stopPropagation(),
|
|
246
|
+
t.stopPropagation(), se(e);
|
|
243
247
|
},
|
|
244
|
-
"aria-label": e.status === "PAUSED" ?
|
|
245
|
-
title: e.status === "PAUSED" ?
|
|
246
|
-
children: e.status === "PAUSED" ? /* @__PURE__ */
|
|
248
|
+
"aria-label": e.status === "PAUSED" ? M("healthybowl.distribution.detail.actions.resume", "Resume") : M("healthybowl.distribution.detail.actions.pause", "Pause"),
|
|
249
|
+
title: e.status === "PAUSED" ? M("healthybowl.distribution.detail.actions.resume", "Resume") : M("healthybowl.distribution.detail.actions.pause", "Pause"),
|
|
250
|
+
children: e.status === "PAUSED" ? /* @__PURE__ */ D(w, { className: "h-4 w-4" }) : /* @__PURE__ */ D(C, { className: "h-4 w-4" })
|
|
247
251
|
}),
|
|
248
|
-
/* @__PURE__ */ k
|
|
252
|
+
/* @__PURE__ */ D(k, {
|
|
249
253
|
variant: "ghost",
|
|
250
254
|
size: "icon-sm",
|
|
251
|
-
disabled:
|
|
255
|
+
disabled: J === e.id,
|
|
252
256
|
onClick: (t) => {
|
|
253
|
-
t.stopPropagation(),
|
|
257
|
+
t.stopPropagation(), ce(e);
|
|
254
258
|
},
|
|
255
|
-
"aria-label":
|
|
256
|
-
title:
|
|
257
|
-
children: /* @__PURE__ */
|
|
259
|
+
"aria-label": M("healthybowl.distribution.detail.actions.renew", "Renew (next cycle)"),
|
|
260
|
+
title: M("healthybowl.distribution.detail.actions.renew", "Renew (next cycle)"),
|
|
261
|
+
children: /* @__PURE__ */ D(T, { className: "h-4 w-4" })
|
|
258
262
|
}),
|
|
259
|
-
/* @__PURE__ */ k
|
|
263
|
+
/* @__PURE__ */ D(k, {
|
|
260
264
|
variant: "ghost",
|
|
261
265
|
size: "icon-sm",
|
|
262
|
-
disabled:
|
|
266
|
+
disabled: J === e.id,
|
|
263
267
|
onClick: (t) => {
|
|
264
|
-
t.stopPropagation(),
|
|
268
|
+
t.stopPropagation(), le(e);
|
|
265
269
|
},
|
|
266
|
-
"aria-label":
|
|
267
|
-
title:
|
|
270
|
+
"aria-label": M("healthybowl.distribution.detail.actions.cancel", "Cancel"),
|
|
271
|
+
title: M("healthybowl.distribution.detail.actions.cancel", "Cancel"),
|
|
268
272
|
className: "text-text-secondary hover:text-status-error-text",
|
|
269
|
-
children: /* @__PURE__ */
|
|
273
|
+
children: /* @__PURE__ */ D(re, { className: "h-4 w-4" })
|
|
270
274
|
})
|
|
271
275
|
]
|
|
272
276
|
})
|
|
273
277
|
}
|
|
274
278
|
];
|
|
275
|
-
if (
|
|
276
|
-
if (
|
|
277
|
-
title:
|
|
278
|
-
children: [/* @__PURE__ */
|
|
279
|
-
description:
|
|
280
|
-
onRetry: () => void
|
|
279
|
+
if (W.loading && !X) return /* @__PURE__ */ D(d, {});
|
|
280
|
+
if (W.error && !X) return /* @__PURE__ */ O(n, {
|
|
281
|
+
title: M("healthybowl.distribution.detail.title", "CSA plan"),
|
|
282
|
+
children: [/* @__PURE__ */ D(h, {}), /* @__PURE__ */ D(c, {
|
|
283
|
+
description: W.error.message,
|
|
284
|
+
onRetry: () => void W.refetch()
|
|
281
285
|
})]
|
|
282
286
|
});
|
|
283
|
-
if (!
|
|
284
|
-
title:
|
|
285
|
-
children: [/* @__PURE__ */
|
|
286
|
-
title:
|
|
287
|
-
description:
|
|
287
|
+
if (!X) return /* @__PURE__ */ O(n, {
|
|
288
|
+
title: M("healthybowl.distribution.detail.title", "CSA plan"),
|
|
289
|
+
children: [/* @__PURE__ */ D(h, {}), /* @__PURE__ */ D(s, {
|
|
290
|
+
title: M("healthybowl.distribution.detail.notFound.title", "Plan not found"),
|
|
291
|
+
description: M("healthybowl.distribution.detail.notFound.description", "This CSA plan no longer exists.")
|
|
288
292
|
})]
|
|
289
293
|
});
|
|
290
|
-
let
|
|
291
|
-
return /* @__PURE__ */
|
|
292
|
-
title:
|
|
293
|
-
description:
|
|
294
|
-
actions: /* @__PURE__ */
|
|
295
|
-
onClick: () =>
|
|
296
|
-
children: [/* @__PURE__ */
|
|
294
|
+
let ue = Z.filter((e) => e.status === "ACTIVE").length, de = Z.filter((e) => e.status === "PAUSED").length, fe = X.capacityRemaining === null ? X.capacityReason === "CAPACITY_ZERO" ? M("healthybowl.distribution.detail.stats.noPlaces", "No places") : M("healthybowl.distribution.detail.stats.noLimit", "No limit") : X.capacityRemaining < 0 ? M("healthybowl.distribution.detail.stats.overCapacity", "{{n}} over capacity", { n: Math.abs(X.capacityRemaining) }) : M("healthybowl.distribution.detail.stats.left", "{{n}} left", { n: X.capacityRemaining });
|
|
295
|
+
return /* @__PURE__ */ O(n, {
|
|
296
|
+
title: X.name,
|
|
297
|
+
description: X.description ?? void 0,
|
|
298
|
+
actions: /* @__PURE__ */ O(k, {
|
|
299
|
+
onClick: () => q(!0),
|
|
300
|
+
children: [/* @__PURE__ */ D(E, { className: "h-4 w-4" }), M("healthybowl.distribution.detail.actions.enroll", "Enroll member")]
|
|
297
301
|
}),
|
|
298
302
|
children: [
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
-
label:
|
|
301
|
-
href:
|
|
302
|
-
}, { label:
|
|
303
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ D(u, { items: [{
|
|
304
|
+
label: M("healthybowl.distribution.nav.csa", "CSA Boxes"),
|
|
305
|
+
href: P("distribution/csa")
|
|
306
|
+
}, { label: X.name }] }),
|
|
307
|
+
/* @__PURE__ */ O("div", {
|
|
304
308
|
className: "flex flex-wrap items-center gap-2",
|
|
305
309
|
children: [
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
variant:
|
|
308
|
-
label:
|
|
310
|
+
/* @__PURE__ */ D(o, {
|
|
311
|
+
variant: b(X.status),
|
|
312
|
+
label: X.status,
|
|
309
313
|
dot: !0
|
|
310
314
|
}),
|
|
311
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ D(o, {
|
|
312
316
|
variant: "info",
|
|
313
|
-
label: `${
|
|
317
|
+
label: `${X.boxSize} · ${X.frequency}`
|
|
314
318
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ O("span", {
|
|
316
320
|
className: "inline-flex items-center gap-1.5 rounded-full border border-border-subtle bg-bg-sunken/60 px-3 py-1 text-xs text-text-secondary",
|
|
317
|
-
children: [/* @__PURE__ */
|
|
321
|
+
children: [/* @__PURE__ */ D(S, { className: "h-3.5 w-3.5" }), M("healthybowl.distribution.detail.deliveryDay", "Delivers {{day}}", { day: v(X.deliveryDayOfWeek) })]
|
|
318
322
|
}),
|
|
319
|
-
/* @__PURE__ */
|
|
320
|
-
variant:
|
|
321
|
-
label: `Billing: ${
|
|
323
|
+
/* @__PURE__ */ D(o, {
|
|
324
|
+
variant: _(X.billingSyncStatus),
|
|
325
|
+
label: `Billing: ${X.billingSyncStatus}`
|
|
322
326
|
})
|
|
323
327
|
]
|
|
324
328
|
}),
|
|
325
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ O("div", {
|
|
326
330
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",
|
|
327
331
|
children: [
|
|
328
|
-
/* @__PURE__ */
|
|
329
|
-
label:
|
|
330
|
-
value: e(
|
|
332
|
+
/* @__PURE__ */ D(i, {
|
|
333
|
+
label: M("healthybowl.distribution.detail.stats.price", "Price per box"),
|
|
334
|
+
value: e(X.price, X.currency || "INR"),
|
|
331
335
|
hero: !0
|
|
332
336
|
}),
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
label:
|
|
335
|
-
value: le
|
|
336
|
-
}),
|
|
337
|
-
/* @__PURE__ */ k(i, {
|
|
338
|
-
label: N("healthybowl.distribution.detail.stats.paused", "Paused"),
|
|
337
|
+
/* @__PURE__ */ D(i, {
|
|
338
|
+
label: M("healthybowl.distribution.detail.stats.active", "Active members"),
|
|
339
339
|
value: ue
|
|
340
340
|
}),
|
|
341
|
-
/* @__PURE__ */
|
|
342
|
-
label:
|
|
341
|
+
/* @__PURE__ */ D(i, {
|
|
342
|
+
label: M("healthybowl.distribution.detail.stats.paused", "Paused"),
|
|
343
343
|
value: de
|
|
344
|
+
}),
|
|
345
|
+
/* @__PURE__ */ D(i, {
|
|
346
|
+
label: M("healthybowl.distribution.detail.stats.capacity", "Capacity"),
|
|
347
|
+
value: fe
|
|
344
348
|
})
|
|
345
349
|
]
|
|
346
350
|
}),
|
|
347
|
-
|
|
351
|
+
X.contents.length > 0 && /* @__PURE__ */ O("div", {
|
|
348
352
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
349
|
-
children: [/* @__PURE__ */
|
|
353
|
+
children: [/* @__PURE__ */ D("h3", {
|
|
350
354
|
className: "mb-2 text-sm font-semibold text-text-primary",
|
|
351
|
-
children:
|
|
352
|
-
}), /* @__PURE__ */
|
|
355
|
+
children: M("healthybowl.distribution.detail.contents", "Box contents")
|
|
356
|
+
}), /* @__PURE__ */ D("div", {
|
|
353
357
|
className: "flex flex-wrap gap-2",
|
|
354
|
-
children:
|
|
358
|
+
children: X.contents.map((e, t) => /* @__PURE__ */ O("span", {
|
|
355
359
|
className: "inline-flex items-center gap-1 rounded-full border border-border-subtle bg-bg-sunken/60 px-3 py-1 text-xs text-text-secondary",
|
|
356
|
-
children: [e.productName, /* @__PURE__ */
|
|
360
|
+
children: [e.productName, /* @__PURE__ */ O("span", {
|
|
357
361
|
className: "text-text-primary",
|
|
358
362
|
children: [
|
|
359
363
|
e.quantity,
|
|
@@ -364,36 +368,36 @@ var N = () => {
|
|
|
364
368
|
}, `${e.productName}-${t}`))
|
|
365
369
|
})]
|
|
366
370
|
}),
|
|
367
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("h2", {
|
|
368
372
|
className: "mb-3 text-lg font-semibold text-text-primary",
|
|
369
|
-
children:
|
|
370
|
-
}),
|
|
371
|
-
description:
|
|
372
|
-
onRetry: () => void
|
|
373
|
-
}) :
|
|
374
|
-
icon: /* @__PURE__ */
|
|
375
|
-
title:
|
|
376
|
-
description:
|
|
377
|
-
action: /* @__PURE__ */
|
|
378
|
-
onClick: () =>
|
|
379
|
-
children: [/* @__PURE__ */
|
|
373
|
+
children: M("healthybowl.distribution.detail.membersTitle", "Members")
|
|
374
|
+
}), G.loading && Z.length === 0 ? /* @__PURE__ */ D(d, {}) : G.error && Z.length === 0 ? /* @__PURE__ */ D(c, {
|
|
375
|
+
description: G.error.message,
|
|
376
|
+
onRetry: () => void G.refetch()
|
|
377
|
+
}) : Z.length === 0 ? /* @__PURE__ */ D(s, {
|
|
378
|
+
icon: /* @__PURE__ */ D(E, { className: "h-8 w-8 text-text-secondary" }),
|
|
379
|
+
title: M("healthybowl.distribution.detail.empty.title", "No members yet"),
|
|
380
|
+
description: M("healthybowl.distribution.detail.empty.description", "Enroll members to start scheduling their recurring boxes."),
|
|
381
|
+
action: /* @__PURE__ */ O(k, {
|
|
382
|
+
onClick: () => q(!0),
|
|
383
|
+
children: [/* @__PURE__ */ D(E, { className: "h-4 w-4" }), M("healthybowl.distribution.detail.actions.enroll", "Enroll member")]
|
|
380
384
|
})
|
|
381
|
-
}) : /* @__PURE__ */
|
|
382
|
-
columns:
|
|
383
|
-
data:
|
|
385
|
+
}) : /* @__PURE__ */ D(a, {
|
|
386
|
+
columns: $,
|
|
387
|
+
data: Z,
|
|
384
388
|
keyField: "id",
|
|
385
389
|
pageSize: 10
|
|
386
390
|
})] }),
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
-
open:
|
|
389
|
-
onClose: () =>
|
|
390
|
-
planName:
|
|
391
|
-
onSubmit:
|
|
391
|
+
/* @__PURE__ */ D(g, {
|
|
392
|
+
open: K,
|
|
393
|
+
onClose: () => q(!1),
|
|
394
|
+
planName: X.name,
|
|
395
|
+
onSubmit: ae
|
|
392
396
|
})
|
|
393
397
|
]
|
|
394
398
|
});
|
|
395
399
|
};
|
|
396
400
|
//#endregion
|
|
397
|
-
export {
|
|
401
|
+
export { M as CsaPlanDetailPage };
|
|
398
402
|
|
|
399
403
|
//# sourceMappingURL=CsaPlanDetailPage.js.map
|