@burdenoff/microfe-eventfullymanaged 2026.1110.7 → 2026.1110.8
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/eventfullymanaged/api/eventApi.d.ts +17 -0
- package/dist/eventfullymanaged/api/eventApi.js +265 -258
- package/dist/eventfullymanaged/api/eventApi.js.map +1 -1
- package/dist/eventfullymanaged/pages/exhibitors/ExhibitorsPage.js +108 -109
- package/dist/eventfullymanaged/pages/exhibitors/ExhibitorsPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { useDeleteExhibitorMutation as e,
|
|
2
|
-
import { ActionMenu as
|
|
3
|
-
import { Pagination as
|
|
4
|
-
import { SafeLink as
|
|
5
|
-
import { useEventfullyManaged as
|
|
6
|
-
import { describeError as
|
|
7
|
-
import { notify as
|
|
8
|
-
import { LeadCaptureDialog as
|
|
9
|
-
import { useMemo as
|
|
10
|
-
import { jsx as
|
|
11
|
-
import { ExternalLink as
|
|
12
|
-
import { Badge as
|
|
1
|
+
import { useDeleteExhibitorMutation as e, useExhibitorSummaryQuery as t, useExhibitorsQuery as n, useLeadsQuery as r } from "../../api/eventApi.js";
|
|
2
|
+
import { ActionMenu as i } from "../../components/ActionMenu.js";
|
|
3
|
+
import { Pagination as a, usePagination as o } from "../../components/Pagination.js";
|
|
4
|
+
import { SafeLink as s } from "../../components/SafeLink.js";
|
|
5
|
+
import { useEventfullyManaged as c } from "../../context/EventfullyManagedContext.js";
|
|
6
|
+
import { describeError as l, mutationSucceeded as u } from "../../lib/mutationResult.js";
|
|
7
|
+
import { notify as d } from "../../lib/toast.js";
|
|
8
|
+
import { LeadCaptureDialog as f } from "../leads/LeadCaptureDialog.js";
|
|
9
|
+
import { useMemo as p, useState as m } from "react";
|
|
10
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
11
|
+
import { ExternalLink as _, Plus as v, Search as y, Store as b, UserPlus as x } from "lucide-react";
|
|
12
|
+
import { Badge as S, Button as C, EmphasisPanel as w, GlassCard as T, IllustratedEmptyState as E, Input as D, PagePurpose as O, ResponsiveTable as k } from "@burdenoff/fe-libs/ui";
|
|
13
13
|
// src/eventfullymanaged/pages/exhibitors/ExhibitorsPage.tsx
|
|
14
|
-
|
|
15
|
-
function j(e) {
|
|
14
|
+
function A(e) {
|
|
16
15
|
if (e.website?.trim()) return e.website;
|
|
17
16
|
let t = e.metadata?.website;
|
|
18
17
|
return typeof t == "string" && t.trim() ? t : null;
|
|
19
18
|
}
|
|
20
|
-
function
|
|
19
|
+
function j(e) {
|
|
21
20
|
let t = e.toLowerCase();
|
|
22
21
|
return [
|
|
23
22
|
"confirmed",
|
|
@@ -33,151 +32,151 @@ function M(e) {
|
|
|
33
32
|
"draft"
|
|
34
33
|
].includes(t) ? "info" : "secondary";
|
|
35
34
|
}
|
|
36
|
-
function
|
|
37
|
-
return /* @__PURE__ */
|
|
35
|
+
function M({ label: e, value: t, loading: n }) {
|
|
36
|
+
return /* @__PURE__ */ g("div", {
|
|
38
37
|
className: "flex items-baseline gap-1.5",
|
|
39
|
-
children: [/* @__PURE__ */
|
|
38
|
+
children: [/* @__PURE__ */ h("span", {
|
|
40
39
|
className: "text-xl font-bold tabular-nums text-text-primary",
|
|
41
40
|
children: n ? "—" : t.toLocaleString()
|
|
42
|
-
}), /* @__PURE__ */
|
|
41
|
+
}), /* @__PURE__ */ h("span", {
|
|
43
42
|
className: "text-sm text-text-secondary",
|
|
44
43
|
children: e
|
|
45
44
|
})]
|
|
46
45
|
});
|
|
47
46
|
}
|
|
48
|
-
function
|
|
49
|
-
let { navigate:
|
|
50
|
-
search:
|
|
51
|
-
limit:
|
|
52
|
-
offset:
|
|
53
|
-
}),
|
|
54
|
-
limit:
|
|
47
|
+
function N() {
|
|
48
|
+
let { navigate: N } = c(), [P, F] = m(""), I = o({ resetKey: P }), { data: L, loading: R, refetch: z } = n({
|
|
49
|
+
search: P,
|
|
50
|
+
limit: I.limit,
|
|
51
|
+
offset: I.offset
|
|
52
|
+
}), B = n({
|
|
53
|
+
limit: 1,
|
|
55
54
|
offset: 0
|
|
56
|
-
}), H =
|
|
57
|
-
limit:
|
|
55
|
+
}), V = t(), H = r({
|
|
56
|
+
limit: 1,
|
|
58
57
|
offset: 0
|
|
59
|
-
}), [U] = e(), [W, G] =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}, [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
booths: t.size,
|
|
69
|
-
leads: H.data?.leads?.total ?? 0
|
|
70
|
-
};
|
|
71
|
-
}, [V.data, H.data]), X = V.loading || H.loading, Z = async (e) => {
|
|
58
|
+
}), [U] = e(), [W, G] = m(null), K = p(() => L?.exhibitors?.items ?? [], [L]), q = L?.exhibitors?.total ?? 0, J = p(() => ({
|
|
59
|
+
exhibitors: B.data?.exhibitors?.total ?? 0,
|
|
60
|
+
booths: V.data?.exhibitorSummary?.boothCount ?? 0,
|
|
61
|
+
leads: H.data?.leads?.total ?? 0
|
|
62
|
+
}), [
|
|
63
|
+
B.data,
|
|
64
|
+
V.data,
|
|
65
|
+
H.data
|
|
66
|
+
]), Y = B.loading || V.loading || H.loading, X = async (e) => {
|
|
72
67
|
try {
|
|
73
68
|
let t = await U({ variables: { id: e.id } }), n = t.data?.deleteExhibitor === !0;
|
|
74
|
-
if (!
|
|
75
|
-
|
|
69
|
+
if (!u(t, n ? e.id : void 0, "Could not delete exhibitor")) return;
|
|
70
|
+
d.success("Exhibitor removed", `${e.name} was deleted.`), await Promise.all([
|
|
71
|
+
z(),
|
|
72
|
+
B.refetch(),
|
|
73
|
+
V.refetch()
|
|
74
|
+
]);
|
|
76
75
|
} catch (e) {
|
|
77
|
-
|
|
76
|
+
d.error("Could not delete exhibitor", l(e));
|
|
78
77
|
}
|
|
79
78
|
};
|
|
80
|
-
return /* @__PURE__ */
|
|
79
|
+
return /* @__PURE__ */ g("div", {
|
|
81
80
|
className: "space-y-6 p-6",
|
|
82
81
|
children: [
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ h(O, { children: "Exhibitors are the companies staffing booths at your event. Track each booth, the category it belongs to, and the contact who runs it — then log the leads their booth collects on the floor so you can prove the value of their stand. Start here to onboard a new exhibitor or work the booth pipeline." }),
|
|
83
|
+
/* @__PURE__ */ g(w, {
|
|
85
84
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
86
|
-
children: [/* @__PURE__ */
|
|
85
|
+
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h1", {
|
|
87
86
|
className: "text-2xl font-bold text-text-primary",
|
|
88
87
|
children: "Exhibitors"
|
|
89
|
-
}), /* @__PURE__ */
|
|
88
|
+
}), /* @__PURE__ */ h("p", {
|
|
90
89
|
className: "mt-1 text-sm text-text-secondary",
|
|
91
90
|
children: "Manage booth exhibitors and capture floor leads from live backend data."
|
|
92
|
-
})] }), /* @__PURE__ */
|
|
91
|
+
})] }), /* @__PURE__ */ g(C, {
|
|
93
92
|
type: "button",
|
|
94
|
-
onClick: () =>
|
|
95
|
-
children: [/* @__PURE__ */
|
|
93
|
+
onClick: () => N("/exhibitors/create"),
|
|
94
|
+
children: [/* @__PURE__ */ h(v, { className: "h-4 w-4" }), "New Exhibitor"]
|
|
96
95
|
})]
|
|
97
96
|
}),
|
|
98
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ g("div", {
|
|
99
98
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
100
|
-
children: [/* @__PURE__ */
|
|
99
|
+
children: [/* @__PURE__ */ g("div", {
|
|
101
100
|
className: "flex flex-wrap items-center gap-x-5 gap-y-1",
|
|
102
101
|
children: [
|
|
103
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ h(M, {
|
|
104
103
|
label: "exhibitors",
|
|
105
|
-
value:
|
|
106
|
-
loading:
|
|
104
|
+
value: J.exhibitors,
|
|
105
|
+
loading: Y
|
|
107
106
|
}),
|
|
108
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ h("span", {
|
|
109
108
|
className: "text-border-strong",
|
|
110
109
|
"aria-hidden": "true",
|
|
111
110
|
children: "·"
|
|
112
111
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ h(M, {
|
|
114
113
|
label: "booths",
|
|
115
|
-
value:
|
|
116
|
-
loading:
|
|
114
|
+
value: J.booths,
|
|
115
|
+
loading: Y
|
|
117
116
|
}),
|
|
118
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ h("span", {
|
|
119
118
|
className: "text-border-strong",
|
|
120
119
|
"aria-hidden": "true",
|
|
121
120
|
children: "·"
|
|
122
121
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ h(M, {
|
|
124
123
|
label: "leads",
|
|
125
|
-
value:
|
|
126
|
-
loading:
|
|
124
|
+
value: J.leads,
|
|
125
|
+
loading: Y
|
|
127
126
|
})
|
|
128
127
|
]
|
|
129
|
-
}), /* @__PURE__ */
|
|
128
|
+
}), /* @__PURE__ */ g("div", {
|
|
130
129
|
className: "relative sm:w-72",
|
|
131
|
-
children: [/* @__PURE__ */
|
|
130
|
+
children: [/* @__PURE__ */ h(y, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-muted" }), /* @__PURE__ */ h(D, {
|
|
132
131
|
type: "text",
|
|
133
|
-
value:
|
|
134
|
-
onChange: (e) =>
|
|
132
|
+
value: P,
|
|
133
|
+
onChange: (e) => F(e.target.value),
|
|
135
134
|
placeholder: "Search exhibitors by name or booth",
|
|
136
135
|
"aria-label": "Search exhibitors by name or booth",
|
|
137
136
|
className: "pl-10"
|
|
138
137
|
})]
|
|
139
138
|
})]
|
|
140
139
|
}),
|
|
141
|
-
|
|
140
|
+
R && K.length === 0 ? /* @__PURE__ */ h(T, {
|
|
142
141
|
treatment: "plain",
|
|
143
142
|
className: "border-border-seam p-8 text-center text-sm text-text-secondary",
|
|
144
143
|
children: "Loading exhibitors..."
|
|
145
|
-
}) : K.length === 0 ? /* @__PURE__ */
|
|
144
|
+
}) : K.length === 0 ? /* @__PURE__ */ h(T, {
|
|
146
145
|
treatment: "plain",
|
|
147
146
|
className: "border-border-seam",
|
|
148
|
-
children: /* @__PURE__ */
|
|
149
|
-
illustration:
|
|
150
|
-
title:
|
|
151
|
-
description:
|
|
152
|
-
action:
|
|
147
|
+
children: /* @__PURE__ */ h(E, {
|
|
148
|
+
illustration: P ? "empty-search" : "empty-data",
|
|
149
|
+
title: P ? "No exhibitors match your search." : "No exhibitors yet.",
|
|
150
|
+
description: P ? "Try a different name or booth code." : "Add your first exhibitor to start building the booth floor.",
|
|
151
|
+
action: P ? void 0 : /* @__PURE__ */ g(C, {
|
|
153
152
|
type: "button",
|
|
154
|
-
onClick: () =>
|
|
155
|
-
children: [/* @__PURE__ */
|
|
153
|
+
onClick: () => N("/exhibitors/create"),
|
|
154
|
+
children: [/* @__PURE__ */ h(v, { className: "h-4 w-4" }), "New Exhibitor"]
|
|
156
155
|
})
|
|
157
156
|
})
|
|
158
|
-
}) : /* @__PURE__ */
|
|
157
|
+
}) : /* @__PURE__ */ h(T, {
|
|
159
158
|
treatment: "plain",
|
|
160
159
|
className: "overflow-hidden border-border-seam p-0",
|
|
161
|
-
children: /* @__PURE__ */
|
|
160
|
+
children: /* @__PURE__ */ h(k, {
|
|
162
161
|
columns: [
|
|
163
162
|
{
|
|
164
163
|
key: "company",
|
|
165
164
|
header: "Company",
|
|
166
165
|
priority: "primary",
|
|
167
166
|
cell: (e) => {
|
|
168
|
-
let t =
|
|
169
|
-
return /* @__PURE__ */
|
|
167
|
+
let t = A(e);
|
|
168
|
+
return /* @__PURE__ */ g("div", {
|
|
170
169
|
className: "min-w-0",
|
|
171
|
-
children: [/* @__PURE__ */
|
|
170
|
+
children: [/* @__PURE__ */ h("p", {
|
|
172
171
|
className: "truncate font-medium text-text-primary",
|
|
173
172
|
children: e.name
|
|
174
|
-
}), /* @__PURE__ */
|
|
173
|
+
}), /* @__PURE__ */ g("p", {
|
|
175
174
|
className: "truncate text-sm text-text-secondary",
|
|
176
|
-
children: [e.contactName ? e.contactName : "No contact set", t ? /* @__PURE__ */
|
|
175
|
+
children: [e.contactName ? e.contactName : "No contact set", t ? /* @__PURE__ */ g(s, {
|
|
177
176
|
href: t,
|
|
178
177
|
className: "ml-2 inline-flex items-center gap-1 text-text-link hover:underline",
|
|
179
178
|
fallbackClassName: "text-text-secondary",
|
|
180
|
-
children: [/* @__PURE__ */
|
|
179
|
+
children: [/* @__PURE__ */ h(_, { className: "h-3.5 w-3.5" }), "Website"]
|
|
181
180
|
}) : null]
|
|
182
181
|
})]
|
|
183
182
|
});
|
|
@@ -188,10 +187,10 @@ function P() {
|
|
|
188
187
|
header: "Booth",
|
|
189
188
|
priority: "secondary",
|
|
190
189
|
mobileLabel: "Booth",
|
|
191
|
-
cell: (e) => e.boothCode ? /* @__PURE__ */
|
|
190
|
+
cell: (e) => e.boothCode ? /* @__PURE__ */ g("span", {
|
|
192
191
|
className: "inline-flex items-center gap-1 rounded-input bg-bg-sunken px-2 py-0.5 text-sm font-medium text-text-primary",
|
|
193
|
-
children: [/* @__PURE__ */
|
|
194
|
-
}) : /* @__PURE__ */
|
|
192
|
+
children: [/* @__PURE__ */ h(b, { className: "h-3.5 w-3.5 text-text-muted" }), e.boothCode]
|
|
193
|
+
}) : /* @__PURE__ */ h("span", {
|
|
195
194
|
className: "text-sm text-text-muted",
|
|
196
195
|
children: "—"
|
|
197
196
|
})
|
|
@@ -201,10 +200,10 @@ function P() {
|
|
|
201
200
|
header: "Category",
|
|
202
201
|
priority: "secondary",
|
|
203
202
|
mobileLabel: "Category",
|
|
204
|
-
cell: (e) => e.category ? /* @__PURE__ */
|
|
203
|
+
cell: (e) => e.category ? /* @__PURE__ */ h(S, {
|
|
205
204
|
variant: "outline",
|
|
206
205
|
children: e.category
|
|
207
|
-
}) : /* @__PURE__ */
|
|
206
|
+
}) : /* @__PURE__ */ h("span", {
|
|
208
207
|
className: "text-sm text-text-muted",
|
|
209
208
|
children: "—"
|
|
210
209
|
})
|
|
@@ -214,8 +213,8 @@ function P() {
|
|
|
214
213
|
header: "Status",
|
|
215
214
|
priority: "primary",
|
|
216
215
|
mobileLabel: "Status",
|
|
217
|
-
cell: (e) => /* @__PURE__ */
|
|
218
|
-
variant:
|
|
216
|
+
cell: (e) => /* @__PURE__ */ h(S, {
|
|
217
|
+
variant: j(e.status),
|
|
219
218
|
className: "uppercase",
|
|
220
219
|
children: e.status
|
|
221
220
|
})
|
|
@@ -226,10 +225,10 @@ function P() {
|
|
|
226
225
|
priority: "primary",
|
|
227
226
|
mobileLabel: "Leads",
|
|
228
227
|
cell: (e) => {
|
|
229
|
-
let t =
|
|
230
|
-
return /* @__PURE__ */
|
|
228
|
+
let t = e.leadCount ?? 0;
|
|
229
|
+
return /* @__PURE__ */ g("span", {
|
|
231
230
|
className: "inline-flex items-center gap-1.5 text-sm text-text-secondary",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
231
|
+
children: [/* @__PURE__ */ h("span", {
|
|
233
232
|
className: `inline-flex min-w-6 items-center justify-center rounded-full px-2 py-0.5 text-xs font-semibold tabular-nums ${t > 0 ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-muted"}`,
|
|
234
233
|
children: t
|
|
235
234
|
}), "leads"]
|
|
@@ -239,31 +238,31 @@ function P() {
|
|
|
239
238
|
],
|
|
240
239
|
data: K,
|
|
241
240
|
rowKey: (e) => e.id,
|
|
242
|
-
rowActions: (e) => /* @__PURE__ */
|
|
241
|
+
rowActions: (e) => /* @__PURE__ */ h(i, {
|
|
243
242
|
ariaLabel: `${e.name} actions`,
|
|
244
243
|
entityName: e.name,
|
|
245
|
-
onEdit: () =>
|
|
246
|
-
onDelete: () =>
|
|
244
|
+
onEdit: () => N(`/exhibitors/${e.id}/edit`),
|
|
245
|
+
onDelete: () => X(e),
|
|
247
246
|
extraItems: [{
|
|
248
247
|
key: "add-lead",
|
|
249
248
|
label: "Add lead",
|
|
250
|
-
icon:
|
|
249
|
+
icon: x,
|
|
251
250
|
onSelect: () => G(e)
|
|
252
251
|
}]
|
|
253
252
|
})
|
|
254
253
|
})
|
|
255
254
|
}),
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
-
offset:
|
|
258
|
-
limit:
|
|
255
|
+
/* @__PURE__ */ h(a, {
|
|
256
|
+
offset: I.offset,
|
|
257
|
+
limit: I.limit,
|
|
259
258
|
loadedCount: K.length,
|
|
260
259
|
total: q,
|
|
261
|
-
onPrev:
|
|
262
|
-
onNext:
|
|
260
|
+
onPrev: I.prevPage,
|
|
261
|
+
onNext: I.nextPage,
|
|
263
262
|
itemLabel: "exhibitors",
|
|
264
|
-
loading:
|
|
263
|
+
loading: R
|
|
265
264
|
}),
|
|
266
|
-
W ? /* @__PURE__ */
|
|
265
|
+
W ? /* @__PURE__ */ h(f, {
|
|
267
266
|
open: !!W,
|
|
268
267
|
onOpenChange: (e) => {
|
|
269
268
|
e || G(null);
|
|
@@ -272,12 +271,12 @@ function P() {
|
|
|
272
271
|
exhibitorId: W.id,
|
|
273
272
|
contextLabel: W.name,
|
|
274
273
|
onCreated: () => {
|
|
275
|
-
H.refetch();
|
|
274
|
+
H.refetch(), z();
|
|
276
275
|
}
|
|
277
276
|
}) : null
|
|
278
277
|
]
|
|
279
278
|
});
|
|
280
279
|
}
|
|
281
|
-
export {
|
|
280
|
+
export { N as default };
|
|
282
281
|
|
|
283
282
|
//# sourceMappingURL=ExhibitorsPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExhibitorsPage.js","names":["Badge","Badge$1","SUMMARY_FETCH","LEADS_FETCH","readWebsite","exhibitor","value","statusVariant","status","SummaryStat","loading","label","ExhibitorsPage","useEventfullyManaged","search","setSearch","useState","pagination","usePagination","useExhibitorsQuery","summaryQuery","leadsQuery","useLeadsQuery","deleteExhibitor","useDeleteExhibitorMutation","leadTarget","setLeadTarget","exhibitors","useMemo","data","total","leadsByExhibitor","map","lead","summary","items","booths","item","summaryLoading","onDelete","response","deleted","mutationSucceeded","notify","refetch","error","describeError","PagePurpose","EmphasisPanel","Button","navigate","Plus","Search","Input","event","GlassCard","IllustratedEmptyState","ResponsiveTable","website","row","SafeLink","ExternalLink","Store","count","ActionMenu","UserPlus","Pagination","LeadCaptureDialog","next"],"sources":["../../../../src/eventfullymanaged/pages/exhibitors/ExhibitorsPage.tsx"],"sourcesContent":["import { ExternalLink, Plus, Search, Store, UserPlus } from 'lucide-react';\nimport {\n Badge,\n Button,\n EmphasisPanel,\n GlassCard,\n IllustratedEmptyState,\n Input,\n PagePurpose,\n ResponsiveTable,\n type ResponsiveTableColumn,\n} from '@burdenoff/fe-libs/ui';\nimport { useMemo, useState } from 'react';\n\nimport { useDeleteExhibitorMutation, useExhibitorsQuery, useLeadsQuery } from '../../api/eventApi';\nimport { ActionMenu } from '../../components/ActionMenu';\nimport { Pagination, usePagination } from '../../components/Pagination';\nimport { SafeLink } from '../../components/SafeLink';\nimport { useEventfullyManaged } from '../../context/EventfullyManagedContext';\nimport { describeError, mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\nimport { LeadCaptureDialog } from '../leads/LeadCaptureDialog';\n\ntype ExhibitorItem = {\n id: string;\n eventId: string;\n name: string;\n boothCode?: string | null;\n category?: string | null;\n contactName?: string | null;\n contactEmail?: string | null;\n website?: string | null;\n status: string;\n metadata?: Record<string, unknown> | null;\n};\n\nconst SUMMARY_FETCH = 200;\nconst LEADS_FETCH = 500;\n\n// BOFF-11372 — website is now its own validated column; metadata is only\n// read as a fallback for any row the backfill migration somehow missed.\nfunction readWebsite(exhibitor: Pick<ExhibitorItem, 'website' | 'metadata'>): string | null {\n if (exhibitor.website?.trim()) {\n return exhibitor.website;\n }\n const value = exhibitor.metadata?.website;\n return typeof value === 'string' && value.trim() ? value : null;\n}\n\nfunction statusVariant(status: string): 'success' | 'warning' | 'secondary' | 'info' {\n const value = status.toLowerCase();\n if (['confirmed', 'active', 'approved'].includes(value)) {\n return 'success';\n }\n if (['cancelled', 'declined', 'expired'].includes(value)) {\n return 'warning';\n }\n if (['invited', 'pending', 'draft'].includes(value)) {\n return 'info';\n }\n return 'secondary';\n}\n\ninterface SummaryStatProps {\n label: string;\n value: number;\n loading: boolean;\n}\n\nfunction SummaryStat({ label, value, loading }: SummaryStatProps) {\n return (\n <div className=\"flex items-baseline gap-1.5\">\n <span className=\"text-xl font-bold tabular-nums text-text-primary\">{loading ? '—' : value.toLocaleString()}</span>\n <span className=\"text-sm text-text-secondary\">{label}</span>\n </div>\n );\n}\n\nexport default function ExhibitorsPage() {\n const { navigate } = useEventfullyManaged();\n const [search, setSearch] = useState('');\n const pagination = usePagination({ resetKey: search });\n const { data, loading, refetch } = useExhibitorsQuery({\n search,\n limit: pagination.limit,\n offset: pagination.offset,\n });\n\n // Broad, unfiltered fetches power the summary strip and the per-exhibitor lead\n // counts — all real data, never fabricated.\n const summaryQuery = useExhibitorsQuery({ limit: SUMMARY_FETCH, offset: 0 });\n const leadsQuery = useLeadsQuery({ limit: LEADS_FETCH, offset: 0 });\n\n const [deleteExhibitor] = useDeleteExhibitorMutation();\n const [leadTarget, setLeadTarget] = useState<ExhibitorItem | null>(null);\n\n const exhibitors = useMemo(() => (data?.exhibitors?.items ?? []) as ExhibitorItem[], [data]);\n const total = data?.exhibitors?.total ?? 0;\n\n const leadsByExhibitor = useMemo(() => {\n const map = new Map<string, number>();\n for (const lead of leadsQuery.data?.leads?.items ?? []) {\n if (lead.exhibitorId) {\n map.set(lead.exhibitorId, (map.get(lead.exhibitorId) ?? 0) + 1);\n }\n }\n return map;\n }, [leadsQuery.data]);\n\n const summary = useMemo(() => {\n const items = (summaryQuery.data?.exhibitors?.items ?? []) as ExhibitorItem[];\n const booths = new Set<string>();\n for (const item of items) {\n if (item.boothCode?.trim()) {\n booths.add(item.boothCode.trim());\n }\n }\n return {\n exhibitors: summaryQuery.data?.exhibitors?.total ?? 0,\n booths: booths.size,\n leads: leadsQuery.data?.leads?.total ?? 0,\n };\n }, [summaryQuery.data, leadsQuery.data]);\n\n const summaryLoading = summaryQuery.loading || leadsQuery.loading;\n\n const onDelete = async (exhibitor: ExhibitorItem) => {\n try {\n const response = await deleteExhibitor({ variables: { id: exhibitor.id } });\n const deleted = response.data?.deleteExhibitor === true;\n if (!mutationSucceeded(response, deleted ? exhibitor.id : undefined, 'Could not delete exhibitor')) {\n return;\n }\n notify.success('Exhibitor removed', `${exhibitor.name} was deleted.`);\n await Promise.all([refetch(), summaryQuery.refetch()]);\n } catch (error) {\n notify.error('Could not delete exhibitor', describeError(error));\n }\n };\n\n const columns: ResponsiveTableColumn<ExhibitorItem>[] = [\n {\n key: 'company',\n header: 'Company',\n priority: 'primary',\n cell: (row) => {\n const website = readWebsite(row);\n return (\n <div className=\"min-w-0\">\n <p className=\"truncate font-medium text-text-primary\">{row.name}</p>\n <p className=\"truncate text-sm text-text-secondary\">\n {row.contactName ? row.contactName : 'No contact set'}\n {website ? (\n <SafeLink\n href={website}\n className=\"ml-2 inline-flex items-center gap-1 text-text-link hover:underline\"\n fallbackClassName=\"text-text-secondary\"\n >\n <ExternalLink className=\"h-3.5 w-3.5\" />\n Website\n </SafeLink>\n ) : null}\n </p>\n </div>\n );\n },\n },\n {\n key: 'booth',\n header: 'Booth',\n priority: 'secondary',\n mobileLabel: 'Booth',\n cell: (row) =>\n row.boothCode ? (\n <span className=\"inline-flex items-center gap-1 rounded-input bg-bg-sunken px-2 py-0.5 text-sm font-medium text-text-primary\">\n <Store className=\"h-3.5 w-3.5 text-text-muted\" />\n {row.boothCode}\n </span>\n ) : (\n <span className=\"text-sm text-text-muted\">—</span>\n ),\n },\n {\n key: 'category',\n header: 'Category',\n priority: 'secondary',\n mobileLabel: 'Category',\n cell: (row) =>\n row.category ? (\n <Badge variant=\"outline\">{row.category}</Badge>\n ) : (\n <span className=\"text-sm text-text-muted\">—</span>\n ),\n },\n {\n key: 'status',\n header: 'Status',\n priority: 'primary',\n mobileLabel: 'Status',\n cell: (row) => (\n <Badge variant={statusVariant(row.status)} className=\"uppercase\">\n {row.status}\n </Badge>\n ),\n },\n {\n key: 'leads',\n header: 'Leads',\n priority: 'primary',\n mobileLabel: 'Leads',\n cell: (row) => {\n const count = leadsByExhibitor.get(row.id) ?? 0;\n return (\n <span className=\"inline-flex items-center gap-1.5 text-sm text-text-secondary\">\n <span\n className={`inline-flex min-w-6 items-center justify-center rounded-full px-2 py-0.5 text-xs font-semibold tabular-nums ${\n count > 0 ? 'bg-action-primary-bg text-action-primary-text' : 'bg-bg-sunken text-text-muted'\n }`}\n >\n {count}\n </span>\n leads\n </span>\n );\n },\n },\n ];\n\n return (\n <div className=\"space-y-6 p-6\">\n <PagePurpose>\n Exhibitors are the companies staffing booths at your event. Track each booth, the category it belongs to, and\n the contact who runs it — then log the leads their booth collects on the floor so you can prove the value of\n their stand. Start here to onboard a new exhibitor or work the booth pipeline.\n </PagePurpose>\n\n <EmphasisPanel className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">Exhibitors</h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n Manage booth exhibitors and capture floor leads from live backend data.\n </p>\n </div>\n <Button type=\"button\" onClick={() => navigate('/exhibitors/create')}>\n <Plus className=\"h-4 w-4\" />\n New Exhibitor\n </Button>\n </EmphasisPanel>\n\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"flex flex-wrap items-center gap-x-5 gap-y-1\">\n <SummaryStat label=\"exhibitors\" value={summary.exhibitors} loading={summaryLoading} />\n <span className=\"text-border-strong\" aria-hidden=\"true\">\n ·\n </span>\n <SummaryStat label=\"booths\" value={summary.booths} loading={summaryLoading} />\n <span className=\"text-border-strong\" aria-hidden=\"true\">\n ·\n </span>\n <SummaryStat label=\"leads\" value={summary.leads} loading={summaryLoading} />\n </div>\n <div className=\"relative sm:w-72\">\n <Search className=\"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-muted\" />\n <Input\n type=\"text\"\n value={search}\n onChange={(event) => setSearch(event.target.value)}\n placeholder=\"Search exhibitors by name or booth\"\n aria-label=\"Search exhibitors by name or booth\"\n className=\"pl-10\"\n />\n </div>\n </div>\n\n {loading && exhibitors.length === 0 ? (\n <GlassCard treatment=\"plain\" className=\"border-border-seam p-8 text-center text-sm text-text-secondary\">\n Loading exhibitors...\n </GlassCard>\n ) : exhibitors.length === 0 ? (\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <IllustratedEmptyState\n illustration={search ? 'empty-search' : 'empty-data'}\n title={search ? 'No exhibitors match your search.' : 'No exhibitors yet.'}\n description={\n search\n ? 'Try a different name or booth code.'\n : 'Add your first exhibitor to start building the booth floor.'\n }\n action={\n !search ? (\n <Button type=\"button\" onClick={() => navigate('/exhibitors/create')}>\n <Plus className=\"h-4 w-4\" />\n New Exhibitor\n </Button>\n ) : undefined\n }\n />\n </GlassCard>\n ) : (\n <GlassCard treatment=\"plain\" className=\"overflow-hidden border-border-seam p-0\">\n <ResponsiveTable\n columns={columns}\n data={exhibitors}\n rowKey={(row) => row.id}\n rowActions={(row) => (\n <ActionMenu\n ariaLabel={`${row.name} actions`}\n entityName={row.name}\n onEdit={() => navigate(`/exhibitors/${row.id}/edit`)}\n onDelete={() => onDelete(row)}\n extraItems={[\n {\n key: 'add-lead',\n label: 'Add lead',\n icon: UserPlus,\n onSelect: () => setLeadTarget(row),\n },\n ]}\n />\n )}\n />\n </GlassCard>\n )}\n\n <Pagination\n offset={pagination.offset}\n limit={pagination.limit}\n loadedCount={exhibitors.length}\n total={total}\n onPrev={pagination.prevPage}\n onNext={pagination.nextPage}\n itemLabel=\"exhibitors\"\n loading={loading}\n />\n\n {leadTarget ? (\n <LeadCaptureDialog\n open={Boolean(leadTarget)}\n onOpenChange={(next) => {\n if (!next) {\n setLeadTarget(null);\n }\n }}\n eventId={leadTarget.eventId}\n exhibitorId={leadTarget.id}\n contextLabel={leadTarget.name}\n onCreated={() => {\n void leadsQuery.refetch();\n }}\n />\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAoCA,IAAME,IAAgB,KAChBC,IAAc;AAIpB,SAASC,EAAY,GAAuE;CAC1F,IAAIC,EAAU,SAAS,KAAK,GAC1B,OAAOA,EAAU;CAEnB,IAAMC,IAAQD,EAAU,UAAU;CAClC,OAAO,OAAOC,KAAU,YAAYA,EAAM,KAAK,IAAIA,IAAQ;AAC7D;AAEA,SAASC,EAAc,GAA8D;CACnF,IAAMD,IAAQE,EAAO,YAAY;CAUjC,OATI;EAAC;EAAa;EAAU;CAAU,CAAC,CAAC,SAASF,CAAK,IAC7C,YAEL;EAAC;EAAa;EAAY;CAAS,CAAC,CAAC,SAASA,CAAK,IAC9C,YAEL;EAAC;EAAW;EAAW;CAAO,CAAC,CAAC,SAASA,CAAK,IACzC,SAEF;AACT;AAQA,SAASG,EAAY,EAAE,UAAO,UAAO,cAA6B;CAChE,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,kBAAC,QAAD;GAAM,WAAU;GAAoD,UAAAC,IAAU,MAAMJ,EAAM,eAAe;EAAQ,CAAA,GACjH,kBAAC,QAAD;GAAM,WAAU;GAA+B,UAAAK;EAAY,CAAA,CACxD;;AAET;AAEA,SAAwBC,IAAiB;CACvC,IAAM,EAAE,gBAAaC,EAAqB,GACpC,CAACC,GAAQC,KAAaC,EAAS,EAAE,GACjCC,IAAaC,EAAc,EAAE,UAAUJ,EAAO,CAAC,GAC/C,EAAE,SAAM,YAAS,eAAYK,EAAmB;EACpD;EACA,OAAOF,EAAW;EAClB,QAAQA,EAAW;CACrB,CAAC,GAIKG,IAAeD,EAAmB;EAAE,OAAOjB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AAA;GAEAQ,IACC,kBAAC0C,GAAD;IACE,MAAM,EAAQ1C;IACd,eAAe,MAAS;KACtB,AAAK2C,KACH1C,EAAc,IAAI;IAEtB;IACA,SAASD,EAAW;IACpB,aAAaA,EAAW;IACxB,cAAcA,EAAW;IACzB,iBAAiB;KACf,EAAgB,QAAQ;IAC1B;GACD,CAAA,IACC;EACD;;AAET"}
|
|
1
|
+
{"version":3,"file":"ExhibitorsPage.js","names":["Badge","Badge$1","readWebsite","exhibitor","value","statusVariant","status","SummaryStat","loading","label","ExhibitorsPage","useEventfullyManaged","search","setSearch","useState","pagination","usePagination","useExhibitorsQuery","unfilteredExhibitorsQuery","exhibitorSummaryQuery","useExhibitorSummaryQuery","leadsQuery","useLeadsQuery","deleteExhibitor","useDeleteExhibitorMutation","leadTarget","setLeadTarget","exhibitors","useMemo","data","total","summary","summaryLoading","onDelete","response","deleted","mutationSucceeded","notify","refetch","error","describeError","PagePurpose","EmphasisPanel","Button","navigate","Plus","Search","Input","event","GlassCard","IllustratedEmptyState","ResponsiveTable","website","row","SafeLink","ExternalLink","Store","count","ActionMenu","UserPlus","Pagination","LeadCaptureDialog","next"],"sources":["../../../../src/eventfullymanaged/pages/exhibitors/ExhibitorsPage.tsx"],"sourcesContent":["import { ExternalLink, Plus, Search, Store, UserPlus } from 'lucide-react';\nimport {\n Badge,\n Button,\n EmphasisPanel,\n GlassCard,\n IllustratedEmptyState,\n Input,\n PagePurpose,\n ResponsiveTable,\n type ResponsiveTableColumn,\n} from '@burdenoff/fe-libs/ui';\nimport { useMemo, useState } from 'react';\n\nimport {\n useDeleteExhibitorMutation,\n useExhibitorSummaryQuery,\n useExhibitorsQuery,\n useLeadsQuery,\n} from '../../api/eventApi';\nimport { ActionMenu } from '../../components/ActionMenu';\nimport { Pagination, usePagination } from '../../components/Pagination';\nimport { SafeLink } from '../../components/SafeLink';\nimport { useEventfullyManaged } from '../../context/EventfullyManagedContext';\nimport { describeError, mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\nimport { LeadCaptureDialog } from '../leads/LeadCaptureDialog';\n\ntype ExhibitorItem = {\n id: string;\n eventId: string;\n name: string;\n boothCode?: string | null;\n category?: string | null;\n contactName?: string | null;\n contactEmail?: string | null;\n website?: string | null;\n status: string;\n metadata?: Record<string, unknown> | null;\n leadCount?: number;\n};\n\n// BOFF-11372 — website is now its own validated column; metadata is only\n// read as a fallback for any row the backfill migration somehow missed.\nfunction readWebsite(exhibitor: Pick<ExhibitorItem, 'website' | 'metadata'>): string | null {\n if (exhibitor.website?.trim()) {\n return exhibitor.website;\n }\n const value = exhibitor.metadata?.website;\n return typeof value === 'string' && value.trim() ? value : null;\n}\n\nfunction statusVariant(status: string): 'success' | 'warning' | 'secondary' | 'info' {\n const value = status.toLowerCase();\n if (['confirmed', 'active', 'approved'].includes(value)) {\n return 'success';\n }\n if (['cancelled', 'declined', 'expired'].includes(value)) {\n return 'warning';\n }\n if (['invited', 'pending', 'draft'].includes(value)) {\n return 'info';\n }\n return 'secondary';\n}\n\ninterface SummaryStatProps {\n label: string;\n value: number;\n loading: boolean;\n}\n\nfunction SummaryStat({ label, value, loading }: SummaryStatProps) {\n return (\n <div className=\"flex items-baseline gap-1.5\">\n <span className=\"text-xl font-bold tabular-nums text-text-primary\">{loading ? '—' : value.toLocaleString()}</span>\n <span className=\"text-sm text-text-secondary\">{label}</span>\n </div>\n );\n}\n\nexport default function ExhibitorsPage() {\n const { navigate } = useEventfullyManaged();\n const [search, setSearch] = useState('');\n const pagination = usePagination({ resetKey: search });\n const { data, loading, refetch } = useExhibitorsQuery({\n search,\n limit: pagination.limit,\n offset: pagination.offset,\n });\n\n // BOFF-11370 — real server-side aggregates, not a count over a capped\n // client-side fetch. The unfiltered exhibitor/lead totals were already\n // correct (the server's own `.total`, independent of `limit`) — only the\n // booth count and per-exhibitor lead counts were broken, so only those\n // two now come from dedicated server aggregates (booths from\n // `exhibitorSummaryQuery`, per-row leads from each row's own\n // `leadCount`). Both list queries use limit: 1 purely for their `.total`.\n const unfilteredExhibitorsQuery = useExhibitorsQuery({ limit: 1, offset: 0 });\n const exhibitorSummaryQuery = useExhibitorSummaryQuery();\n const leadsQuery = useLeadsQuery({ limit: 1, offset: 0 });\n\n const [deleteExhibitor] = useDeleteExhibitorMutation();\n const [leadTarget, setLeadTarget] = useState<ExhibitorItem | null>(null);\n\n const exhibitors = useMemo(() => (data?.exhibitors?.items ?? []) as ExhibitorItem[], [data]);\n const total = data?.exhibitors?.total ?? 0;\n\n const summary = useMemo(\n () => ({\n exhibitors: unfilteredExhibitorsQuery.data?.exhibitors?.total ?? 0,\n booths: exhibitorSummaryQuery.data?.exhibitorSummary?.boothCount ?? 0,\n leads: leadsQuery.data?.leads?.total ?? 0,\n }),\n [unfilteredExhibitorsQuery.data, exhibitorSummaryQuery.data, leadsQuery.data]\n );\n\n const summaryLoading = unfilteredExhibitorsQuery.loading || exhibitorSummaryQuery.loading || leadsQuery.loading;\n\n const onDelete = async (exhibitor: ExhibitorItem) => {\n try {\n const response = await deleteExhibitor({ variables: { id: exhibitor.id } });\n const deleted = response.data?.deleteExhibitor === true;\n if (!mutationSucceeded(response, deleted ? exhibitor.id : undefined, 'Could not delete exhibitor')) {\n return;\n }\n notify.success('Exhibitor removed', `${exhibitor.name} was deleted.`);\n await Promise.all([refetch(), unfilteredExhibitorsQuery.refetch(), exhibitorSummaryQuery.refetch()]);\n } catch (error) {\n notify.error('Could not delete exhibitor', describeError(error));\n }\n };\n\n const columns: ResponsiveTableColumn<ExhibitorItem>[] = [\n {\n key: 'company',\n header: 'Company',\n priority: 'primary',\n cell: (row) => {\n const website = readWebsite(row);\n return (\n <div className=\"min-w-0\">\n <p className=\"truncate font-medium text-text-primary\">{row.name}</p>\n <p className=\"truncate text-sm text-text-secondary\">\n {row.contactName ? row.contactName : 'No contact set'}\n {website ? (\n <SafeLink\n href={website}\n className=\"ml-2 inline-flex items-center gap-1 text-text-link hover:underline\"\n fallbackClassName=\"text-text-secondary\"\n >\n <ExternalLink className=\"h-3.5 w-3.5\" />\n Website\n </SafeLink>\n ) : null}\n </p>\n </div>\n );\n },\n },\n {\n key: 'booth',\n header: 'Booth',\n priority: 'secondary',\n mobileLabel: 'Booth',\n cell: (row) =>\n row.boothCode ? (\n <span className=\"inline-flex items-center gap-1 rounded-input bg-bg-sunken px-2 py-0.5 text-sm font-medium text-text-primary\">\n <Store className=\"h-3.5 w-3.5 text-text-muted\" />\n {row.boothCode}\n </span>\n ) : (\n <span className=\"text-sm text-text-muted\">—</span>\n ),\n },\n {\n key: 'category',\n header: 'Category',\n priority: 'secondary',\n mobileLabel: 'Category',\n cell: (row) =>\n row.category ? (\n <Badge variant=\"outline\">{row.category}</Badge>\n ) : (\n <span className=\"text-sm text-text-muted\">—</span>\n ),\n },\n {\n key: 'status',\n header: 'Status',\n priority: 'primary',\n mobileLabel: 'Status',\n cell: (row) => (\n <Badge variant={statusVariant(row.status)} className=\"uppercase\">\n {row.status}\n </Badge>\n ),\n },\n {\n key: 'leads',\n header: 'Leads',\n priority: 'primary',\n mobileLabel: 'Leads',\n cell: (row) => {\n const count = row.leadCount ?? 0;\n return (\n <span className=\"inline-flex items-center gap-1.5 text-sm text-text-secondary\">\n <span\n className={`inline-flex min-w-6 items-center justify-center rounded-full px-2 py-0.5 text-xs font-semibold tabular-nums ${\n count > 0 ? 'bg-action-primary-bg text-action-primary-text' : 'bg-bg-sunken text-text-muted'\n }`}\n >\n {count}\n </span>\n leads\n </span>\n );\n },\n },\n ];\n\n return (\n <div className=\"space-y-6 p-6\">\n <PagePurpose>\n Exhibitors are the companies staffing booths at your event. Track each booth, the category it belongs to, and\n the contact who runs it — then log the leads their booth collects on the floor so you can prove the value of\n their stand. Start here to onboard a new exhibitor or work the booth pipeline.\n </PagePurpose>\n\n <EmphasisPanel className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">Exhibitors</h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n Manage booth exhibitors and capture floor leads from live backend data.\n </p>\n </div>\n <Button type=\"button\" onClick={() => navigate('/exhibitors/create')}>\n <Plus className=\"h-4 w-4\" />\n New Exhibitor\n </Button>\n </EmphasisPanel>\n\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"flex flex-wrap items-center gap-x-5 gap-y-1\">\n <SummaryStat label=\"exhibitors\" value={summary.exhibitors} loading={summaryLoading} />\n <span className=\"text-border-strong\" aria-hidden=\"true\">\n ·\n </span>\n <SummaryStat label=\"booths\" value={summary.booths} loading={summaryLoading} />\n <span className=\"text-border-strong\" aria-hidden=\"true\">\n ·\n </span>\n <SummaryStat label=\"leads\" value={summary.leads} loading={summaryLoading} />\n </div>\n <div className=\"relative sm:w-72\">\n <Search className=\"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-muted\" />\n <Input\n type=\"text\"\n value={search}\n onChange={(event) => setSearch(event.target.value)}\n placeholder=\"Search exhibitors by name or booth\"\n aria-label=\"Search exhibitors by name or booth\"\n className=\"pl-10\"\n />\n </div>\n </div>\n\n {loading && exhibitors.length === 0 ? (\n <GlassCard treatment=\"plain\" className=\"border-border-seam p-8 text-center text-sm text-text-secondary\">\n Loading exhibitors...\n </GlassCard>\n ) : exhibitors.length === 0 ? (\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <IllustratedEmptyState\n illustration={search ? 'empty-search' : 'empty-data'}\n title={search ? 'No exhibitors match your search.' : 'No exhibitors yet.'}\n description={\n search\n ? 'Try a different name or booth code.'\n : 'Add your first exhibitor to start building the booth floor.'\n }\n action={\n !search ? (\n <Button type=\"button\" onClick={() => navigate('/exhibitors/create')}>\n <Plus className=\"h-4 w-4\" />\n New Exhibitor\n </Button>\n ) : undefined\n }\n />\n </GlassCard>\n ) : (\n <GlassCard treatment=\"plain\" className=\"overflow-hidden border-border-seam p-0\">\n <ResponsiveTable\n columns={columns}\n data={exhibitors}\n rowKey={(row) => row.id}\n rowActions={(row) => (\n <ActionMenu\n ariaLabel={`${row.name} actions`}\n entityName={row.name}\n onEdit={() => navigate(`/exhibitors/${row.id}/edit`)}\n onDelete={() => onDelete(row)}\n extraItems={[\n {\n key: 'add-lead',\n label: 'Add lead',\n icon: UserPlus,\n onSelect: () => setLeadTarget(row),\n },\n ]}\n />\n )}\n />\n </GlassCard>\n )}\n\n <Pagination\n offset={pagination.offset}\n limit={pagination.limit}\n loadedCount={exhibitors.length}\n total={total}\n onPrev={pagination.prevPage}\n onNext={pagination.nextPage}\n itemLabel=\"exhibitors\"\n loading={loading}\n />\n\n {leadTarget ? (\n <LeadCaptureDialog\n open={Boolean(leadTarget)}\n onOpenChange={(next) => {\n if (!next) {\n setLeadTarget(null);\n }\n }}\n eventId={leadTarget.eventId}\n exhibitorId={leadTarget.id}\n contextLabel={leadTarget.name}\n onCreated={() => {\n // Refresh both the leads total tile and this exhibitor's own\n // leadCount (now server-computed, not derived from leadsQuery).\n void leadsQuery.refetch();\n void refetch();\n }}\n />\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA4CA,SAASE,EAAY,GAAuE;CAC1F,IAAIC,EAAU,SAAS,KAAK,GAC1B,OAAOA,EAAU;CAEnB,IAAMC,IAAQD,EAAU,UAAU;CAClC,OAAO,OAAOC,KAAU,YAAYA,EAAM,KAAK,IAAIA,IAAQ;AAC7D;AAEA,SAASC,EAAc,GAA8D;CACnF,IAAMD,IAAQE,EAAO,YAAY;CAUjC,OATI;EAAC;EAAa;EAAU;CAAU,CAAC,CAAC,SAASF,CAAK,IAC7C,YAEL;EAAC;EAAa;EAAY;CAAS,CAAC,CAAC,SAASA,CAAK,IAC9C,YAEL;EAAC;EAAW;EAAW;CAAO,CAAC,CAAC,SAASA,CAAK,IACzC,SAEF;AACT;AAQA,SAASG,EAAY,EAAE,UAAO,UAAO,cAA6B;CAChE,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,kBAAC,Q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