@burdenoff/microfe-proserviceworld 2026.801.1 → 2026.830.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/index.js +4 -4
- 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/hooks/useTr.d.ts +19 -0
- package/dist/proserviceworld/hooks/useTr.d.ts.map +1 -0
- package/dist/proserviceworld/hooks/useTr.js +33 -0
- package/dist/proserviceworld/hooks/useTr.js.map +1 -0
- package/dist/proserviceworld/i18n/index.d.ts +1 -1
- package/dist/proserviceworld/i18n/index.d.ts.map +1 -1
- package/dist/proserviceworld/i18n/index.js +723 -18
- package/dist/proserviceworld/i18n/index.js.map +1 -1
- package/dist/proserviceworld/index.js +4 -4
- 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 +324 -241
- package/dist/proserviceworld/pages/ClientsPage.js.map +1 -1
- package/dist/proserviceworld/pages/DashboardPage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/DashboardPage.js +152 -142
- package/dist/proserviceworld/pages/DashboardPage.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/dist/proserviceworld/pages/EngagementsPage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/EngagementsPage.js +135 -135
- package/dist/proserviceworld/pages/EngagementsPage.js.map +1 -1
- package/dist/proserviceworld/pages/MattersPage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/MattersPage.js +204 -197
- package/dist/proserviceworld/pages/MattersPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,274 +1,398 @@
|
|
|
1
|
-
import { useClient as e,
|
|
2
|
-
import { useNav as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Banner as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { useClient as e, useClientTeamAssignments as t, useConflictChecks as n, useCreateConflictCheck as r } from "../hooks/useProServiceWorldApi.js";
|
|
2
|
+
import { useNav as i } from "../utils/nav.js";
|
|
3
|
+
import { cn as a } from "../utils/cn.js";
|
|
4
|
+
import { Banner as o, Empty as s, ErrorState as c, Field as l, LoadingBlock as u, Modal as d, PageHeader as f, SectionCard as p, StatusPill as m, TableWrap as h, Td as g, TextArea as _, TextInput as v, Th as y, fmtDate as b, fmtMoney as x, humanize as S } from "../components/ui.js";
|
|
5
|
+
import { useActorNames as C } from "../hooks/useActorNames.js";
|
|
6
|
+
import { DiscussionThread as w } from "../components/DiscussionThread.js";
|
|
7
|
+
import { useMemo as T, useState as E } from "react";
|
|
8
|
+
import { ArrowLeft as D, Briefcase as O, ChevronRight as k, FolderKanban as A, GitBranch as j, Mail as M, MapPin as N, Phone as P, Plus as F, StickyNote as I, UserRoundCheck as L, Users as R } from "lucide-react";
|
|
9
|
+
import { useParams as z } from "react-router";
|
|
10
|
+
import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
11
|
+
import { Button as U } from "@burdenoff/fe-libs/ui";
|
|
11
12
|
//#region src/proserviceworld/pages/ClientDetailPage.tsx
|
|
12
|
-
var
|
|
13
|
-
let { id:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
var W = (e) => e.split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpperCase() ?? "").join("") || "?", G = () => {
|
|
14
|
+
let { id: r = "" } = z(), a = i(), { data: o, isLoading: l, error: d, refetch: _ } = e(r), v = n({ clientId: r }), [R, B] = E(!1), G = T(() => [...(o?.engagements ?? []).map((e) => ({
|
|
15
|
+
type: "engagement",
|
|
16
|
+
id: e.id,
|
|
17
|
+
name: e.name
|
|
18
|
+
})), ...(o?.matters ?? []).map((e) => ({
|
|
19
|
+
type: "matter",
|
|
20
|
+
id: e.id,
|
|
21
|
+
name: e.reference || e.title
|
|
22
|
+
}))], [o]), K = t(G), X = C([
|
|
23
|
+
o?.relationshipOwnerId,
|
|
24
|
+
...(o?.engagements ?? []).map((e) => e.responsiblePartnerId),
|
|
25
|
+
...(o?.matters ?? []).map((e) => e.leadPractitionerId),
|
|
26
|
+
...(K.data ?? []).map((e) => e.practitionerId)
|
|
27
|
+
]);
|
|
28
|
+
if (l) return /* @__PURE__ */ V(u, {});
|
|
29
|
+
if (d) return /* @__PURE__ */ V(c, {
|
|
30
|
+
error: d,
|
|
31
|
+
onRetry: () => void _()
|
|
18
32
|
});
|
|
19
|
-
if (!
|
|
33
|
+
if (!o) return /* @__PURE__ */ V(s, {
|
|
20
34
|
title: "Client not found",
|
|
21
35
|
description: "It may have been archived or belongs to another workspace."
|
|
22
36
|
});
|
|
23
|
-
let
|
|
24
|
-
return /* @__PURE__ */
|
|
37
|
+
let Z = o.contactName || o.name;
|
|
38
|
+
return /* @__PURE__ */ H("div", {
|
|
25
39
|
className: "space-y-6",
|
|
26
40
|
children: [
|
|
27
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ H("button", {
|
|
28
42
|
type: "button",
|
|
29
|
-
onClick: () =>
|
|
43
|
+
onClick: () => a("clients"),
|
|
30
44
|
className: "flex items-center gap-1.5 text-sm text-text-secondary transition-colors hover:text-accent",
|
|
31
|
-
children: [/* @__PURE__ */
|
|
45
|
+
children: [/* @__PURE__ */ V(D, { className: "h-4 w-4" }), " Back to clients"]
|
|
32
46
|
}),
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
title:
|
|
35
|
-
subtitle: [
|
|
36
|
-
actions: /* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ V(f, {
|
|
48
|
+
title: o.name,
|
|
49
|
+
subtitle: [o.type === "ORGANIZATION" ? "Organization" : "Individual", o.industry].filter(Boolean).join(" · "),
|
|
50
|
+
actions: /* @__PURE__ */ V(m, { status: o.status })
|
|
37
51
|
}),
|
|
38
|
-
|
|
52
|
+
o.tags.length > 0 && /* @__PURE__ */ V("div", {
|
|
39
53
|
className: "flex flex-wrap gap-2",
|
|
40
|
-
children:
|
|
54
|
+
children: o.tags.map((e) => /* @__PURE__ */ V("span", {
|
|
41
55
|
className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
|
|
42
56
|
children: e
|
|
43
57
|
}, e))
|
|
44
58
|
}),
|
|
45
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ H("div", {
|
|
46
60
|
className: "grid grid-cols-1 gap-4 lg:grid-cols-3",
|
|
47
|
-
children: [/* @__PURE__ */
|
|
61
|
+
children: [/* @__PURE__ */ V(p, {
|
|
48
62
|
title: "Contact",
|
|
49
63
|
className: "lg:col-span-1",
|
|
50
|
-
children: /* @__PURE__ */
|
|
64
|
+
children: /* @__PURE__ */ H("div", {
|
|
51
65
|
className: "space-y-4",
|
|
52
|
-
children: [/* @__PURE__ */
|
|
66
|
+
children: [/* @__PURE__ */ H("div", {
|
|
53
67
|
className: "flex items-center gap-3",
|
|
54
|
-
children: [/* @__PURE__ */
|
|
68
|
+
children: [/* @__PURE__ */ V("span", {
|
|
55
69
|
className: "flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-accent/10 text-sm font-semibold text-accent ring-1 ring-inset ring-accent/15",
|
|
56
|
-
children:
|
|
57
|
-
}), /* @__PURE__ */
|
|
70
|
+
children: W(Z)
|
|
71
|
+
}), /* @__PURE__ */ H("div", {
|
|
58
72
|
className: "min-w-0",
|
|
59
|
-
children: [/* @__PURE__ */
|
|
73
|
+
children: [/* @__PURE__ */ V("div", {
|
|
60
74
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
61
|
-
children:
|
|
62
|
-
}), /* @__PURE__ */
|
|
75
|
+
children: o.contactName || o.name
|
|
76
|
+
}), /* @__PURE__ */ V("div", {
|
|
63
77
|
className: "truncate text-xs text-text-tertiary",
|
|
64
|
-
children:
|
|
78
|
+
children: o.contactName ? "Primary contact" : "Client record"
|
|
65
79
|
})]
|
|
66
80
|
})]
|
|
67
|
-
}), /* @__PURE__ */
|
|
81
|
+
}), /* @__PURE__ */ H("dl", {
|
|
68
82
|
className: "space-y-2.5 text-sm",
|
|
69
83
|
children: [
|
|
70
|
-
|
|
71
|
-
icon: /* @__PURE__ */
|
|
72
|
-
value:
|
|
84
|
+
o.contactEmail && /* @__PURE__ */ V(J, {
|
|
85
|
+
icon: /* @__PURE__ */ V(M, { className: "h-4 w-4" }),
|
|
86
|
+
value: o.contactEmail
|
|
73
87
|
}),
|
|
74
|
-
|
|
75
|
-
icon: /* @__PURE__ */
|
|
76
|
-
value:
|
|
88
|
+
o.contactPhone && /* @__PURE__ */ V(J, {
|
|
89
|
+
icon: /* @__PURE__ */ V(P, { className: "h-4 w-4" }),
|
|
90
|
+
value: o.contactPhone
|
|
77
91
|
}),
|
|
78
|
-
|
|
79
|
-
icon: /* @__PURE__ */
|
|
80
|
-
value:
|
|
92
|
+
o.address && /* @__PURE__ */ V(J, {
|
|
93
|
+
icon: /* @__PURE__ */ V(N, { className: "h-4 w-4" }),
|
|
94
|
+
value: o.address
|
|
81
95
|
}),
|
|
82
|
-
|
|
83
|
-
icon: /* @__PURE__ */ I
|
|
84
|
-
value:
|
|
96
|
+
o.notes && /* @__PURE__ */ V(J, {
|
|
97
|
+
icon: /* @__PURE__ */ V(I, { className: "h-4 w-4" }),
|
|
98
|
+
value: o.notes,
|
|
85
99
|
multiline: !0
|
|
86
100
|
}),
|
|
87
|
-
|
|
101
|
+
o.relationshipOwnerId && /* @__PURE__ */ V(J, {
|
|
102
|
+
icon: /* @__PURE__ */ V(L, { className: "h-4 w-4" }),
|
|
103
|
+
value: `${X.nameOf(o.relationshipOwnerId)} · relationship owner`
|
|
104
|
+
}),
|
|
105
|
+
!o.contactEmail && !o.contactPhone && !o.address && !o.notes && !o.relationshipOwnerId && /* @__PURE__ */ V("p", {
|
|
88
106
|
className: "text-sm text-text-tertiary",
|
|
89
107
|
children: "No contact details recorded yet."
|
|
90
108
|
})
|
|
91
109
|
]
|
|
92
110
|
})]
|
|
93
111
|
})
|
|
94
|
-
}), /* @__PURE__ */
|
|
112
|
+
}), /* @__PURE__ */ V(p, {
|
|
95
113
|
title: "Conflict checks",
|
|
96
114
|
className: "lg:col-span-2",
|
|
97
|
-
action: /* @__PURE__ */
|
|
115
|
+
action: /* @__PURE__ */ H(U, {
|
|
98
116
|
size: "sm",
|
|
99
117
|
variant: "outline",
|
|
100
118
|
onClick: () => B(!0),
|
|
101
|
-
children: [/* @__PURE__ */
|
|
119
|
+
children: [/* @__PURE__ */ V(j, { className: "mr-1.5 h-4 w-4" }), " Run check"]
|
|
102
120
|
}),
|
|
103
|
-
children:
|
|
121
|
+
children: v.isLoading ? /* @__PURE__ */ V(u, { label: "Loading…" }) : !v.data || v.data.items.length === 0 ? /* @__PURE__ */ V(s, {
|
|
104
122
|
title: "No conflict checks",
|
|
105
123
|
description: "Run a conflict check before accepting new work for this client.",
|
|
106
|
-
icon: /* @__PURE__ */
|
|
107
|
-
}) : /* @__PURE__ */
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
124
|
+
icon: /* @__PURE__ */ V(j, { className: "h-7 w-7" })
|
|
125
|
+
}) : /* @__PURE__ */ H(h, { children: [/* @__PURE__ */ V("thead", { children: /* @__PURE__ */ H("tr", { children: [
|
|
126
|
+
/* @__PURE__ */ V(y, { children: "Parties searched" }),
|
|
127
|
+
/* @__PURE__ */ V(y, { children: "Date" }),
|
|
128
|
+
/* @__PURE__ */ V(y, {
|
|
111
129
|
className: "text-right",
|
|
112
130
|
children: "Status"
|
|
113
131
|
})
|
|
114
|
-
] }) }), /* @__PURE__ */
|
|
132
|
+
] }) }), /* @__PURE__ */ V("tbody", { children: v.data.items.map((e) => /* @__PURE__ */ H("tr", {
|
|
115
133
|
className: "transition-colors hover:bg-bg-sunken/60",
|
|
116
134
|
children: [
|
|
117
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ H(g, { children: [/* @__PURE__ */ V("div", {
|
|
118
136
|
className: "font-medium text-text-primary",
|
|
119
137
|
children: e.searchedParties.join(", ") || "Conflict search"
|
|
120
|
-
}), e.findings ? /* @__PURE__ */
|
|
138
|
+
}), e.findings ? /* @__PURE__ */ V("div", {
|
|
121
139
|
className: "text-xs text-text-tertiary",
|
|
122
140
|
children: e.findings
|
|
123
141
|
}) : null] }),
|
|
124
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ V(g, {
|
|
125
143
|
className: "whitespace-nowrap",
|
|
126
|
-
children:
|
|
144
|
+
children: b(e.createdAt)
|
|
127
145
|
}),
|
|
128
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ V(g, {
|
|
129
147
|
className: "text-right",
|
|
130
|
-
children: /* @__PURE__ */
|
|
148
|
+
children: /* @__PURE__ */ V(m, { status: e.status })
|
|
131
149
|
})
|
|
132
150
|
]
|
|
133
151
|
}, e.id)) })] })
|
|
134
152
|
})]
|
|
135
153
|
}),
|
|
136
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ V(q, {
|
|
155
|
+
rows: K.data ?? [],
|
|
156
|
+
loading: K.isLoading,
|
|
157
|
+
error: K.error,
|
|
158
|
+
hasScopes: G.length > 0,
|
|
159
|
+
actors: X
|
|
160
|
+
}),
|
|
161
|
+
/* @__PURE__ */ V(p, {
|
|
137
162
|
title: "Engagements",
|
|
138
|
-
description: `${
|
|
139
|
-
action: /* @__PURE__ */
|
|
163
|
+
description: `${o.engagements.length} scoped for this client`,
|
|
164
|
+
action: /* @__PURE__ */ H(U, {
|
|
140
165
|
size: "sm",
|
|
141
166
|
variant: "outline",
|
|
142
|
-
onClick: () =>
|
|
143
|
-
children: [/* @__PURE__ */
|
|
167
|
+
onClick: () => a("engagements"),
|
|
168
|
+
children: [/* @__PURE__ */ V(F, { className: "mr-1.5 h-4 w-4" }), "Manage"]
|
|
144
169
|
}),
|
|
145
|
-
children:
|
|
170
|
+
children: o.engagements.length === 0 ? /* @__PURE__ */ V(s, {
|
|
146
171
|
title: "No engagements",
|
|
147
172
|
description: "Scope the first engagement for this client.",
|
|
148
|
-
icon: /* @__PURE__ */
|
|
149
|
-
}) : /* @__PURE__ */
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
/* @__PURE__ */
|
|
173
|
+
icon: /* @__PURE__ */ V(O, { className: "h-7 w-7" })
|
|
174
|
+
}) : /* @__PURE__ */ H(h, { children: [/* @__PURE__ */ V("thead", { children: /* @__PURE__ */ H("tr", { children: [
|
|
175
|
+
/* @__PURE__ */ V(y, { children: "Engagement" }),
|
|
176
|
+
/* @__PURE__ */ V(y, { children: "Partner" }),
|
|
177
|
+
/* @__PURE__ */ V(y, { children: "Fee" }),
|
|
178
|
+
/* @__PURE__ */ V(y, { children: "Started" }),
|
|
179
|
+
/* @__PURE__ */ V(y, {
|
|
154
180
|
className: "text-right",
|
|
155
181
|
children: "Status"
|
|
156
182
|
})
|
|
157
|
-
] }) }), /* @__PURE__ */
|
|
183
|
+
] }) }), /* @__PURE__ */ V("tbody", { children: o.engagements.map((e) => /* @__PURE__ */ H("tr", {
|
|
158
184
|
className: "group cursor-pointer transition-colors hover:bg-bg-sunken/60",
|
|
159
|
-
onClick: () =>
|
|
185
|
+
onClick: () => a(`engagements/${e.id}`),
|
|
160
186
|
children: [
|
|
161
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ V(g, { children: /* @__PURE__ */ H("div", {
|
|
162
188
|
className: "flex items-center gap-1 font-medium text-text-primary transition-colors group-hover:text-accent",
|
|
163
|
-
children: [/* @__PURE__ */
|
|
189
|
+
children: [/* @__PURE__ */ V("span", { children: e.name }), /* @__PURE__ */ V(k, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary opacity-0 transition-opacity group-hover:opacity-100" })]
|
|
164
190
|
}) }),
|
|
165
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ V(g, {
|
|
192
|
+
className: "whitespace-nowrap",
|
|
193
|
+
children: e.responsiblePartnerId ? X.nameOf(e.responsiblePartnerId) : /* @__PURE__ */ V("span", {
|
|
194
|
+
className: "text-text-tertiary",
|
|
195
|
+
children: "Unassigned"
|
|
196
|
+
})
|
|
197
|
+
}),
|
|
198
|
+
/* @__PURE__ */ H(g, {
|
|
166
199
|
className: "whitespace-nowrap",
|
|
167
200
|
children: [
|
|
168
|
-
|
|
201
|
+
x(e.feeAmount, e.currency),
|
|
169
202
|
" ",
|
|
170
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ H("span", {
|
|
171
204
|
className: "text-xs text-text-tertiary",
|
|
172
|
-
children: ["/ ",
|
|
205
|
+
children: ["/ ", S(e.feeArrangement)]
|
|
173
206
|
})
|
|
174
207
|
]
|
|
175
208
|
}),
|
|
176
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ V(g, {
|
|
177
210
|
className: "whitespace-nowrap",
|
|
178
|
-
children:
|
|
211
|
+
children: b(e.startDate)
|
|
179
212
|
}),
|
|
180
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ V(g, {
|
|
181
214
|
className: "text-right",
|
|
182
|
-
children: /* @__PURE__ */
|
|
215
|
+
children: /* @__PURE__ */ V(m, { status: e.status })
|
|
183
216
|
})
|
|
184
217
|
]
|
|
185
218
|
}, e.id)) })] })
|
|
186
219
|
}),
|
|
187
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ V(p, {
|
|
188
221
|
title: "Matters",
|
|
189
|
-
description: `${
|
|
190
|
-
action: /* @__PURE__ */
|
|
222
|
+
description: `${o.matters.length} tracked for this client`,
|
|
223
|
+
action: /* @__PURE__ */ H(U, {
|
|
191
224
|
size: "sm",
|
|
192
225
|
variant: "outline",
|
|
193
|
-
onClick: () =>
|
|
194
|
-
children: [/* @__PURE__ */
|
|
226
|
+
onClick: () => a("matters"),
|
|
227
|
+
children: [/* @__PURE__ */ V(F, { className: "mr-1.5 h-4 w-4" }), "Manage"]
|
|
195
228
|
}),
|
|
196
|
-
children:
|
|
229
|
+
children: o.matters.length === 0 ? /* @__PURE__ */ V(s, {
|
|
197
230
|
title: "No matters",
|
|
198
231
|
description: "Open a matter to track regulated work for this client.",
|
|
199
|
-
icon: /* @__PURE__ */
|
|
200
|
-
}) : /* @__PURE__ */
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
/* @__PURE__ */
|
|
232
|
+
icon: /* @__PURE__ */ V(A, { className: "h-7 w-7" })
|
|
233
|
+
}) : /* @__PURE__ */ H(h, { children: [/* @__PURE__ */ V("thead", { children: /* @__PURE__ */ H("tr", { children: [
|
|
234
|
+
/* @__PURE__ */ V(y, { children: "Reference" }),
|
|
235
|
+
/* @__PURE__ */ V(y, { children: "Title" }),
|
|
236
|
+
/* @__PURE__ */ V(y, { children: "Lead" }),
|
|
237
|
+
/* @__PURE__ */ V(y, { children: "Due" }),
|
|
238
|
+
/* @__PURE__ */ V(y, { children: "Priority" }),
|
|
239
|
+
/* @__PURE__ */ V(y, {
|
|
206
240
|
className: "text-right",
|
|
207
241
|
children: "Status"
|
|
208
242
|
})
|
|
209
|
-
] }) }), /* @__PURE__ */
|
|
243
|
+
] }) }), /* @__PURE__ */ V("tbody", { children: o.matters.map((e) => /* @__PURE__ */ H("tr", {
|
|
210
244
|
className: "transition-colors hover:bg-bg-sunken/60",
|
|
211
245
|
children: [
|
|
212
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ V(g, {
|
|
213
247
|
className: "whitespace-nowrap font-medium text-text-primary",
|
|
214
248
|
children: e.reference || "—"
|
|
215
249
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ V(g, { children: e.title }),
|
|
251
|
+
/* @__PURE__ */ V(g, {
|
|
218
252
|
className: "whitespace-nowrap",
|
|
219
|
-
children:
|
|
253
|
+
children: e.leadPractitionerId ? X.nameOf(e.leadPractitionerId) : /* @__PURE__ */ V("span", {
|
|
254
|
+
className: "text-text-tertiary",
|
|
255
|
+
children: "Unassigned"
|
|
256
|
+
})
|
|
220
257
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
222
|
-
|
|
258
|
+
/* @__PURE__ */ V(g, {
|
|
259
|
+
className: "whitespace-nowrap",
|
|
260
|
+
children: b(e.dueDate)
|
|
261
|
+
}),
|
|
262
|
+
/* @__PURE__ */ V(g, { children: /* @__PURE__ */ V(m, { status: e.priority }) }),
|
|
263
|
+
/* @__PURE__ */ V(g, {
|
|
223
264
|
className: "text-right",
|
|
224
|
-
children: /* @__PURE__ */
|
|
265
|
+
children: /* @__PURE__ */ V(m, { status: e.status })
|
|
225
266
|
})
|
|
226
267
|
]
|
|
227
268
|
}, e.id)) })] })
|
|
228
269
|
}),
|
|
229
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ V(w, {
|
|
230
271
|
entityType: "proserviceworld-client",
|
|
231
|
-
entityId:
|
|
272
|
+
entityId: r
|
|
232
273
|
}),
|
|
233
|
-
|
|
234
|
-
clientId:
|
|
274
|
+
R && /* @__PURE__ */ V(Y, {
|
|
275
|
+
clientId: r,
|
|
235
276
|
onClose: () => B(!1),
|
|
236
|
-
onDone: () => void
|
|
277
|
+
onDone: () => void v.refetch()
|
|
237
278
|
})
|
|
238
279
|
]
|
|
239
280
|
});
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
|
|
281
|
+
};
|
|
282
|
+
function K(e) {
|
|
283
|
+
let t = /* @__PURE__ */ new Map();
|
|
284
|
+
for (let n of e) {
|
|
285
|
+
let e = t.get(n.practitionerId) ?? {
|
|
286
|
+
practitionerId: n.practitionerId,
|
|
287
|
+
roles: [],
|
|
288
|
+
isLead: !1,
|
|
289
|
+
scopes: []
|
|
290
|
+
}, r = S(n.role);
|
|
291
|
+
e.roles.includes(r) || e.roles.push(r), e.isLead = e.isLead || n.isLead, e.scopes.some((e) => e.id === n.scopeId) || e.scopes.push({
|
|
292
|
+
id: n.scopeId,
|
|
293
|
+
name: n.scopeName,
|
|
294
|
+
type: n.scopeType
|
|
295
|
+
}), t.set(n.practitionerId, e);
|
|
296
|
+
}
|
|
297
|
+
return [...t.values()].sort((e, t) => Number(t.isLead) - Number(e.isLead));
|
|
298
|
+
}
|
|
299
|
+
var q = ({ rows: e, loading: t, error: n, hasScopes: r, actors: i }) => {
|
|
300
|
+
let a = K(e);
|
|
301
|
+
return /* @__PURE__ */ V(p, {
|
|
302
|
+
title: "Client team",
|
|
303
|
+
description: "Everyone staffed on this client's engagements and matters.",
|
|
304
|
+
children: t ? /* @__PURE__ */ V(u, { label: "Loading…" }) : n ? /* @__PURE__ */ V(c, { error: n }) : r ? a.length === 0 ? /* @__PURE__ */ V(s, {
|
|
305
|
+
title: "No one assigned",
|
|
306
|
+
description: "Staff practitioners from an engagement's Team section to see them here.",
|
|
307
|
+
icon: /* @__PURE__ */ V(R, { className: "h-7 w-7" })
|
|
308
|
+
}) : /* @__PURE__ */ V("ul", {
|
|
309
|
+
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3",
|
|
310
|
+
children: a.map((e) => {
|
|
311
|
+
let t = i.nameOf(e.practitionerId), n = i.profiles[e.practitionerId]?.email;
|
|
312
|
+
return /* @__PURE__ */ H("li", {
|
|
313
|
+
className: "flex items-start gap-3 rounded-xl border border-border-seam bg-bg-canvas p-3.5",
|
|
314
|
+
children: [
|
|
315
|
+
/* @__PURE__ */ V("span", {
|
|
316
|
+
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-accent/10 text-xs font-semibold text-accent ring-1 ring-inset ring-accent/15",
|
|
317
|
+
children: W(t)
|
|
318
|
+
}),
|
|
319
|
+
/* @__PURE__ */ H("div", {
|
|
320
|
+
className: "min-w-0 flex-1",
|
|
321
|
+
children: [
|
|
322
|
+
/* @__PURE__ */ H("div", {
|
|
323
|
+
className: "flex items-center gap-2",
|
|
324
|
+
children: [/* @__PURE__ */ V("span", {
|
|
325
|
+
className: "truncate text-sm font-medium text-text-primary",
|
|
326
|
+
children: t
|
|
327
|
+
}), e.isLead && /* @__PURE__ */ V("span", {
|
|
328
|
+
className: "shrink-0 rounded-full bg-bg-sunken px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-accent",
|
|
329
|
+
children: "Lead"
|
|
330
|
+
})]
|
|
331
|
+
}),
|
|
332
|
+
/* @__PURE__ */ V("div", {
|
|
333
|
+
className: "mt-0.5 truncate text-xs text-text-tertiary",
|
|
334
|
+
children: e.roles.join(" · ")
|
|
335
|
+
}),
|
|
336
|
+
/* @__PURE__ */ V("div", {
|
|
337
|
+
className: "mt-2 flex flex-wrap gap-1.5",
|
|
338
|
+
children: e.scopes.map((e) => /* @__PURE__ */ H("span", {
|
|
339
|
+
className: "inline-flex max-w-full items-center gap-1 rounded-md bg-bg-sunken px-1.5 py-0.5 text-[11px] text-text-secondary",
|
|
340
|
+
children: [e.type === "engagement" ? /* @__PURE__ */ V(O, { className: "h-3 w-3 shrink-0 text-text-tertiary" }) : /* @__PURE__ */ V(A, { className: "h-3 w-3 shrink-0 text-text-tertiary" }), /* @__PURE__ */ V("span", {
|
|
341
|
+
className: "truncate",
|
|
342
|
+
children: e.name
|
|
343
|
+
})]
|
|
344
|
+
}, e.id))
|
|
345
|
+
})
|
|
346
|
+
]
|
|
347
|
+
}),
|
|
348
|
+
n ? /* @__PURE__ */ V("a", {
|
|
349
|
+
href: `mailto:${n}`,
|
|
350
|
+
className: "shrink-0 rounded-lg p-1.5 text-text-tertiary transition-colors hover:bg-bg-sunken hover:text-accent",
|
|
351
|
+
"aria-label": `Email ${t}`,
|
|
352
|
+
title: n,
|
|
353
|
+
children: /* @__PURE__ */ V(M, { className: "h-4 w-4" })
|
|
354
|
+
}) : null
|
|
355
|
+
]
|
|
356
|
+
}, e.practitionerId);
|
|
357
|
+
})
|
|
358
|
+
}) : /* @__PURE__ */ V(s, {
|
|
359
|
+
title: "Nothing to staff yet",
|
|
360
|
+
description: "Scope an engagement or open a matter, then assign the team that will deliver it.",
|
|
361
|
+
icon: /* @__PURE__ */ V(R, { className: "h-7 w-7" })
|
|
362
|
+
})
|
|
363
|
+
});
|
|
364
|
+
}, J = ({ icon: e, value: t, multiline: n }) => /* @__PURE__ */ H("div", {
|
|
365
|
+
className: a("flex gap-2.5 text-text-secondary", n ? "items-start" : "items-center"),
|
|
366
|
+
children: [/* @__PURE__ */ V("span", {
|
|
243
367
|
className: "mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-tertiary",
|
|
244
368
|
children: e
|
|
245
|
-
}), /* @__PURE__ */
|
|
246
|
-
className:
|
|
369
|
+
}), /* @__PURE__ */ V("span", {
|
|
370
|
+
className: a("min-w-0 break-words", n ? "leading-relaxed" : "truncate"),
|
|
247
371
|
children: t
|
|
248
372
|
})]
|
|
249
|
-
}),
|
|
250
|
-
let i =
|
|
251
|
-
return /* @__PURE__ */
|
|
373
|
+
}), Y = ({ clientId: e, onClose: t, onDone: n }) => {
|
|
374
|
+
let i = r(), [a, s] = E(""), [c, u] = E(""), [f, p] = E(null);
|
|
375
|
+
return /* @__PURE__ */ V(d, {
|
|
252
376
|
open: !0,
|
|
253
377
|
onClose: t,
|
|
254
378
|
title: "Run conflict check",
|
|
255
|
-
footer: /* @__PURE__ */
|
|
379
|
+
footer: /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(U, {
|
|
256
380
|
variant: "outline",
|
|
257
381
|
onClick: t,
|
|
258
382
|
disabled: i.isPending,
|
|
259
383
|
children: "Cancel"
|
|
260
|
-
}), /* @__PURE__ */
|
|
384
|
+
}), /* @__PURE__ */ V(U, {
|
|
261
385
|
onClick: () => {
|
|
262
386
|
p(null);
|
|
263
|
-
let
|
|
264
|
-
if (
|
|
387
|
+
let r = a.split(",").map((e) => e.trim()).filter(Boolean);
|
|
388
|
+
if (r.length === 0) return p("Add at least one party to search.");
|
|
265
389
|
i.mutate({
|
|
266
390
|
clientId: e,
|
|
267
|
-
searchedParties:
|
|
268
|
-
findings:
|
|
391
|
+
searchedParties: r,
|
|
392
|
+
findings: c.trim() || null
|
|
269
393
|
}, {
|
|
270
394
|
onSuccess: () => {
|
|
271
|
-
|
|
395
|
+
n(), t();
|
|
272
396
|
},
|
|
273
397
|
onError: (e) => p(e instanceof Error ? e.message : "Failed.")
|
|
274
398
|
});
|
|
@@ -276,28 +400,28 @@ var z = (e) => e.split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpp
|
|
|
276
400
|
disabled: i.isPending,
|
|
277
401
|
children: i.isPending ? "Running…" : "Record check"
|
|
278
402
|
})] }),
|
|
279
|
-
children: /* @__PURE__ */
|
|
403
|
+
children: /* @__PURE__ */ H("div", {
|
|
280
404
|
className: "space-y-3",
|
|
281
405
|
children: [
|
|
282
|
-
f && /* @__PURE__ */
|
|
406
|
+
f && /* @__PURE__ */ V(o, {
|
|
283
407
|
tone: "danger",
|
|
284
408
|
children: f
|
|
285
409
|
}),
|
|
286
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ V(l, {
|
|
287
411
|
label: "Parties searched",
|
|
288
412
|
required: !0,
|
|
289
413
|
hint: "Comma-separated — counterparties, related entities, principals.",
|
|
290
|
-
children: /* @__PURE__ */
|
|
291
|
-
value:
|
|
414
|
+
children: /* @__PURE__ */ V(v, {
|
|
415
|
+
value: a,
|
|
292
416
|
onChange: (e) => s(e.target.value),
|
|
293
417
|
placeholder: "Beta Corp, John Roe, Gamma LLP"
|
|
294
418
|
})
|
|
295
419
|
}),
|
|
296
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ V(l, {
|
|
297
421
|
label: "Findings",
|
|
298
|
-
children: /* @__PURE__ */
|
|
299
|
-
value:
|
|
300
|
-
onChange: (e) =>
|
|
422
|
+
children: /* @__PURE__ */ V(_, {
|
|
423
|
+
value: c,
|
|
424
|
+
onChange: (e) => u(e.target.value),
|
|
301
425
|
placeholder: "Notes on any potential conflicts…"
|
|
302
426
|
})
|
|
303
427
|
})
|
|
@@ -306,6 +430,6 @@ var z = (e) => e.split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpp
|
|
|
306
430
|
});
|
|
307
431
|
};
|
|
308
432
|
//#endregion
|
|
309
|
-
export {
|
|
433
|
+
export { G as ClientDetailPage };
|
|
310
434
|
|
|
311
435
|
//# sourceMappingURL=ClientDetailPage.js.map
|