@burdenoff/microfe-proserviceworld 2026.801.1 → 2026.827.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/proserviceworld/hooks/useActorNames.d.ts +16 -0
- package/dist/proserviceworld/hooks/useActorNames.d.ts.map +1 -0
- package/dist/proserviceworld/hooks/useActorNames.js +18 -0
- package/dist/proserviceworld/hooks/useActorNames.js.map +1 -0
- package/dist/proserviceworld/hooks/useProServiceWorldApi.d.ts +53 -0
- package/dist/proserviceworld/hooks/useProServiceWorldApi.d.ts.map +1 -1
- package/dist/proserviceworld/hooks/useProServiceWorldApi.js +289 -227
- package/dist/proserviceworld/hooks/useProServiceWorldApi.js.map +1 -1
- package/dist/proserviceworld/pages/ClientDetailPage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/ClientDetailPage.js +268 -144
- package/dist/proserviceworld/pages/ClientDetailPage.js.map +1 -1
- package/dist/proserviceworld/pages/ClientsPage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/ClientsPage.js +244 -163
- package/dist/proserviceworld/pages/ClientsPage.js.map +1 -1
- package/dist/proserviceworld/pages/EngagementDetailPage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/EngagementDetailPage.js +420 -186
- package/dist/proserviceworld/pages/EngagementDetailPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -6,22 +6,22 @@ import { t as C } from "../i18n/index.js";
|
|
|
6
6
|
import { useAnalytics as w } from "../hooks/useAnalytics.js";
|
|
7
7
|
import { impactFeedback as T } from "../utils/native.js";
|
|
8
8
|
import { TagPicker as E } from "../components/TagPicker.js";
|
|
9
|
-
import { LoadMore as
|
|
10
|
-
import { useMemo as
|
|
11
|
-
import { Archive as
|
|
12
|
-
import { Fragment as
|
|
13
|
-
import { Button as
|
|
9
|
+
import { LoadMore as ee } from "../components/LoadMore.js";
|
|
10
|
+
import { useMemo as D, useState as O } from "react";
|
|
11
|
+
import { Archive as k, Building2 as te, ChevronRight as A, Pencil as j, Plus as M, Search as ne, User as re, Users as N } from "lucide-react";
|
|
12
|
+
import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
13
|
+
import { Button as L } from "@burdenoff/fe-libs/ui";
|
|
14
14
|
//#region src/proserviceworld/pages/ClientsPage.tsx
|
|
15
|
-
var
|
|
15
|
+
var R = ["ORGANIZATION", "INDIVIDUAL"], z = [
|
|
16
16
|
"PROSPECT",
|
|
17
17
|
"ACTIVE",
|
|
18
18
|
"INACTIVE",
|
|
19
19
|
"ARCHIVED"
|
|
20
|
-
],
|
|
20
|
+
], B = (e) => e.split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpperCase() ?? "").join("") || "?", V = ({ name: e, className: t }) => /* @__PURE__ */ F("span", {
|
|
21
21
|
className: a("flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-accent/10 text-xs font-semibold text-accent ring-1 ring-inset ring-accent/15", t),
|
|
22
22
|
"aria-hidden": !0,
|
|
23
|
-
children:
|
|
24
|
-
}),
|
|
23
|
+
children: B(e)
|
|
24
|
+
}), H = {
|
|
25
25
|
name: "",
|
|
26
26
|
type: "ORGANIZATION",
|
|
27
27
|
status: "PROSPECT",
|
|
@@ -30,48 +30,48 @@ var z = ["ORGANIZATION", "INDIVIDUAL"], B = [
|
|
|
30
30
|
contactEmail: "",
|
|
31
31
|
contactPhone: "",
|
|
32
32
|
notes: ""
|
|
33
|
-
},
|
|
34
|
-
let e = i(), { emitIntent: n, emitFact: a } = w(), [l, d] =
|
|
35
|
-
limit:
|
|
33
|
+
}, U = 25, W = () => {
|
|
34
|
+
let e = i(), { emitIntent: n, emitFact: a } = w(), [l, d] = O(""), [v, k] = O(""), [P, R] = O(null), [B, H] = O(!1), [W, q] = O(null), [ie, J] = O({
|
|
35
|
+
limit: U,
|
|
36
36
|
offset: 0
|
|
37
37
|
}), { data: Y, isLoading: X, error: Z, refetch: Q } = t({
|
|
38
38
|
search: l.trim() || void 0,
|
|
39
39
|
status: v || void 0,
|
|
40
40
|
pagination: ie
|
|
41
|
-
}),
|
|
42
|
-
return /* @__PURE__ */
|
|
41
|
+
}), $ = r(), ae = D(() => Y?.items ?? [], [Y]);
|
|
42
|
+
return /* @__PURE__ */ I("div", {
|
|
43
43
|
className: "space-y-6",
|
|
44
44
|
children: [
|
|
45
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ F(p, {
|
|
46
46
|
title: C("psw.clients.title"),
|
|
47
47
|
subtitle: C("psw.clients.subtitle"),
|
|
48
|
-
icon: /* @__PURE__ */
|
|
49
|
-
actions: /* @__PURE__ */ L
|
|
48
|
+
icon: /* @__PURE__ */ F(N, { className: "h-6 w-6" }),
|
|
49
|
+
actions: /* @__PURE__ */ I(L, {
|
|
50
50
|
onClick: () => {
|
|
51
|
-
T("light"), n("psw.client.create_clicked"),
|
|
51
|
+
T("light"), n("psw.client.create_clicked"), H(!0);
|
|
52
52
|
},
|
|
53
53
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ F(M, { className: "mr-1.5 h-4 w-4" }),
|
|
55
55
|
" ",
|
|
56
56
|
C("psw.clients.new")
|
|
57
57
|
]
|
|
58
58
|
})
|
|
59
59
|
}),
|
|
60
|
-
|
|
61
|
-
tone:
|
|
60
|
+
W && /* @__PURE__ */ F(o, {
|
|
61
|
+
tone: W.tone,
|
|
62
62
|
onClose: () => q(null),
|
|
63
|
-
children:
|
|
63
|
+
children: W.text
|
|
64
64
|
}),
|
|
65
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ I("div", {
|
|
66
66
|
className: "flex flex-col gap-2 sm:flex-row sm:items-center",
|
|
67
|
-
children: [/* @__PURE__ */
|
|
67
|
+
children: [/* @__PURE__ */ I("div", {
|
|
68
68
|
className: "relative flex-1",
|
|
69
|
-
children: [/* @__PURE__ */
|
|
69
|
+
children: [/* @__PURE__ */ F(ne, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-tertiary" }), /* @__PURE__ */ F(y, {
|
|
70
70
|
placeholder: C("psw.clients.searchPlaceholder"),
|
|
71
71
|
value: l,
|
|
72
72
|
onChange: (e) => {
|
|
73
73
|
d(e.target.value), J({
|
|
74
|
-
limit:
|
|
74
|
+
limit: U,
|
|
75
75
|
offset: 0
|
|
76
76
|
});
|
|
77
77
|
},
|
|
@@ -83,141 +83,222 @@ var z = ["ORGANIZATION", "INDIVIDUAL"], B = [
|
|
|
83
83
|
},
|
|
84
84
|
className: "pl-9"
|
|
85
85
|
})]
|
|
86
|
-
}), /* @__PURE__ */
|
|
86
|
+
}), /* @__PURE__ */ I(f, {
|
|
87
87
|
value: v,
|
|
88
88
|
onChange: (e) => {
|
|
89
|
-
|
|
90
|
-
limit:
|
|
89
|
+
k(e.target.value), J({
|
|
90
|
+
limit: U,
|
|
91
91
|
offset: 0
|
|
92
92
|
});
|
|
93
93
|
},
|
|
94
94
|
className: "sm:w-48",
|
|
95
|
-
children: [/* @__PURE__ */
|
|
95
|
+
children: [/* @__PURE__ */ F("option", {
|
|
96
96
|
value: "",
|
|
97
97
|
children: C("psw.clients.allStatuses")
|
|
98
|
-
}), x(
|
|
98
|
+
}), x(z)]
|
|
99
99
|
})]
|
|
100
100
|
}),
|
|
101
|
-
X ? /* @__PURE__ */
|
|
101
|
+
X ? /* @__PURE__ */ F(u, {}) : Z ? /* @__PURE__ */ F(c, {
|
|
102
102
|
error: Z,
|
|
103
103
|
onRetry: () => void Q()
|
|
104
|
-
}) : !Y || Y.items.length === 0 ? /* @__PURE__ */
|
|
104
|
+
}) : !Y || Y.items.length === 0 ? /* @__PURE__ */ F(s, {
|
|
105
105
|
title: C("psw.clients.emptyTitle"),
|
|
106
106
|
description: C("psw.clients.emptyDescription"),
|
|
107
|
-
icon: /* @__PURE__ */
|
|
108
|
-
action: /* @__PURE__ */ L
|
|
109
|
-
onClick: () =>
|
|
107
|
+
icon: /* @__PURE__ */ F(N, { className: "h-8 w-8" }),
|
|
108
|
+
action: /* @__PURE__ */ I(L, {
|
|
109
|
+
onClick: () => H(!0),
|
|
110
110
|
children: [
|
|
111
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ F(M, { className: "mr-1.5 h-4 w-4" }),
|
|
112
112
|
" ",
|
|
113
113
|
C("psw.clients.new")
|
|
114
114
|
]
|
|
115
115
|
})
|
|
116
|
-
}) : /* @__PURE__ */
|
|
116
|
+
}) : /* @__PURE__ */ I(m, {
|
|
117
117
|
title: `${Y.totalCount} client${Y.totalCount === 1 ? "" : "s"}`,
|
|
118
|
-
children: [
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
children: C("psw.common.actions")
|
|
128
|
-
})
|
|
129
|
-
] }) }), /* @__PURE__ */ I("tbody", { children: Y.items.map((t) => /* @__PURE__ */ L("tr", {
|
|
130
|
-
className: "group cursor-pointer transition-colors hover:bg-bg-sunken/60",
|
|
131
|
-
onClick: () => e(`clients/${t.id}`),
|
|
132
|
-
children: [
|
|
133
|
-
/* @__PURE__ */ I(_, { children: /* @__PURE__ */ L("div", {
|
|
134
|
-
className: "flex items-center gap-3",
|
|
135
|
-
children: [/* @__PURE__ */ I(H, { name: t.name }), /* @__PURE__ */ L("div", {
|
|
136
|
-
className: "min-w-0",
|
|
137
|
-
children: [/* @__PURE__ */ L("div", {
|
|
138
|
-
className: "flex items-center gap-1 font-medium text-text-primary transition-colors group-hover:text-accent",
|
|
139
|
-
children: [/* @__PURE__ */ I("span", {
|
|
140
|
-
className: "truncate",
|
|
141
|
-
children: t.name
|
|
142
|
-
}), /* @__PURE__ */ I(te, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary opacity-0 transition-opacity group-hover:opacity-100" })]
|
|
143
|
-
}), t.contactName ? /* @__PURE__ */ I("div", {
|
|
144
|
-
className: "truncate text-xs text-text-tertiary",
|
|
145
|
-
children: t.contactName
|
|
146
|
-
}) : null]
|
|
147
|
-
})]
|
|
148
|
-
}) }),
|
|
149
|
-
/* @__PURE__ */ I(_, { children: /* @__PURE__ */ L("span", {
|
|
150
|
-
className: "inline-flex items-center gap-1.5 text-text-secondary",
|
|
151
|
-
children: [t.type === "ORGANIZATION" ? /* @__PURE__ */ I(ee, { className: "h-3.5 w-3.5 text-text-tertiary" }) : /* @__PURE__ */ I(N, { className: "h-3.5 w-3.5 text-text-tertiary" }), t.type === "ORGANIZATION" ? "Organization" : "Individual"]
|
|
152
|
-
}) }),
|
|
153
|
-
/* @__PURE__ */ I(_, { children: t.industry || "—" }),
|
|
154
|
-
/* @__PURE__ */ I(_, { children: /* @__PURE__ */ I(h, { status: t.status }) }),
|
|
155
|
-
/* @__PURE__ */ I(_, {
|
|
156
|
-
className: "whitespace-nowrap",
|
|
157
|
-
children: S(t.createdAt)
|
|
158
|
-
}),
|
|
159
|
-
/* @__PURE__ */ I(_, { children: /* @__PURE__ */ I("div", {
|
|
160
|
-
onClick: (e) => e.stopPropagation(),
|
|
161
|
-
role: "presentation",
|
|
162
|
-
children: /* @__PURE__ */ I(E, {
|
|
163
|
-
entityType: "PswClient",
|
|
164
|
-
entityId: t.id,
|
|
165
|
-
tags: t.tags ?? [],
|
|
166
|
-
onChange: async (e) => {
|
|
167
|
-
await ae.mutateAsync({
|
|
168
|
-
id: t.id,
|
|
169
|
-
input: { tags: e }
|
|
170
|
-
}), Q();
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ F("ul", {
|
|
120
|
+
className: "space-y-2.5 sm:hidden",
|
|
121
|
+
children: Y.items.map((t) => /* @__PURE__ */ I("li", {
|
|
122
|
+
className: "overflow-hidden rounded-xl border border-border-seam bg-bg-canvas",
|
|
123
|
+
children: [/* @__PURE__ */ I("button", {
|
|
124
|
+
type: "button",
|
|
125
|
+
onClick: () => {
|
|
126
|
+
T("light"), e(`clients/${t.id}`);
|
|
171
127
|
},
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
128
|
+
className: "flex w-full items-center gap-3 p-3.5 text-left transition-colors active:bg-bg-sunken/60",
|
|
129
|
+
children: [
|
|
130
|
+
/* @__PURE__ */ F(V, {
|
|
131
|
+
name: t.name,
|
|
132
|
+
className: "h-11 w-11 text-sm"
|
|
133
|
+
}),
|
|
134
|
+
/* @__PURE__ */ I("span", {
|
|
135
|
+
className: "min-w-0 flex-1",
|
|
136
|
+
children: [
|
|
137
|
+
/* @__PURE__ */ F("span", {
|
|
138
|
+
className: "block truncate text-sm font-semibold text-text-primary",
|
|
139
|
+
children: t.name
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ F("span", {
|
|
142
|
+
className: "mt-0.5 block truncate text-sm text-text-secondary",
|
|
143
|
+
children: t.contactName || (t.type === "ORGANIZATION" ? "Organization" : "Individual")
|
|
144
|
+
}),
|
|
145
|
+
/* @__PURE__ */ I("span", {
|
|
146
|
+
className: "mt-1.5 flex items-center gap-2",
|
|
147
|
+
children: [/* @__PURE__ */ F("span", {
|
|
148
|
+
className: "truncate text-xs text-text-tertiary",
|
|
149
|
+
children: t.industry || S(t.createdAt)
|
|
150
|
+
}), /* @__PURE__ */ F(h, { status: t.status })]
|
|
151
|
+
})
|
|
152
|
+
]
|
|
153
|
+
}),
|
|
154
|
+
/* @__PURE__ */ F(A, { className: "h-4 w-4 shrink-0 text-text-tertiary" })
|
|
155
|
+
]
|
|
156
|
+
}), /* @__PURE__ */ I("div", {
|
|
157
|
+
className: "flex items-center justify-between gap-2 border-t border-border-seam px-3.5 py-2",
|
|
158
|
+
children: [/* @__PURE__ */ F("div", {
|
|
159
|
+
className: "min-w-0 flex-1",
|
|
160
|
+
children: /* @__PURE__ */ F(E, {
|
|
161
|
+
entityType: "PswClient",
|
|
162
|
+
entityId: t.id,
|
|
163
|
+
tags: t.tags ?? [],
|
|
164
|
+
onChange: async (e) => {
|
|
165
|
+
await $.mutateAsync({
|
|
166
|
+
id: t.id,
|
|
167
|
+
input: { tags: e }
|
|
168
|
+
}), Q();
|
|
169
|
+
},
|
|
170
|
+
maxTags: 5
|
|
195
171
|
})
|
|
172
|
+
}), /* @__PURE__ */ I("div", {
|
|
173
|
+
className: "flex shrink-0 gap-1",
|
|
174
|
+
children: [/* @__PURE__ */ F(L, {
|
|
175
|
+
variant: "ghost",
|
|
176
|
+
size: "sm",
|
|
177
|
+
onClick: () => R(t),
|
|
178
|
+
"aria-label": `Edit ${t.name}`,
|
|
179
|
+
children: /* @__PURE__ */ F(j, { className: "h-4 w-4" })
|
|
180
|
+
}), t.status !== "ARCHIVED" && /* @__PURE__ */ F(G, {
|
|
181
|
+
id: t.id,
|
|
182
|
+
onDone: (e) => q(e ? {
|
|
183
|
+
tone: "success",
|
|
184
|
+
text: `${t.name} archived.`
|
|
185
|
+
} : {
|
|
186
|
+
tone: "danger",
|
|
187
|
+
text: "Could not archive client."
|
|
188
|
+
})
|
|
189
|
+
})]
|
|
196
190
|
})]
|
|
191
|
+
})]
|
|
192
|
+
}, t.id))
|
|
193
|
+
}),
|
|
194
|
+
/* @__PURE__ */ F("div", {
|
|
195
|
+
className: "hidden sm:block",
|
|
196
|
+
children: /* @__PURE__ */ I(g, { children: [/* @__PURE__ */ F("thead", { children: /* @__PURE__ */ I("tr", { children: [
|
|
197
|
+
/* @__PURE__ */ F(b, { children: C("psw.common.name") }),
|
|
198
|
+
/* @__PURE__ */ F(b, { children: C("psw.common.type") }),
|
|
199
|
+
/* @__PURE__ */ F(b, { children: "Industry" }),
|
|
200
|
+
/* @__PURE__ */ F(b, { children: C("psw.common.status") }),
|
|
201
|
+
/* @__PURE__ */ F(b, { children: C("psw.common.added") }),
|
|
202
|
+
/* @__PURE__ */ F(b, { children: "Tags" }),
|
|
203
|
+
/* @__PURE__ */ F(b, {
|
|
204
|
+
className: "text-right",
|
|
205
|
+
children: C("psw.common.actions")
|
|
197
206
|
})
|
|
198
|
-
})
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
207
|
+
] }) }), /* @__PURE__ */ F("tbody", { children: Y.items.map((t) => /* @__PURE__ */ I("tr", {
|
|
208
|
+
className: "group cursor-pointer transition-colors hover:bg-bg-sunken/60",
|
|
209
|
+
onClick: () => e(`clients/${t.id}`),
|
|
210
|
+
children: [
|
|
211
|
+
/* @__PURE__ */ F(_, { children: /* @__PURE__ */ I("div", {
|
|
212
|
+
className: "flex items-center gap-3",
|
|
213
|
+
children: [/* @__PURE__ */ F(V, { name: t.name }), /* @__PURE__ */ I("div", {
|
|
214
|
+
className: "min-w-0",
|
|
215
|
+
children: [/* @__PURE__ */ I("div", {
|
|
216
|
+
className: "flex items-center gap-1 font-medium text-text-primary transition-colors group-hover:text-accent",
|
|
217
|
+
children: [/* @__PURE__ */ F("span", {
|
|
218
|
+
className: "truncate",
|
|
219
|
+
children: t.name
|
|
220
|
+
}), /* @__PURE__ */ F(A, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary opacity-0 transition-opacity group-hover:opacity-100" })]
|
|
221
|
+
}), t.contactName ? /* @__PURE__ */ F("div", {
|
|
222
|
+
className: "truncate text-xs text-text-tertiary",
|
|
223
|
+
children: t.contactName
|
|
224
|
+
}) : null]
|
|
225
|
+
})]
|
|
226
|
+
}) }),
|
|
227
|
+
/* @__PURE__ */ F(_, { children: /* @__PURE__ */ I("span", {
|
|
228
|
+
className: "inline-flex items-center gap-1.5 text-text-secondary",
|
|
229
|
+
children: [t.type === "ORGANIZATION" ? /* @__PURE__ */ F(te, { className: "h-3.5 w-3.5 text-text-tertiary" }) : /* @__PURE__ */ F(re, { className: "h-3.5 w-3.5 text-text-tertiary" }), t.type === "ORGANIZATION" ? "Organization" : "Individual"]
|
|
230
|
+
}) }),
|
|
231
|
+
/* @__PURE__ */ F(_, { children: t.industry || "—" }),
|
|
232
|
+
/* @__PURE__ */ F(_, { children: /* @__PURE__ */ F(h, { status: t.status }) }),
|
|
233
|
+
/* @__PURE__ */ F(_, {
|
|
234
|
+
className: "whitespace-nowrap",
|
|
235
|
+
children: S(t.createdAt)
|
|
236
|
+
}),
|
|
237
|
+
/* @__PURE__ */ F(_, { children: /* @__PURE__ */ F("div", {
|
|
238
|
+
onClick: (e) => e.stopPropagation(),
|
|
239
|
+
role: "presentation",
|
|
240
|
+
children: /* @__PURE__ */ F(E, {
|
|
241
|
+
entityType: "PswClient",
|
|
242
|
+
entityId: t.id,
|
|
243
|
+
tags: t.tags ?? [],
|
|
244
|
+
onChange: async (e) => {
|
|
245
|
+
await $.mutateAsync({
|
|
246
|
+
id: t.id,
|
|
247
|
+
input: { tags: e }
|
|
248
|
+
}), Q();
|
|
249
|
+
},
|
|
250
|
+
maxTags: 5
|
|
251
|
+
})
|
|
252
|
+
}) }),
|
|
253
|
+
/* @__PURE__ */ F(_, {
|
|
254
|
+
className: "text-right",
|
|
255
|
+
children: /* @__PURE__ */ I("div", {
|
|
256
|
+
className: "flex justify-end gap-1",
|
|
257
|
+
onClick: (e) => e.stopPropagation(),
|
|
258
|
+
role: "presentation",
|
|
259
|
+
children: [/* @__PURE__ */ F(L, {
|
|
260
|
+
variant: "ghost",
|
|
261
|
+
size: "sm",
|
|
262
|
+
onClick: () => R(t),
|
|
263
|
+
"aria-label": "Edit",
|
|
264
|
+
children: /* @__PURE__ */ F(j, { className: "h-4 w-4" })
|
|
265
|
+
}), t.status !== "ARCHIVED" && /* @__PURE__ */ F(G, {
|
|
266
|
+
id: t.id,
|
|
267
|
+
onDone: (e) => q(e ? {
|
|
268
|
+
tone: "success",
|
|
269
|
+
text: `${t.name} archived.`
|
|
270
|
+
} : {
|
|
271
|
+
tone: "danger",
|
|
272
|
+
text: "Could not archive client."
|
|
273
|
+
})
|
|
274
|
+
})]
|
|
275
|
+
})
|
|
276
|
+
})
|
|
277
|
+
]
|
|
278
|
+
}, t.id)) })] })
|
|
279
|
+
}),
|
|
280
|
+
/* @__PURE__ */ F(ee, {
|
|
281
|
+
hasMore: Y?.pageInfo?.hasMore ?? !1,
|
|
282
|
+
loading: X,
|
|
283
|
+
loadedCount: ae.length,
|
|
284
|
+
totalCount: Y?.totalCount ?? ae.length,
|
|
285
|
+
onLoadMore: () => J((e) => ({
|
|
286
|
+
limit: U,
|
|
287
|
+
offset: e.offset + U
|
|
288
|
+
}))
|
|
289
|
+
})
|
|
290
|
+
]
|
|
210
291
|
}),
|
|
211
|
-
|
|
212
|
-
onClose: () =>
|
|
292
|
+
B && /* @__PURE__ */ F(K, {
|
|
293
|
+
onClose: () => H(!1),
|
|
213
294
|
onSaved: (e) => q({
|
|
214
295
|
tone: "success",
|
|
215
296
|
text: `${e} created.`
|
|
216
297
|
})
|
|
217
298
|
}),
|
|
218
|
-
|
|
219
|
-
client:
|
|
220
|
-
onClose: () =>
|
|
299
|
+
P && /* @__PURE__ */ F(K, {
|
|
300
|
+
client: P,
|
|
301
|
+
onClose: () => R(null),
|
|
221
302
|
onSaved: (e) => q({
|
|
222
303
|
tone: "success",
|
|
223
304
|
text: `${e} updated.`
|
|
@@ -225,9 +306,9 @@ var z = ["ORGANIZATION", "INDIVIDUAL"], B = [
|
|
|
225
306
|
})
|
|
226
307
|
]
|
|
227
308
|
});
|
|
228
|
-
},
|
|
309
|
+
}, G = ({ id: t, onDone: n }) => {
|
|
229
310
|
let r = e(), { emitFact: i } = w();
|
|
230
|
-
return /* @__PURE__ */
|
|
311
|
+
return /* @__PURE__ */ F(L, {
|
|
231
312
|
variant: "ghost",
|
|
232
313
|
size: "sm",
|
|
233
314
|
"aria-label": "Archive",
|
|
@@ -240,10 +321,10 @@ var z = ["ORGANIZATION", "INDIVIDUAL"], B = [
|
|
|
240
321
|
onError: () => n(!1)
|
|
241
322
|
});
|
|
242
323
|
},
|
|
243
|
-
children: /* @__PURE__ */
|
|
324
|
+
children: /* @__PURE__ */ F(k, { className: "h-4 w-4" })
|
|
244
325
|
});
|
|
245
326
|
}, K = ({ client: e, onClose: t, onSaved: i }) => {
|
|
246
|
-
let a = n(), s = r(), { emitFact: c } = w(), [u, p] =
|
|
327
|
+
let a = n(), s = r(), { emitFact: c } = w(), [u, p] = O(e ? {
|
|
247
328
|
name: e.name,
|
|
248
329
|
type: e.type,
|
|
249
330
|
status: e.status,
|
|
@@ -252,10 +333,10 @@ var z = ["ORGANIZATION", "INDIVIDUAL"], B = [
|
|
|
252
333
|
contactEmail: e.contactEmail ?? "",
|
|
253
334
|
contactPhone: e.contactPhone ?? "",
|
|
254
335
|
notes: e.notes ?? ""
|
|
255
|
-
} :
|
|
336
|
+
} : H), [m, h] = O(null), g = (e) => (t) => p((n) => ({
|
|
256
337
|
...n,
|
|
257
338
|
[e]: t.target.value
|
|
258
|
-
})), _ = a.isPending || s.isPending, b =
|
|
339
|
+
})), _ = a.isPending || s.isPending, b = D(() => ({
|
|
259
340
|
name: u.name.trim(),
|
|
260
341
|
type: u.type,
|
|
261
342
|
status: u.status,
|
|
@@ -265,16 +346,16 @@ var z = ["ORGANIZATION", "INDIVIDUAL"], B = [
|
|
|
265
346
|
contactPhone: u.contactPhone.trim() || null,
|
|
266
347
|
notes: u.notes.trim() || null
|
|
267
348
|
}), [u]);
|
|
268
|
-
return /* @__PURE__ */
|
|
349
|
+
return /* @__PURE__ */ F(d, {
|
|
269
350
|
open: !0,
|
|
270
351
|
onClose: t,
|
|
271
352
|
title: e ? "Edit client" : "New client",
|
|
272
|
-
footer: /* @__PURE__ */
|
|
353
|
+
footer: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(L, {
|
|
273
354
|
variant: "outline",
|
|
274
355
|
onClick: t,
|
|
275
356
|
disabled: _,
|
|
276
357
|
children: "Cancel"
|
|
277
|
-
}), /* @__PURE__ */
|
|
358
|
+
}), /* @__PURE__ */ F(L, {
|
|
278
359
|
onClick: () => {
|
|
279
360
|
if (h(null), !b.name) return h("Client name is required.");
|
|
280
361
|
let n = (e) => h(e instanceof Error ? e.message : "Save failed.");
|
|
@@ -296,75 +377,75 @@ var z = ["ORGANIZATION", "INDIVIDUAL"], B = [
|
|
|
296
377
|
disabled: _,
|
|
297
378
|
children: _ ? "Saving…" : e ? "Save changes" : "Create client"
|
|
298
379
|
})] }),
|
|
299
|
-
children: /* @__PURE__ */
|
|
380
|
+
children: /* @__PURE__ */ I("div", {
|
|
300
381
|
className: "space-y-3",
|
|
301
382
|
children: [
|
|
302
|
-
m && /* @__PURE__ */
|
|
383
|
+
m && /* @__PURE__ */ F(o, {
|
|
303
384
|
tone: "danger",
|
|
304
385
|
children: m
|
|
305
386
|
}),
|
|
306
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ F(l, {
|
|
307
388
|
label: "Name",
|
|
308
389
|
required: !0,
|
|
309
|
-
children: /* @__PURE__ */
|
|
390
|
+
children: /* @__PURE__ */ F(y, {
|
|
310
391
|
value: u.name,
|
|
311
392
|
onChange: g("name"),
|
|
312
393
|
placeholder: "Acme Holdings Ltd."
|
|
313
394
|
})
|
|
314
395
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ I("div", {
|
|
316
397
|
className: "grid grid-cols-2 gap-3",
|
|
317
|
-
children: [/* @__PURE__ */
|
|
398
|
+
children: [/* @__PURE__ */ F(l, {
|
|
318
399
|
label: "Type",
|
|
319
|
-
children: /* @__PURE__ */
|
|
400
|
+
children: /* @__PURE__ */ F(f, {
|
|
320
401
|
value: u.type,
|
|
321
402
|
onChange: g("type"),
|
|
322
|
-
children: x(
|
|
403
|
+
children: x(R)
|
|
323
404
|
})
|
|
324
|
-
}), /* @__PURE__ */
|
|
405
|
+
}), /* @__PURE__ */ F(l, {
|
|
325
406
|
label: "Status",
|
|
326
|
-
children: /* @__PURE__ */
|
|
407
|
+
children: /* @__PURE__ */ F(f, {
|
|
327
408
|
value: u.status,
|
|
328
409
|
onChange: g("status"),
|
|
329
|
-
children: x(
|
|
410
|
+
children: x(z)
|
|
330
411
|
})
|
|
331
412
|
})]
|
|
332
413
|
}),
|
|
333
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ F(l, {
|
|
334
415
|
label: "Industry",
|
|
335
|
-
children: /* @__PURE__ */
|
|
416
|
+
children: /* @__PURE__ */ F(y, {
|
|
336
417
|
value: u.industry,
|
|
337
418
|
onChange: g("industry"),
|
|
338
419
|
placeholder: "Financial services"
|
|
339
420
|
})
|
|
340
421
|
}),
|
|
341
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ I("div", {
|
|
342
423
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
343
|
-
children: [/* @__PURE__ */
|
|
424
|
+
children: [/* @__PURE__ */ F(l, {
|
|
344
425
|
label: "Contact name",
|
|
345
|
-
children: /* @__PURE__ */
|
|
426
|
+
children: /* @__PURE__ */ F(y, {
|
|
346
427
|
value: u.contactName,
|
|
347
428
|
onChange: g("contactName")
|
|
348
429
|
})
|
|
349
|
-
}), /* @__PURE__ */
|
|
430
|
+
}), /* @__PURE__ */ F(l, {
|
|
350
431
|
label: "Contact email",
|
|
351
|
-
children: /* @__PURE__ */
|
|
432
|
+
children: /* @__PURE__ */ F(y, {
|
|
352
433
|
type: "email",
|
|
353
434
|
value: u.contactEmail,
|
|
354
435
|
onChange: g("contactEmail")
|
|
355
436
|
})
|
|
356
437
|
})]
|
|
357
438
|
}),
|
|
358
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ F(l, {
|
|
359
440
|
label: "Contact phone",
|
|
360
|
-
children: /* @__PURE__ */
|
|
441
|
+
children: /* @__PURE__ */ F(y, {
|
|
361
442
|
value: u.contactPhone,
|
|
362
443
|
onChange: g("contactPhone")
|
|
363
444
|
})
|
|
364
445
|
}),
|
|
365
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ F(l, {
|
|
366
447
|
label: "Notes",
|
|
367
|
-
children: /* @__PURE__ */
|
|
448
|
+
children: /* @__PURE__ */ F(v, {
|
|
368
449
|
value: u.notes,
|
|
369
450
|
onChange: g("notes")
|
|
370
451
|
})
|
|
@@ -374,6 +455,6 @@ var z = ["ORGANIZATION", "INDIVIDUAL"], B = [
|
|
|
374
455
|
});
|
|
375
456
|
};
|
|
376
457
|
//#endregion
|
|
377
|
-
export {
|
|
458
|
+
export { V as Avatar, W as ClientsPage };
|
|
378
459
|
|
|
379
460
|
//# sourceMappingURL=ClientsPage.js.map
|