@burdenoff/microfe-healthybowl 2026.1119.1 → 2026.1119.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.
- package/dist/healthybowl/hooks/useOpenOnAction.d.ts +18 -0
- package/dist/healthybowl/hooks/useOpenOnAction.js +20 -0
- package/dist/healthybowl/index.d.ts +2 -0
- package/dist/healthybowl/index.js +2 -1
- package/dist/healthybowl/newActionPaths.d.ts +8 -0
- package/dist/healthybowl/newActionPaths.js +12 -0
- package/dist/healthybowl/pages/contacts/ContactsPage.js +116 -113
- package/dist/healthybowl/pages/crops/CropFieldsPage.js +64 -61
- package/dist/healthybowl/pages/crops/CropHarvestPage.js +284 -281
- package/dist/healthybowl/pages/crops/CropsPage.js +239 -236
- package/dist/healthybowl/pages/financial/TransactionsPage.js +301 -298
- package/dist/healthybowl/pages/livestock/AnimalRegistryPage.js +373 -370
- package/dist/healthybowl/pages/livestock/ProductionTrackingPage.js +279 -276
- package/dist/healthybowl/pages/tasks/TasksPage.js +99 -96
- package/dist/index.js +3 -2
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useOpenOnAction — lets another surface (the app's "+ New" menu) deep-link into a page's
|
|
3
|
+
* existing Add dialog with `?action=new` (BOFF-15554).
|
|
4
|
+
*
|
|
5
|
+
* Behaviour:
|
|
6
|
+
* - `?action=<action>` present and `enabled` → call `open()` ONCE, then remove the param with a
|
|
7
|
+
* history REPLACE (no extra entry; every other query param is kept).
|
|
8
|
+
* - any other value, or no param → nothing happens, exactly as before.
|
|
9
|
+
* - `enabled === false` (the user cannot create: the page's Add button is hidden/disabled, or the
|
|
10
|
+
* gate is still resolving) → nothing opens and the param is left alone, so it fires once the
|
|
11
|
+
* gate settles in the user's favour and never for a user who cannot create.
|
|
12
|
+
* - navigating to `?action=new` again while the page is already mounted opens it again.
|
|
13
|
+
*
|
|
14
|
+
* @module healthybowl
|
|
15
|
+
*/
|
|
16
|
+
/** Query parameter the "+ New" menu sets. */
|
|
17
|
+
export declare const NEW_ACTION_PARAM = "action";
|
|
18
|
+
export declare function useOpenOnAction(action: string, open: () => void, enabled?: boolean): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useEffect as e, useRef as t } from "react";
|
|
2
|
+
import { useSearchParams as n } from "react-router";
|
|
3
|
+
// src/healthybowl/hooks/useOpenOnAction.ts
|
|
4
|
+
var r = "action";
|
|
5
|
+
function i(i, a, o = !0) {
|
|
6
|
+
let [s, c] = n(), l = t(a);
|
|
7
|
+
l.current = a;
|
|
8
|
+
let u = t(!1), d = s.get(r) === i;
|
|
9
|
+
e(() => {
|
|
10
|
+
d ? o && !u.current && (u.current = !0, l.current(), c((e) => {
|
|
11
|
+
let t = new URLSearchParams(e);
|
|
12
|
+
return t.delete(r), t;
|
|
13
|
+
}, { replace: !0 })) : u.current = !1;
|
|
14
|
+
}, [
|
|
15
|
+
d,
|
|
16
|
+
o,
|
|
17
|
+
c
|
|
18
|
+
]);
|
|
19
|
+
}
|
|
20
|
+
export { r as NEW_ACTION_PARAM, i as useOpenOnAction };
|
|
@@ -15,3 +15,5 @@ export type { OfflinePurgeTarget as HealthyBowlOfflinePurgeTarget } from './offl
|
|
|
15
15
|
export { useHealthyBowlStore } from './store/healthybowlStore';
|
|
16
16
|
export { AIAssistantPanel } from '../components/assistant';
|
|
17
17
|
export type { AIAssistantPanelProps } from '../components/assistant';
|
|
18
|
+
export { HB_NEW_ACTION_PATHS } from './newActionPaths';
|
|
19
|
+
export type { HbNewActionPath } from './newActionPaths';
|
|
@@ -7,4 +7,5 @@ import { PublicSeedLotPage as o } from "./public/PublicSeedLotPage.js";
|
|
|
7
7
|
import { useHealthyBowl as s } from "./context/HealthyBowlContext.js";
|
|
8
8
|
import { useHealthyBowlStore as c } from "./store/healthybowlStore.js";
|
|
9
9
|
import "../components/assistant/index.js";
|
|
10
|
-
|
|
10
|
+
import { HB_NEW_ACTION_PATHS as l } from "./newActionPaths.js";
|
|
11
|
+
export { l as HB_NEW_ACTION_PATHS, n as HEALTHYBOWL_RYBBIT_EVENT_ALLOWLIST, e as HealthyBowlRoot, o as PublicSeedLotPage, t as PublicTracePage, r as lockHealthyBowlOfflineData, i as purgeHealthyBowlOfflineData, a as unlockHealthyBowlOfflineData, s as useHealthyBowl, c as useHealthyBowlStore };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pages that open their existing Add dialog from `?action=new` (BOFF-15554), for the app's
|
|
3
|
+
* "+ New" menu. Absolute paths under the default `/healthybowl` mount; build the link as
|
|
4
|
+
* `${path}?action=new`. Keep in step with the `useOpenOnAction('new', …)` call sites.
|
|
5
|
+
* @module healthybowl
|
|
6
|
+
*/
|
|
7
|
+
export declare const HB_NEW_ACTION_PATHS: readonly ["/healthybowl/crops/harvest", "/healthybowl/livestock/production", "/healthybowl/financial/transactions", "/healthybowl/tasks", "/healthybowl/crops", "/healthybowl/livestock/animals", "/healthybowl/crops/fields", "/healthybowl/contacts"];
|
|
8
|
+
export type HbNewActionPath = (typeof HB_NEW_ACTION_PATHS)[number];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/healthybowl/newActionPaths.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"/healthybowl/crops/harvest",
|
|
4
|
+
"/healthybowl/livestock/production",
|
|
5
|
+
"/healthybowl/financial/transactions",
|
|
6
|
+
"/healthybowl/tasks",
|
|
7
|
+
"/healthybowl/crops",
|
|
8
|
+
"/healthybowl/livestock/animals",
|
|
9
|
+
"/healthybowl/crops/fields",
|
|
10
|
+
"/healthybowl/contacts"
|
|
11
|
+
];
|
|
12
|
+
export { e as HB_NEW_ACTION_PATHS };
|
|
@@ -6,66 +6,69 @@ import { DataTable as r } from "../../components/DataTable.js";
|
|
|
6
6
|
import { StatusBadge as i } from "../../components/StatusBadge.js";
|
|
7
7
|
import { EmptyState as a } from "../../components/EmptyState.js";
|
|
8
8
|
import { ErrorState as o } from "../../components/ErrorState.js";
|
|
9
|
-
import { useConfirm as
|
|
10
|
-
import { PageLoader as
|
|
11
|
-
import { useBasePath as
|
|
9
|
+
import { useConfirm as ee } from "../../components/ConfirmDialog.js";
|
|
10
|
+
import { PageLoader as s } from "../../components/PageLoader.js";
|
|
11
|
+
import { useBasePath as c } from "../../hooks/useBasePath.js";
|
|
12
|
+
import { useOpenOnAction as l } from "../../hooks/useOpenOnAction.js";
|
|
12
13
|
import { cn as u } from "../../utils/helpers.js";
|
|
13
14
|
import { useHealthyBowlContacts as d } from "../../hooks/useHealthyBowlContacts.js";
|
|
14
15
|
import { ContactFormModal as f } from "./ContactFormModal.js";
|
|
15
16
|
import { CsvImportModal as p } from "./CsvImportModal.js";
|
|
16
|
-
import { CONTACT_TYPE_TABS as
|
|
17
|
-
import { useMemo as
|
|
18
|
-
import { useI18n as
|
|
19
|
-
import { Contact as
|
|
20
|
-
import { useNavigate as
|
|
21
|
-
import { Fragment as
|
|
22
|
-
import { Button as
|
|
17
|
+
import { CONTACT_TYPE_TABS as te, contactStatusVariant as m, contactTypeLabel as h, contactTypeVariant as g } from "./labels.js";
|
|
18
|
+
import { useMemo as _, useState as v } from "react";
|
|
19
|
+
import { useI18n as y } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
20
|
+
import { Contact as b, Pencil as ne, Plus as x, Search as S, Trash2 as C, Upload as w, Users as T } from "lucide-react";
|
|
21
|
+
import { useNavigate as E } from "react-router";
|
|
22
|
+
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
23
|
+
import { Button as A, Input as j } from "@burdenoff/fe-libs/ui";
|
|
23
24
|
// src/healthybowl/pages/contacts/ContactsPage.tsx
|
|
24
|
-
var
|
|
25
|
-
let { t:
|
|
25
|
+
var M = () => {
|
|
26
|
+
let { t: M } = y(), N = E(), { buildPath: P } = c(), { toast: F } = t(), I = ee(), [L, R] = v(null), [z, B] = v(""), [V, H] = v(!1), [U, W] = v(!1), [G, K] = v(null), [q, J] = v(null), { contacts: Y, loading: X, errors: Z, refetchContacts: re, createContact: ie, updateContact: ae, deleteContact: oe, importContacts: se } = d({
|
|
26
27
|
list: !0,
|
|
27
|
-
type:
|
|
28
|
-
search:
|
|
29
|
-
}),
|
|
30
|
-
K(null),
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
type: L,
|
|
29
|
+
search: z.trim() || null
|
|
30
|
+
}), Q = () => {
|
|
31
|
+
K(null), H(!0);
|
|
32
|
+
};
|
|
33
|
+
l("new", Q);
|
|
34
|
+
let ce = (e) => {
|
|
35
|
+
K(e), H(!0);
|
|
36
|
+
}, le = async (e) => {
|
|
37
|
+
G ? (await ae(e), F({
|
|
38
|
+
title: M("healthybowl.contacts.toast.updated", "Contact updated"),
|
|
36
39
|
description: String(e.name ?? G.name),
|
|
37
40
|
variant: "success"
|
|
38
|
-
})) : (await
|
|
39
|
-
title:
|
|
41
|
+
})) : (await ie(e), F({
|
|
42
|
+
title: M("healthybowl.contacts.toast.created", "Contact added"),
|
|
40
43
|
description: String(e.name ?? ""),
|
|
41
44
|
variant: "success"
|
|
42
45
|
}));
|
|
43
|
-
},
|
|
44
|
-
let t = await
|
|
45
|
-
return t &&
|
|
46
|
-
title:
|
|
47
|
-
description:
|
|
46
|
+
}, $ = async (e) => {
|
|
47
|
+
let t = await se(e);
|
|
48
|
+
return t && F({
|
|
49
|
+
title: M("healthybowl.contacts.toast.imported", "Import complete"),
|
|
50
|
+
description: M("healthybowl.contacts.toast.importedDesc", "{{imported}} added, {{updated}} updated, {{skipped}} skipped", {
|
|
48
51
|
imported: t.imported,
|
|
49
52
|
updated: t.updated,
|
|
50
53
|
skipped: t.skipped
|
|
51
54
|
}),
|
|
52
55
|
variant: "success"
|
|
53
56
|
}), t;
|
|
54
|
-
},
|
|
55
|
-
if (await
|
|
56
|
-
title:
|
|
57
|
-
message:
|
|
57
|
+
}, ue = async (e) => {
|
|
58
|
+
if (await I({
|
|
59
|
+
title: M("healthybowl.contacts.confirm.deleteTitle", "Delete contact?"),
|
|
60
|
+
message: M("healthybowl.contacts.confirm.delete", "Delete \"{{name}}\"? This cannot be undone.", { name: e.name })
|
|
58
61
|
})) {
|
|
59
62
|
J(e.id);
|
|
60
63
|
try {
|
|
61
|
-
await
|
|
62
|
-
title:
|
|
64
|
+
await oe(e.id), F({
|
|
65
|
+
title: M("healthybowl.contacts.toast.deleted", "Contact deleted"),
|
|
63
66
|
description: e.name,
|
|
64
67
|
variant: "success"
|
|
65
68
|
});
|
|
66
69
|
} catch (e) {
|
|
67
|
-
|
|
68
|
-
title:
|
|
70
|
+
F({
|
|
71
|
+
title: M("healthybowl.contacts.toast.deleteFailed", "Could not delete contact"),
|
|
69
72
|
description: e instanceof Error ? e.message : String(e),
|
|
70
73
|
variant: "error"
|
|
71
74
|
});
|
|
@@ -73,47 +76,47 @@ var N = () => {
|
|
|
73
76
|
J(null);
|
|
74
77
|
}
|
|
75
78
|
}
|
|
76
|
-
},
|
|
79
|
+
}, de = _(() => Y.filter((e) => e.type === "BUYER").length, [Y]), fe = _(() => Y.filter((e) => e.type === "SUPPLIER").length, [Y]), pe = [
|
|
77
80
|
{
|
|
78
81
|
key: "name",
|
|
79
|
-
header:
|
|
80
|
-
render: (e) => /* @__PURE__ */
|
|
82
|
+
header: M("healthybowl.contacts.table.name", "Name"),
|
|
83
|
+
render: (e) => /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("div", {
|
|
81
84
|
className: "font-medium text-text-primary",
|
|
82
85
|
children: e.name
|
|
83
|
-
}), /* @__PURE__ */
|
|
86
|
+
}), /* @__PURE__ */ O("div", {
|
|
84
87
|
className: "text-xs text-text-secondary",
|
|
85
|
-
children:
|
|
88
|
+
children: h(e.type)
|
|
86
89
|
})] })
|
|
87
90
|
},
|
|
88
91
|
{
|
|
89
92
|
key: "type",
|
|
90
|
-
header:
|
|
91
|
-
render: (e) => /* @__PURE__ */
|
|
92
|
-
variant:
|
|
93
|
-
label:
|
|
93
|
+
header: M("healthybowl.contacts.table.type", "Type"),
|
|
94
|
+
render: (e) => /* @__PURE__ */ O(i, {
|
|
95
|
+
variant: g(e.type),
|
|
96
|
+
label: h(e.type)
|
|
94
97
|
})
|
|
95
98
|
},
|
|
96
99
|
{
|
|
97
100
|
key: "lastActivity",
|
|
98
|
-
header:
|
|
99
|
-
render: (e) => /* @__PURE__ */
|
|
101
|
+
header: M("healthybowl.contacts.table.lastActivity", "Last Order / Purchase"),
|
|
102
|
+
render: (e) => /* @__PURE__ */ O("span", {
|
|
100
103
|
className: "tabular-nums text-text-secondary",
|
|
101
104
|
children: e.type === "SUPPLIER" ? e.lastPurchaseDate ?? "—" : e.lastOrderDate ?? "—"
|
|
102
105
|
})
|
|
103
106
|
},
|
|
104
107
|
{
|
|
105
108
|
key: "phone",
|
|
106
|
-
header:
|
|
107
|
-
render: (e) => /* @__PURE__ */
|
|
109
|
+
header: M("healthybowl.contacts.table.phone", "Phone"),
|
|
110
|
+
render: (e) => /* @__PURE__ */ O("span", {
|
|
108
111
|
className: "text-text-secondary",
|
|
109
112
|
children: e.phone ?? "—"
|
|
110
113
|
})
|
|
111
114
|
},
|
|
112
115
|
{
|
|
113
116
|
key: "status",
|
|
114
|
-
header:
|
|
115
|
-
render: (e) => /* @__PURE__ */
|
|
116
|
-
variant:
|
|
117
|
+
header: M("healthybowl.contacts.table.status", "Status"),
|
|
118
|
+
render: (e) => /* @__PURE__ */ O(i, {
|
|
119
|
+
variant: m(e.status),
|
|
117
120
|
label: e.status.toLowerCase(),
|
|
118
121
|
dot: !0
|
|
119
122
|
})
|
|
@@ -121,118 +124,118 @@ var N = () => {
|
|
|
121
124
|
{
|
|
122
125
|
key: "actions",
|
|
123
126
|
header: "",
|
|
124
|
-
render: (e) => /* @__PURE__ */
|
|
127
|
+
render: (e) => /* @__PURE__ */ k("div", {
|
|
125
128
|
className: "flex items-center justify-end gap-1",
|
|
126
|
-
children: [/* @__PURE__ */
|
|
129
|
+
children: [/* @__PURE__ */ O(A, {
|
|
127
130
|
variant: "ghost",
|
|
128
131
|
size: "icon-sm",
|
|
129
132
|
disabled: q === e.id,
|
|
130
133
|
onClick: (t) => {
|
|
131
|
-
t.stopPropagation(),
|
|
134
|
+
t.stopPropagation(), ce(e);
|
|
132
135
|
},
|
|
133
|
-
"aria-label":
|
|
134
|
-
children: /* @__PURE__ */
|
|
135
|
-
}), /* @__PURE__ */
|
|
136
|
+
"aria-label": M("healthybowl.contacts.actions.edit", "Edit contact"),
|
|
137
|
+
children: /* @__PURE__ */ O(ne, { className: "h-4 w-4" })
|
|
138
|
+
}), /* @__PURE__ */ O(A, {
|
|
136
139
|
variant: "ghost",
|
|
137
140
|
size: "icon-sm",
|
|
138
141
|
disabled: q === e.id,
|
|
139
142
|
onClick: (t) => {
|
|
140
|
-
t.stopPropagation(),
|
|
143
|
+
t.stopPropagation(), ue(e);
|
|
141
144
|
},
|
|
142
|
-
"aria-label":
|
|
145
|
+
"aria-label": M("healthybowl.contacts.actions.delete", "Delete contact"),
|
|
143
146
|
className: "text-text-secondary hover:text-status-error-text",
|
|
144
|
-
children: /* @__PURE__ */
|
|
147
|
+
children: /* @__PURE__ */ O(C, { className: "h-4 w-4" })
|
|
145
148
|
})]
|
|
146
149
|
})
|
|
147
150
|
}
|
|
148
151
|
];
|
|
149
|
-
return X.list && Y.length === 0 ? /* @__PURE__ */
|
|
150
|
-
title:
|
|
151
|
-
titleAccent:
|
|
152
|
-
description:
|
|
153
|
-
actions: /* @__PURE__ */
|
|
152
|
+
return X.list && Y.length === 0 ? /* @__PURE__ */ O(s, {}) : /* @__PURE__ */ k(e, {
|
|
153
|
+
title: M("healthybowl.contacts.title", "Contacts"),
|
|
154
|
+
titleAccent: M("healthybowl.contacts.titleAccent", "Contacts"),
|
|
155
|
+
description: M("healthybowl.contacts.description", "Your buyers and suppliers — contact details, notes, and order history."),
|
|
156
|
+
actions: /* @__PURE__ */ k("div", {
|
|
154
157
|
className: "flex items-center gap-2",
|
|
155
|
-
children: [/* @__PURE__ */ A
|
|
158
|
+
children: [/* @__PURE__ */ k(A, {
|
|
156
159
|
variant: "outline",
|
|
157
160
|
onClick: () => W(!0),
|
|
158
|
-
children: [/* @__PURE__ */
|
|
159
|
-
}), /* @__PURE__ */ A
|
|
160
|
-
onClick:
|
|
161
|
-
children: [/* @__PURE__ */
|
|
161
|
+
children: [/* @__PURE__ */ O(w, { className: "h-4 w-4" }), M("healthybowl.contacts.actions.import", "Import CSV")]
|
|
162
|
+
}), /* @__PURE__ */ k(A, {
|
|
163
|
+
onClick: Q,
|
|
164
|
+
children: [/* @__PURE__ */ O(x, { className: "h-4 w-4" }), M("healthybowl.contacts.actions.new", "Add Contact")]
|
|
162
165
|
})]
|
|
163
166
|
}),
|
|
164
167
|
children: [
|
|
165
|
-
Z.list && Y.length === 0 ? /* @__PURE__ */
|
|
168
|
+
Z.list && Y.length === 0 ? /* @__PURE__ */ O(o, {
|
|
166
169
|
description: Z.list.message,
|
|
167
|
-
onRetry: () => void
|
|
168
|
-
}) : /* @__PURE__ */
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
+
onRetry: () => void re()
|
|
171
|
+
}) : /* @__PURE__ */ k(D, { children: [
|
|
172
|
+
/* @__PURE__ */ k("div", {
|
|
170
173
|
className: "mt-4 grid grid-cols-1 gap-3 sm:grid-cols-3",
|
|
171
174
|
children: [
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
label:
|
|
175
|
+
/* @__PURE__ */ O(n, {
|
|
176
|
+
label: M("healthybowl.contacts.stats.total", "Contacts"),
|
|
174
177
|
value: Y.length,
|
|
175
|
-
icon: /* @__PURE__ */
|
|
178
|
+
icon: /* @__PURE__ */ O(T, { className: "h-5 w-5" }),
|
|
176
179
|
hero: !0
|
|
177
180
|
}),
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
label:
|
|
180
|
-
value: ue
|
|
181
|
-
}),
|
|
182
|
-
/* @__PURE__ */ k(n, {
|
|
183
|
-
label: N("healthybowl.contacts.stats.suppliers", "Suppliers"),
|
|
181
|
+
/* @__PURE__ */ O(n, {
|
|
182
|
+
label: M("healthybowl.contacts.stats.buyers", "Buyers"),
|
|
184
183
|
value: de
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ O(n, {
|
|
186
|
+
label: M("healthybowl.contacts.stats.suppliers", "Suppliers"),
|
|
187
|
+
value: fe
|
|
185
188
|
})
|
|
186
189
|
]
|
|
187
190
|
}),
|
|
188
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ k("div", {
|
|
189
192
|
className: "mt-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
190
|
-
children: [/* @__PURE__ */
|
|
193
|
+
children: [/* @__PURE__ */ O("div", {
|
|
191
194
|
className: "flex flex-wrap gap-1",
|
|
192
|
-
children:
|
|
195
|
+
children: te.map((e) => /* @__PURE__ */ O("button", {
|
|
193
196
|
type: "button",
|
|
194
|
-
onClick: () =>
|
|
195
|
-
className: u("rounded-full px-3 py-1.5 text-sm font-medium transition-colors",
|
|
196
|
-
children:
|
|
197
|
+
onClick: () => R(e.value),
|
|
198
|
+
className: u("rounded-full px-3 py-1.5 text-sm font-medium transition-colors", L === e.value ? "bg-accent-teal text-white" : "bg-bg-sunken text-text-secondary hover:text-text-primary"),
|
|
199
|
+
children: M(`healthybowl.contacts.tabs.${e.key.toLowerCase()}`, e.label)
|
|
197
200
|
}, e.key))
|
|
198
|
-
}), /* @__PURE__ */
|
|
201
|
+
}), /* @__PURE__ */ k("div", {
|
|
199
202
|
className: "relative sm:w-64",
|
|
200
|
-
children: [/* @__PURE__ */
|
|
201
|
-
value:
|
|
202
|
-
onChange: (e) =>
|
|
203
|
-
placeholder:
|
|
203
|
+
children: [/* @__PURE__ */ O(S, { className: "pointer-events-none absolute start-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-text-tertiary" }), /* @__PURE__ */ O(j, {
|
|
204
|
+
value: z,
|
|
205
|
+
onChange: (e) => B(e.target.value),
|
|
206
|
+
placeholder: M("healthybowl.contacts.search", "Search name, phone, email"),
|
|
204
207
|
className: "ps-8"
|
|
205
208
|
})]
|
|
206
209
|
})]
|
|
207
210
|
}),
|
|
208
|
-
Y.length === 0 ? /* @__PURE__ */
|
|
209
|
-
icon: /* @__PURE__ */
|
|
210
|
-
title:
|
|
211
|
-
description:
|
|
212
|
-
action: /* @__PURE__ */ A
|
|
213
|
-
onClick:
|
|
214
|
-
children: [/* @__PURE__ */
|
|
211
|
+
Y.length === 0 ? /* @__PURE__ */ O(a, {
|
|
212
|
+
icon: /* @__PURE__ */ O(b, { className: "h-8 w-8 text-text-secondary" }),
|
|
213
|
+
title: M("healthybowl.contacts.empty.title", "No contacts yet"),
|
|
214
|
+
description: M("healthybowl.contacts.empty.description", "Add a buyer or supplier, or import your existing contacts from a CSV."),
|
|
215
|
+
action: /* @__PURE__ */ k(A, {
|
|
216
|
+
onClick: Q,
|
|
217
|
+
children: [/* @__PURE__ */ O(x, { className: "h-4 w-4" }), M("healthybowl.contacts.actions.new", "Add Contact")]
|
|
215
218
|
})
|
|
216
|
-
}) : /* @__PURE__ */
|
|
217
|
-
columns:
|
|
219
|
+
}) : /* @__PURE__ */ O(r, {
|
|
220
|
+
columns: pe,
|
|
218
221
|
data: Y,
|
|
219
222
|
keyField: "id",
|
|
220
223
|
pageSize: 12,
|
|
221
|
-
onRowClick: (e) => P(
|
|
224
|
+
onRowClick: (e) => N(P(`contacts/${e.id}`))
|
|
222
225
|
})
|
|
223
226
|
] }),
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
open:
|
|
226
|
-
onClose: () =>
|
|
227
|
+
/* @__PURE__ */ O(f, {
|
|
228
|
+
open: V,
|
|
229
|
+
onClose: () => H(!1),
|
|
227
230
|
contact: G,
|
|
228
|
-
onSubmit:
|
|
231
|
+
onSubmit: le
|
|
229
232
|
}),
|
|
230
|
-
/* @__PURE__ */
|
|
231
|
-
open:
|
|
233
|
+
/* @__PURE__ */ O(p, {
|
|
234
|
+
open: U,
|
|
232
235
|
onClose: () => W(!1),
|
|
233
|
-
onImport:
|
|
236
|
+
onImport: $
|
|
234
237
|
})
|
|
235
238
|
]
|
|
236
239
|
});
|
|
237
240
|
};
|
|
238
|
-
export {
|
|
241
|
+
export { M as ContactsPage };
|