@burdenoff/microfe-eventfullymanaged 2026.1110.6 → 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 +23 -0
- package/dist/eventfullymanaged/api/eventApi.js +227 -210
- package/dist/eventfullymanaged/api/eventApi.js.map +1 -1
- package/dist/eventfullymanaged/pages/exhibitors/ExhibitorFormPage.js +9 -16
- package/dist/eventfullymanaged/pages/exhibitors/ExhibitorFormPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/exhibitors/ExhibitorsPage.js +110 -110
- package/dist/eventfullymanaged/pages/exhibitors/ExhibitorsPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCreateExhibitorMutation as e, useEventsQuery as t,
|
|
1
|
+
import { useCreateExhibitorMutation as e, useEventsQuery as t, useExhibitorQuery as n, useUpdateExhibitorMutation as r } from "../../api/eventApi.js";
|
|
2
2
|
import { EntityFormShell as i } from "../../components/EntityFormShell.js";
|
|
3
3
|
import { safeUrl as a } from "../../components/SafeLink.js";
|
|
4
4
|
import { useEventfullyManaged as o } from "../../context/EventfullyManagedContext.js";
|
|
@@ -40,20 +40,15 @@ function w() {
|
|
|
40
40
|
let { id: w = "" } = p(), T = d(() => !!w, [w]), { navigate: E } = o(), { data: D } = t({
|
|
41
41
|
limit: 100,
|
|
42
42
|
offset: 0
|
|
43
|
-
}), { data: O } = n({
|
|
44
|
-
limit: 100,
|
|
45
|
-
offset: 0
|
|
46
|
-
}), k = d(() => (O?.exhibitors?.items ?? []).find((e) => e.id === w), [O, w]), [A, { loading: j }] = e(), [M, { loading: N }] = r(), [P, F] = f(S);
|
|
43
|
+
}), { data: O } = n(w), k = O?.exhibitor ?? void 0, [A, { loading: j }] = e(), [M, { loading: N }] = r(), [P, F] = f(S);
|
|
47
44
|
u(() => {
|
|
48
|
-
|
|
49
|
-
let e = k.metadata ?? {}, t = typeof e.website == "string" ? e.website : "";
|
|
50
|
-
F({
|
|
45
|
+
T && k && F({
|
|
51
46
|
eventId: k.eventId ?? "",
|
|
52
47
|
name: k.name ?? "",
|
|
53
48
|
boothCode: k.boothCode ?? "",
|
|
54
49
|
category: k.category ?? "",
|
|
55
50
|
status: k.status ?? "CONFIRMED",
|
|
56
|
-
website:
|
|
51
|
+
website: k.website ?? "",
|
|
57
52
|
contactName: k.contactName ?? "",
|
|
58
53
|
contactEmail: k.contactEmail ?? ""
|
|
59
54
|
});
|
|
@@ -73,7 +68,7 @@ function w() {
|
|
|
73
68
|
l.error("Invalid website", "Enter a valid http(s) URL, or leave it blank.");
|
|
74
69
|
return;
|
|
75
70
|
}
|
|
76
|
-
let n =
|
|
71
|
+
let n = {
|
|
77
72
|
eventId: P.eventId,
|
|
78
73
|
name: P.name,
|
|
79
74
|
boothCode: P.boothCode,
|
|
@@ -81,22 +76,20 @@ function w() {
|
|
|
81
76
|
status: P.status,
|
|
82
77
|
contactName: P.contactName,
|
|
83
78
|
contactEmail: P.contactEmail,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
website: t ?? ""
|
|
87
|
-
}
|
|
79
|
+
website: t ?? "",
|
|
80
|
+
metadata: k?.metadata ?? {}
|
|
88
81
|
};
|
|
89
82
|
try {
|
|
90
83
|
if (T) {
|
|
91
84
|
let e = await M({ variables: {
|
|
92
85
|
id: w,
|
|
93
|
-
input:
|
|
86
|
+
input: n
|
|
94
87
|
} });
|
|
95
88
|
if (!c(e, e.data?.updateExhibitor?.id, "Could not update exhibitor")) return;
|
|
96
89
|
E("/exhibitors");
|
|
97
90
|
return;
|
|
98
91
|
}
|
|
99
|
-
let e = await A({ variables: { input:
|
|
92
|
+
let e = await A({ variables: { input: n } });
|
|
100
93
|
if (!c(e, e.data?.createExhibitor?.id, "Could not create exhibitor")) return;
|
|
101
94
|
E("/exhibitors");
|
|
102
95
|
} catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExhibitorFormPage.js","names":["initialState","STATUS_OPTIONS","ExhibitorFormPage","useParams","isEdit","useMemo","id","useEventfullyManaged","eventsData","useEventsQuery","exhibitorsData","useExhibitorsQuery","existing","item","createExhibitor","creating","useCreateExhibitorMutation","updateExhibitor","updating","useUpdateExhibitorMutation","form","setForm","useState","metadata","website","onChange","prev","field","value","onSubmit","event","normalizedWebsite","safeUrl","existingMetadata","input","response","mutationSucceeded","error","describeError","saving","events","EntityFormShell","navigate","Select","SelectTrigger","SelectValue","SelectContent","SelectItem","eventItem","Input","option"],"sources":["../../../../src/eventfullymanaged/pages/exhibitors/ExhibitorFormPage.tsx"],"sourcesContent":["/* eslint-disable react-hooks/set-state-in-effect */\nimport { Input, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@burdenoff/fe-libs/ui';\nimport { useEffect, useMemo, useState } from 'react';\nimport { useParams } from 'react-router';\n\nimport {\n useCreateExhibitorMutation,\n useEventsQuery,\n useExhibitorsQuery,\n useUpdateExhibitorMutation,\n} from '../../api/eventApi';\nimport { EntityFormShell } from '../../components/EntityFormShell';\nimport { safeUrl } from '../../components/SafeLink';\nimport { useEventfullyManaged } from '../../context/EventfullyManagedContext';\nimport { describeError, mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\n\ntype ExhibitorFormState = {\n eventId: string;\n name: string;\n boothCode: string;\n category: string;\n status: string;\n website: string;\n contactName: string;\n contactEmail: string;\n};\n\nconst initialState: ExhibitorFormState = {\n eventId: '',\n name: '',\n boothCode: '',\n category: '',\n status: 'CONFIRMED',\n website: '',\n contactName: '',\n contactEmail: '',\n};\n\nconst STATUS_OPTIONS = [\n { value: 'INVITED', label: 'Invited' },\n { value: 'CONFIRMED', label: 'Confirmed' },\n { value: 'ACTIVE', label: 'Active' },\n { value: 'CANCELLED', label: 'Cancelled' },\n];\n\nexport default function ExhibitorFormPage() {\n const { id = '' } = useParams<{ id: string }>();\n const isEdit = useMemo(() => Boolean(id), [id]);\n const { navigate } = useEventfullyManaged();\n\n const { data: eventsData } = useEventsQuery({ limit: 100, offset: 0 });\n // No by-id resolver exists for exhibitors, so the edit initial-state is derived\n // from the list query row.\n const { data: exhibitorsData } = useExhibitorsQuery({ limit: 100, offset: 0 });\n\n const existing = useMemo(\n () => (exhibitorsData?.exhibitors?.items ?? []).find((item) => item.id === id),\n [exhibitorsData, id]\n );\n\n const [createExhibitor, { loading: creating }] = useCreateExhibitorMutation();\n const [updateExhibitor, { loading: updating }] = useUpdateExhibitorMutation();\n const [form, setForm] = useState<ExhibitorFormState>(initialState);\n\n useEffect(() => {\n if (!isEdit || !existing) {\n return;\n }\n const metadata = existing.metadata ?? {};\n const website = typeof metadata.website === 'string' ? metadata.website : '';\n setForm({\n eventId: existing.eventId ?? '',\n name: existing.name ?? '',\n boothCode: existing.boothCode ?? '',\n category: existing.category ?? '',\n status: existing.status ?? 'CONFIRMED',\n website,\n contactName: existing.contactName ?? '',\n contactEmail: existing.contactEmail ?? '',\n });\n }, [existing, isEdit]);\n\n const onChange = (field: keyof ExhibitorFormState, value: string) => {\n setForm((prev) => ({ ...prev, [field]: value }));\n };\n\n const onSubmit = async (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n\n if (!form.eventId) {\n notify.error('Event required', 'Choose the event this exhibitor belongs to.');\n return;\n }\n\n // The website is free text persisted verbatim, so normalise/reject it before\n // it is stored and later rendered as a link.\n const normalizedWebsite = safeUrl(form.website);\n if (form.website.trim() && !normalizedWebsite) {\n notify.error('Invalid website', 'Enter a valid http(s) URL, or leave it blank.');\n return;\n }\n\n const existingMetadata = existing?.metadata ?? {};\n const input = {\n eventId: form.eventId,\n name: form.name,\n boothCode: form.boothCode,\n category: form.category,\n status: form.status,\n contactName: form.contactName,\n contactEmail: form.contactEmail,\n metadata: { ...existingMetadata, website: normalizedWebsite ?? '' },\n };\n\n try {\n if (isEdit) {\n const response = await updateExhibitor({ variables: { id, input } });\n if (!mutationSucceeded(response, response.data?.updateExhibitor?.id, 'Could not update exhibitor')) {\n return;\n }\n navigate('/exhibitors');\n return;\n }\n\n const response = await createExhibitor({ variables: { input } });\n if (!mutationSucceeded(response, response.data?.createExhibitor?.id, 'Could not create exhibitor')) {\n return;\n }\n navigate('/exhibitors');\n } catch (error) {\n notify.error('Could not save exhibitor', describeError(error));\n }\n };\n\n const saving = creating || updating;\n const events = eventsData?.events?.items ?? [];\n\n return (\n <EntityFormShell\n title={isEdit ? 'Edit Exhibitor' : 'New Exhibitor'}\n description=\"Manage a booth exhibitor with live backend persistence.\"\n purpose=\"Register a company staffing a booth: link it to the event, give it a booth code and category, and record who to contact. Once saved, log the leads their booth collects from the exhibitor list — entered manually, there is no badge-scan capture yet.\"\n backLabel=\"Back to Exhibitors\"\n onBack={() => navigate('/exhibitors')}\n onSubmit={onSubmit}\n submitLabel={isEdit ? 'Save Exhibitor' : 'Create Exhibitor'}\n saving={saving}\n >\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2\">\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Event</span>\n <Select value={form.eventId} onValueChange={(value) => onChange('eventId', value)}>\n <SelectTrigger aria-label=\"Event\">\n <SelectValue placeholder=\"Select event\" />\n </SelectTrigger>\n <SelectContent>\n {events.map((eventItem) => (\n <SelectItem key={eventItem.id} value={eventItem.id}>\n {eventItem.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Name</span>\n <Input value={form.name} onChange={(e) => onChange('name', e.target.value)} required />\n </label>\n </div>\n\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-3\">\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Booth Code</span>\n <Input value={form.boothCode} onChange={(e) => onChange('boothCode', e.target.value)} />\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Category</span>\n <Input value={form.category} onChange={(e) => onChange('category', e.target.value)} />\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Status</span>\n <Select value={form.status} onValueChange={(value) => onChange('status', value)}>\n <SelectTrigger aria-label=\"Status\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {STATUS_OPTIONS.map((option) => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </label>\n </div>\n\n <label className=\"block space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Website</span>\n <Input\n value={form.website}\n onChange={(e) => onChange('website', e.target.value)}\n placeholder=\"https://example.com\"\n />\n </label>\n\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2\">\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Contact Name</span>\n <Input value={form.contactName} onChange={(e) => onChange('contactName', e.target.value)} />\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Contact Email</span>\n <Input type=\"email\" value={form.contactEmail} onChange={(e) => onChange('contactEmail', e.target.value)} />\n </label>\n </div>\n </EntityFormShell>\n );\n}\n"],"mappings":";;;;;;;;;;;AA4BA,IAAMA,IAAmC;CACvC,SAAS;CACT,MAAM;CACN,WAAW;CACX,UAAU;CACV,QAAQ;CACR,SAAS;CACT,aAAa;CACb,cAAc;AAChB,GAEMC,IAAiB;CACrB;EAAE,OAAO;EAAW,OAAO;CAAU;CACrC;EAAE,OAAO;EAAa,OAAO;CAAY;CACzC;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAa,OAAO;CAAY;AAC3C;AAEA,SAAwBC,IAAoB;CAC1C,IAAM,EAAE,QAAK,OAAOC,EAA0B,GACxCC,IAASC,QAAc,EAAQC,GAAK,CAACA,CAAE,CAAC,GACxC,EAAE,gBAAaC,EAAqB,GAEpC,EAAE,MAAMC,MAAeC,EAAe;EAAE,OAAO;EAAK,QAAQ;CAAE,CAAC,GAG/D,EAAE,MAAMC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AjB,UAAA,CACE,kBAAC,QAAD;KAAM,WAAU;KAAgC,UAAA;IAAa,CAAA,GAC7D,kBAACD,GAAD;KACE,OAAO7B,EAAK;KACZ,WAAW,MAAMK,EAAS,WAAW,EAAE,OAAO,KAAK;KACnD,aAAY;IACb,CAAA,CACI;;GAEP,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAC,SAAD;KAAO,WAAU;KAAjB,UAAA,CACE,kBAAC,QAAD;MAAM,WAAU;MAAgC,UAAA;KAAkB,CAAA,GAClE,kBAACwB,GAAD;MAAO,OAAO7B,EAAK;MAAa,WAAW,MAAMK,EAAS,eAAe,EAAE,OAAO,KAAK;KAAI,CAAA,CACtF;IACP,CAAA,GAAA,kBAAC,SAAD;KAAO,WAAU;KAAjB,UAAA,CACE,kBAAC,QAAD;MAAM,WAAU;MAAgC,UAAA;KAAmB,CAAA,GACnE,kBAACwB,GAAD;MAAO,MAAK;MAAQ,OAAO7B,EAAK;MAAc,WAAW,MAAMK,EAAS,gBAAgB,EAAE,OAAO,KAAK;KAAI,CAAA,CACrG;IACJ,CAAA,CAAA;;EACU;;AAErB"}
|
|
1
|
+
{"version":3,"file":"ExhibitorFormPage.js","names":["initialState","STATUS_OPTIONS","ExhibitorFormPage","useParams","isEdit","useMemo","id","useEventfullyManaged","eventsData","useEventsQuery","exhibitorData","useExhibitorQuery","existing","createExhibitor","creating","useCreateExhibitorMutation","updateExhibitor","updating","useUpdateExhibitorMutation","form","setForm","useState","onChange","prev","field","value","onSubmit","event","normalizedWebsite","safeUrl","input","response","mutationSucceeded","error","describeError","saving","events","EntityFormShell","navigate","Select","SelectTrigger","SelectValue","SelectContent","SelectItem","eventItem","Input","option"],"sources":["../../../../src/eventfullymanaged/pages/exhibitors/ExhibitorFormPage.tsx"],"sourcesContent":["/* eslint-disable react-hooks/set-state-in-effect */\nimport { Input, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@burdenoff/fe-libs/ui';\nimport { useEffect, useMemo, useState } from 'react';\nimport { useParams } from 'react-router';\n\nimport {\n useCreateExhibitorMutation,\n useEventsQuery,\n useExhibitorQuery,\n useUpdateExhibitorMutation,\n} from '../../api/eventApi';\nimport { EntityFormShell } from '../../components/EntityFormShell';\nimport { safeUrl } from '../../components/SafeLink';\nimport { useEventfullyManaged } from '../../context/EventfullyManagedContext';\nimport { describeError, mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\n\ntype ExhibitorFormState = {\n eventId: string;\n name: string;\n boothCode: string;\n category: string;\n status: string;\n website: string;\n contactName: string;\n contactEmail: string;\n};\n\nconst initialState: ExhibitorFormState = {\n eventId: '',\n name: '',\n boothCode: '',\n category: '',\n status: 'CONFIRMED',\n website: '',\n contactName: '',\n contactEmail: '',\n};\n\nconst STATUS_OPTIONS = [\n { value: 'INVITED', label: 'Invited' },\n { value: 'CONFIRMED', label: 'Confirmed' },\n { value: 'ACTIVE', label: 'Active' },\n { value: 'CANCELLED', label: 'Cancelled' },\n];\n\nexport default function ExhibitorFormPage() {\n const { id = '' } = useParams<{ id: string }>();\n const isEdit = useMemo(() => Boolean(id), [id]);\n const { navigate } = useEventfullyManaged();\n\n const { data: eventsData } = useEventsQuery({ limit: 100, offset: 0 });\n // BOFF-11369 — loads the exhibitor directly by id instead of finding it\n // inside a capped list query, so editing the 101st+ exhibitor no longer\n // opens a blank form and wipes its data on save.\n const { data: exhibitorData } = useExhibitorQuery(id);\n const existing = exhibitorData?.exhibitor ?? undefined;\n\n const [createExhibitor, { loading: creating }] = useCreateExhibitorMutation();\n const [updateExhibitor, { loading: updating }] = useUpdateExhibitorMutation();\n const [form, setForm] = useState<ExhibitorFormState>(initialState);\n\n useEffect(() => {\n if (!isEdit || !existing) {\n return;\n }\n setForm({\n eventId: existing.eventId ?? '',\n name: existing.name ?? '',\n boothCode: existing.boothCode ?? '',\n category: existing.category ?? '',\n status: existing.status ?? 'CONFIRMED',\n website: existing.website ?? '',\n contactName: existing.contactName ?? '',\n contactEmail: existing.contactEmail ?? '',\n });\n }, [existing, isEdit]);\n\n const onChange = (field: keyof ExhibitorFormState, value: string) => {\n setForm((prev) => ({ ...prev, [field]: value }));\n };\n\n const onSubmit = async (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n\n if (!form.eventId) {\n notify.error('Event required', 'Choose the event this exhibitor belongs to.');\n return;\n }\n\n // The website is free text persisted verbatim, so normalise/reject it before\n // it is stored and later rendered as a link.\n const normalizedWebsite = safeUrl(form.website);\n if (form.website.trim() && !normalizedWebsite) {\n notify.error('Invalid website', 'Enter a valid http(s) URL, or leave it blank.');\n return;\n }\n\n const input = {\n eventId: form.eventId,\n name: form.name,\n boothCode: form.boothCode,\n category: form.category,\n status: form.status,\n contactName: form.contactName,\n contactEmail: form.contactEmail,\n website: normalizedWebsite ?? '',\n metadata: existing?.metadata ?? {},\n };\n\n try {\n if (isEdit) {\n const response = await updateExhibitor({ variables: { id, input } });\n if (!mutationSucceeded(response, response.data?.updateExhibitor?.id, 'Could not update exhibitor')) {\n return;\n }\n navigate('/exhibitors');\n return;\n }\n\n const response = await createExhibitor({ variables: { input } });\n if (!mutationSucceeded(response, response.data?.createExhibitor?.id, 'Could not create exhibitor')) {\n return;\n }\n navigate('/exhibitors');\n } catch (error) {\n notify.error('Could not save exhibitor', describeError(error));\n }\n };\n\n const saving = creating || updating;\n const events = eventsData?.events?.items ?? [];\n\n return (\n <EntityFormShell\n title={isEdit ? 'Edit Exhibitor' : 'New Exhibitor'}\n description=\"Manage a booth exhibitor with live backend persistence.\"\n purpose=\"Register a company staffing a booth: link it to the event, give it a booth code and category, and record who to contact. Once saved, log the leads their booth collects from the exhibitor list — entered manually, there is no badge-scan capture yet.\"\n backLabel=\"Back to Exhibitors\"\n onBack={() => navigate('/exhibitors')}\n onSubmit={onSubmit}\n submitLabel={isEdit ? 'Save Exhibitor' : 'Create Exhibitor'}\n saving={saving}\n >\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2\">\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Event</span>\n <Select value={form.eventId} onValueChange={(value) => onChange('eventId', value)}>\n <SelectTrigger aria-label=\"Event\">\n <SelectValue placeholder=\"Select event\" />\n </SelectTrigger>\n <SelectContent>\n {events.map((eventItem) => (\n <SelectItem key={eventItem.id} value={eventItem.id}>\n {eventItem.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Name</span>\n <Input value={form.name} onChange={(e) => onChange('name', e.target.value)} required />\n </label>\n </div>\n\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-3\">\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Booth Code</span>\n <Input value={form.boothCode} onChange={(e) => onChange('boothCode', e.target.value)} />\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Category</span>\n <Input value={form.category} onChange={(e) => onChange('category', e.target.value)} />\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Status</span>\n <Select value={form.status} onValueChange={(value) => onChange('status', value)}>\n <SelectTrigger aria-label=\"Status\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {STATUS_OPTIONS.map((option) => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </label>\n </div>\n\n <label className=\"block space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Website</span>\n <Input\n value={form.website}\n onChange={(e) => onChange('website', e.target.value)}\n placeholder=\"https://example.com\"\n />\n </label>\n\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2\">\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Contact Name</span>\n <Input value={form.contactName} onChange={(e) => onChange('contactName', e.target.value)} />\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Contact Email</span>\n <Input type=\"email\" value={form.contactEmail} onChange={(e) => onChange('contactEmail', e.target.value)} />\n </label>\n </div>\n </EntityFormShell>\n );\n}\n"],"mappings":";;;;;;;;;;;AA4BA,IAAMA,IAAmC;CACvC,SAAS;CACT,MAAM;CACN,WAAW;CACX,UAAU;CACV,QAAQ;CACR,SAAS;CACT,aAAa;CACb,cAAc;AAChB,GAEMC,IAAiB;CACrB;EAAE,OAAO;EAAW,OAAO;CAAU;CACrC;EAAE,OAAO;EAAa,OAAO;CAAY;CACzC;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAa,OAAO;CAAY;AAC3C;AAEA,SAAwBC,IAAoB;CAC1C,IAAM,EAAE,QAAK,OAAOC,EAA0B,GACxCC,IAASC,QAAc,EAAQC,GAAK,CAACA,CAAE,CAAC,GACxC,EAAE,gBAAaC,EAAqB,GAEpC,EAAE,MAAMC,MAAeC,EAAe;EAAE,OAAO;EAAK,QAAQ;CAAE,CAAC,GAI/D,EAAE,MAAMC,MAAkBC,EAAkBL,CAAE,GAC9CM,IAAWF,GAAe,aAAa,KAAA,GAEvC,CAACG,GAAiB,EAAE,SAASC,OAAcC,EAA2B,GACtE,CAACC,GAAiB,EAAE,SAASC,OAAcC,EAA2B,GACtE,CAACC,GAAMC,KAAWC,EAA6BrB,CAAY;CAEjE,QAAgB;EACd,AAAKI,KAAWQ,KAGhBQ,EAAQ;GACN,SAASR,EAAS,WAAW;GAC7B,MAAMA,EAAS,QAAQ;GACvB,WAAWA,EAAS,aAAa;GACjC,UAAUA,EAAS,YAAY;GAC/B,QAAQA,EAAS,UAAU;GAC3B,SAASA,EAAS,WAAW;GAC7B,aAAaA,EAAS,eAAe;GACrC,cAAcA,EAAS,gBAAgB;EACzC,CAAC;CACH,GAAG,CAACA,GAAUR,CAAM,CAAC;CAErB,IAAMkB,KAAY,GAAiC,MAAkB;EACnE,GAAS,OAAU;GAAE,GAAGC;IAAOC,IAAQC;EAAM,EAAE;CACjD,GAEMC,IAAW,OAAO,MAA4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OAAQ,OAAOpB,EAAK;OAAQ,gBAAgB,MAAUG,EAAS,UAAUG,CAAK;OAA9E,UAAA,CACE,kBAACe,GAAD;QAAe,cAAW;QACxB,UAAA,kBAACC,GAAD,CAAc,CAAA;OACD,CAAA,GACf,kBAACC,GAAD,EAAA,UACGzC,EAAe,KAAK,MACnB,kBAAC0C,GAAD;QAA+B,OAAOG,EAAO;QAC1C,UAAAA,EAAO;OACE,GAFKA,EAAO,KAEZ,CACb,EACY,CAAA,CACT;MACH,CAAA,CAAA;;IACJ;;GAEL,kBAAC,SAAD;IAAO,WAAU;IAAjB,UAAA,CACE,kBAAC,QAAD;KAAM,WAAU;KAAgC,UAAA;IAAa,CAAA,GAC7D,kBAACD,GAAD;KACE,OAAO1B,EAAK;KACZ,WAAW,MAAMG,EAAS,WAAW,EAAE,OAAO,KAAK;KACnD,aAAY;IACb,CAAA,CACI;;GAEP,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAC,SAAD;KAAO,WAAU;KAAjB,UAAA,CACE,kBAAC,QAAD;MAAM,WAAU;MAAgC,UAAA;KAAkB,CAAA,GAClE,kBAACuB,GAAD;MAAO,OAAO1B,EAAK;MAAa,WAAW,MAAMG,EAAS,eAAe,EAAE,OAAO,KAAK;KAAI,CAAA,CACtF;IACP,CAAA,GAAA,kBAAC,SAAD;KAAO,WAAU;KAAjB,UAAA,CACE,kBAAC,QAAD;MAAM,WAAU;MAAgC,UAAA;KAAmB,CAAA,GACnE,kBAACuB,GAAD;MAAO,MAAK;MAAQ,OAAO1B,EAAK;MAAc,WAAW,MAAMG,EAAS,gBAAgB,EAAE,OAAO,KAAK;KAAI,CAAA,CACrG;IACJ,CAAA,CAAA;;EACU;;AAErB"}
|
|
@@ -1,22 +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
|
-
|
|
16
|
-
let t = e?.website;
|
|
14
|
+
function A(e) {
|
|
15
|
+
if (e.website?.trim()) return e.website;
|
|
16
|
+
let t = e.metadata?.website;
|
|
17
17
|
return typeof t == "string" && t.trim() ? t : null;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function j(e) {
|
|
20
20
|
let t = e.toLowerCase();
|
|
21
21
|
return [
|
|
22
22
|
"confirmed",
|
|
@@ -32,151 +32,151 @@ function M(e) {
|
|
|
32
32
|
"draft"
|
|
33
33
|
].includes(t) ? "info" : "secondary";
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
return /* @__PURE__ */
|
|
35
|
+
function M({ label: e, value: t, loading: n }) {
|
|
36
|
+
return /* @__PURE__ */ g("div", {
|
|
37
37
|
className: "flex items-baseline gap-1.5",
|
|
38
|
-
children: [/* @__PURE__ */
|
|
38
|
+
children: [/* @__PURE__ */ h("span", {
|
|
39
39
|
className: "text-xl font-bold tabular-nums text-text-primary",
|
|
40
40
|
children: n ? "—" : t.toLocaleString()
|
|
41
|
-
}), /* @__PURE__ */
|
|
41
|
+
}), /* @__PURE__ */ h("span", {
|
|
42
42
|
className: "text-sm text-text-secondary",
|
|
43
43
|
children: e
|
|
44
44
|
})]
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
let { navigate:
|
|
49
|
-
search:
|
|
50
|
-
limit:
|
|
51
|
-
offset:
|
|
52
|
-
}),
|
|
53
|
-
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,
|
|
54
54
|
offset: 0
|
|
55
|
-
}), H =
|
|
56
|
-
limit:
|
|
55
|
+
}), V = t(), H = r({
|
|
56
|
+
limit: 1,
|
|
57
57
|
offset: 0
|
|
58
|
-
}), [U] = e(), [W, G] =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}, [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
booths: t.size,
|
|
68
|
-
leads: H.data?.leads?.total ?? 0
|
|
69
|
-
};
|
|
70
|
-
}, [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) => {
|
|
71
67
|
try {
|
|
72
68
|
let t = await U({ variables: { id: e.id } }), n = t.data?.deleteExhibitor === !0;
|
|
73
|
-
if (!
|
|
74
|
-
|
|
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
|
+
]);
|
|
75
75
|
} catch (e) {
|
|
76
|
-
|
|
76
|
+
d.error("Could not delete exhibitor", l(e));
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
|
-
return /* @__PURE__ */
|
|
79
|
+
return /* @__PURE__ */ g("div", {
|
|
80
80
|
className: "space-y-6 p-6",
|
|
81
81
|
children: [
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
/* @__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, {
|
|
84
84
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
85
|
-
children: [/* @__PURE__ */
|
|
85
|
+
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h1", {
|
|
86
86
|
className: "text-2xl font-bold text-text-primary",
|
|
87
87
|
children: "Exhibitors"
|
|
88
|
-
}), /* @__PURE__ */
|
|
88
|
+
}), /* @__PURE__ */ h("p", {
|
|
89
89
|
className: "mt-1 text-sm text-text-secondary",
|
|
90
90
|
children: "Manage booth exhibitors and capture floor leads from live backend data."
|
|
91
|
-
})] }), /* @__PURE__ */
|
|
91
|
+
})] }), /* @__PURE__ */ g(C, {
|
|
92
92
|
type: "button",
|
|
93
|
-
onClick: () =>
|
|
94
|
-
children: [/* @__PURE__ */
|
|
93
|
+
onClick: () => N("/exhibitors/create"),
|
|
94
|
+
children: [/* @__PURE__ */ h(v, { className: "h-4 w-4" }), "New Exhibitor"]
|
|
95
95
|
})]
|
|
96
96
|
}),
|
|
97
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ g("div", {
|
|
98
98
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
99
|
-
children: [/* @__PURE__ */
|
|
99
|
+
children: [/* @__PURE__ */ g("div", {
|
|
100
100
|
className: "flex flex-wrap items-center gap-x-5 gap-y-1",
|
|
101
101
|
children: [
|
|
102
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ h(M, {
|
|
103
103
|
label: "exhibitors",
|
|
104
|
-
value:
|
|
105
|
-
loading:
|
|
104
|
+
value: J.exhibitors,
|
|
105
|
+
loading: Y
|
|
106
106
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ h("span", {
|
|
108
108
|
className: "text-border-strong",
|
|
109
109
|
"aria-hidden": "true",
|
|
110
110
|
children: "·"
|
|
111
111
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ h(M, {
|
|
113
113
|
label: "booths",
|
|
114
|
-
value:
|
|
115
|
-
loading:
|
|
114
|
+
value: J.booths,
|
|
115
|
+
loading: Y
|
|
116
116
|
}),
|
|
117
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ h("span", {
|
|
118
118
|
className: "text-border-strong",
|
|
119
119
|
"aria-hidden": "true",
|
|
120
120
|
children: "·"
|
|
121
121
|
}),
|
|
122
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ h(M, {
|
|
123
123
|
label: "leads",
|
|
124
|
-
value:
|
|
125
|
-
loading:
|
|
124
|
+
value: J.leads,
|
|
125
|
+
loading: Y
|
|
126
126
|
})
|
|
127
127
|
]
|
|
128
|
-
}), /* @__PURE__ */
|
|
128
|
+
}), /* @__PURE__ */ g("div", {
|
|
129
129
|
className: "relative sm:w-72",
|
|
130
|
-
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, {
|
|
131
131
|
type: "text",
|
|
132
|
-
value:
|
|
133
|
-
onChange: (e) =>
|
|
132
|
+
value: P,
|
|
133
|
+
onChange: (e) => F(e.target.value),
|
|
134
134
|
placeholder: "Search exhibitors by name or booth",
|
|
135
135
|
"aria-label": "Search exhibitors by name or booth",
|
|
136
136
|
className: "pl-10"
|
|
137
137
|
})]
|
|
138
138
|
})]
|
|
139
139
|
}),
|
|
140
|
-
|
|
140
|
+
R && K.length === 0 ? /* @__PURE__ */ h(T, {
|
|
141
141
|
treatment: "plain",
|
|
142
142
|
className: "border-border-seam p-8 text-center text-sm text-text-secondary",
|
|
143
143
|
children: "Loading exhibitors..."
|
|
144
|
-
}) : K.length === 0 ? /* @__PURE__ */
|
|
144
|
+
}) : K.length === 0 ? /* @__PURE__ */ h(T, {
|
|
145
145
|
treatment: "plain",
|
|
146
146
|
className: "border-border-seam",
|
|
147
|
-
children: /* @__PURE__ */
|
|
148
|
-
illustration:
|
|
149
|
-
title:
|
|
150
|
-
description:
|
|
151
|
-
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, {
|
|
152
152
|
type: "button",
|
|
153
|
-
onClick: () =>
|
|
154
|
-
children: [/* @__PURE__ */
|
|
153
|
+
onClick: () => N("/exhibitors/create"),
|
|
154
|
+
children: [/* @__PURE__ */ h(v, { className: "h-4 w-4" }), "New Exhibitor"]
|
|
155
155
|
})
|
|
156
156
|
})
|
|
157
|
-
}) : /* @__PURE__ */
|
|
157
|
+
}) : /* @__PURE__ */ h(T, {
|
|
158
158
|
treatment: "plain",
|
|
159
159
|
className: "overflow-hidden border-border-seam p-0",
|
|
160
|
-
children: /* @__PURE__ */
|
|
160
|
+
children: /* @__PURE__ */ h(k, {
|
|
161
161
|
columns: [
|
|
162
162
|
{
|
|
163
163
|
key: "company",
|
|
164
164
|
header: "Company",
|
|
165
165
|
priority: "primary",
|
|
166
166
|
cell: (e) => {
|
|
167
|
-
let t =
|
|
168
|
-
return /* @__PURE__ */
|
|
167
|
+
let t = A(e);
|
|
168
|
+
return /* @__PURE__ */ g("div", {
|
|
169
169
|
className: "min-w-0",
|
|
170
|
-
children: [/* @__PURE__ */
|
|
170
|
+
children: [/* @__PURE__ */ h("p", {
|
|
171
171
|
className: "truncate font-medium text-text-primary",
|
|
172
172
|
children: e.name
|
|
173
|
-
}), /* @__PURE__ */
|
|
173
|
+
}), /* @__PURE__ */ g("p", {
|
|
174
174
|
className: "truncate text-sm text-text-secondary",
|
|
175
|
-
children: [e.contactName ? e.contactName : "No contact set", t ? /* @__PURE__ */
|
|
175
|
+
children: [e.contactName ? e.contactName : "No contact set", t ? /* @__PURE__ */ g(s, {
|
|
176
176
|
href: t,
|
|
177
177
|
className: "ml-2 inline-flex items-center gap-1 text-text-link hover:underline",
|
|
178
178
|
fallbackClassName: "text-text-secondary",
|
|
179
|
-
children: [/* @__PURE__ */
|
|
179
|
+
children: [/* @__PURE__ */ h(_, { className: "h-3.5 w-3.5" }), "Website"]
|
|
180
180
|
}) : null]
|
|
181
181
|
})]
|
|
182
182
|
});
|
|
@@ -187,10 +187,10 @@ function P() {
|
|
|
187
187
|
header: "Booth",
|
|
188
188
|
priority: "secondary",
|
|
189
189
|
mobileLabel: "Booth",
|
|
190
|
-
cell: (e) => e.boothCode ? /* @__PURE__ */
|
|
190
|
+
cell: (e) => e.boothCode ? /* @__PURE__ */ g("span", {
|
|
191
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",
|
|
192
|
-
children: [/* @__PURE__ */
|
|
193
|
-
}) : /* @__PURE__ */
|
|
192
|
+
children: [/* @__PURE__ */ h(b, { className: "h-3.5 w-3.5 text-text-muted" }), e.boothCode]
|
|
193
|
+
}) : /* @__PURE__ */ h("span", {
|
|
194
194
|
className: "text-sm text-text-muted",
|
|
195
195
|
children: "—"
|
|
196
196
|
})
|
|
@@ -200,10 +200,10 @@ function P() {
|
|
|
200
200
|
header: "Category",
|
|
201
201
|
priority: "secondary",
|
|
202
202
|
mobileLabel: "Category",
|
|
203
|
-
cell: (e) => e.category ? /* @__PURE__ */
|
|
203
|
+
cell: (e) => e.category ? /* @__PURE__ */ h(S, {
|
|
204
204
|
variant: "outline",
|
|
205
205
|
children: e.category
|
|
206
|
-
}) : /* @__PURE__ */
|
|
206
|
+
}) : /* @__PURE__ */ h("span", {
|
|
207
207
|
className: "text-sm text-text-muted",
|
|
208
208
|
children: "—"
|
|
209
209
|
})
|
|
@@ -213,8 +213,8 @@ function P() {
|
|
|
213
213
|
header: "Status",
|
|
214
214
|
priority: "primary",
|
|
215
215
|
mobileLabel: "Status",
|
|
216
|
-
cell: (e) => /* @__PURE__ */
|
|
217
|
-
variant:
|
|
216
|
+
cell: (e) => /* @__PURE__ */ h(S, {
|
|
217
|
+
variant: j(e.status),
|
|
218
218
|
className: "uppercase",
|
|
219
219
|
children: e.status
|
|
220
220
|
})
|
|
@@ -225,10 +225,10 @@ function P() {
|
|
|
225
225
|
priority: "primary",
|
|
226
226
|
mobileLabel: "Leads",
|
|
227
227
|
cell: (e) => {
|
|
228
|
-
let t =
|
|
229
|
-
return /* @__PURE__ */
|
|
228
|
+
let t = e.leadCount ?? 0;
|
|
229
|
+
return /* @__PURE__ */ g("span", {
|
|
230
230
|
className: "inline-flex items-center gap-1.5 text-sm text-text-secondary",
|
|
231
|
-
children: [/* @__PURE__ */
|
|
231
|
+
children: [/* @__PURE__ */ h("span", {
|
|
232
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"}`,
|
|
233
233
|
children: t
|
|
234
234
|
}), "leads"]
|
|
@@ -238,31 +238,31 @@ function P() {
|
|
|
238
238
|
],
|
|
239
239
|
data: K,
|
|
240
240
|
rowKey: (e) => e.id,
|
|
241
|
-
rowActions: (e) => /* @__PURE__ */
|
|
241
|
+
rowActions: (e) => /* @__PURE__ */ h(i, {
|
|
242
242
|
ariaLabel: `${e.name} actions`,
|
|
243
243
|
entityName: e.name,
|
|
244
|
-
onEdit: () =>
|
|
245
|
-
onDelete: () =>
|
|
244
|
+
onEdit: () => N(`/exhibitors/${e.id}/edit`),
|
|
245
|
+
onDelete: () => X(e),
|
|
246
246
|
extraItems: [{
|
|
247
247
|
key: "add-lead",
|
|
248
248
|
label: "Add lead",
|
|
249
|
-
icon:
|
|
249
|
+
icon: x,
|
|
250
250
|
onSelect: () => G(e)
|
|
251
251
|
}]
|
|
252
252
|
})
|
|
253
253
|
})
|
|
254
254
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
-
offset:
|
|
257
|
-
limit:
|
|
255
|
+
/* @__PURE__ */ h(a, {
|
|
256
|
+
offset: I.offset,
|
|
257
|
+
limit: I.limit,
|
|
258
258
|
loadedCount: K.length,
|
|
259
259
|
total: q,
|
|
260
|
-
onPrev:
|
|
261
|
-
onNext:
|
|
260
|
+
onPrev: I.prevPage,
|
|
261
|
+
onNext: I.nextPage,
|
|
262
262
|
itemLabel: "exhibitors",
|
|
263
|
-
loading:
|
|
263
|
+
loading: R
|
|
264
264
|
}),
|
|
265
|
-
W ? /* @__PURE__ */
|
|
265
|
+
W ? /* @__PURE__ */ h(f, {
|
|
266
266
|
open: !!W,
|
|
267
267
|
onOpenChange: (e) => {
|
|
268
268
|
e || G(null);
|
|
@@ -271,12 +271,12 @@ function P() {
|
|
|
271
271
|
exhibitorId: W.id,
|
|
272
272
|
contextLabel: W.name,
|
|
273
273
|
onCreated: () => {
|
|
274
|
-
H.refetch();
|
|
274
|
+
H.refetch(), z();
|
|
275
275
|
}
|
|
276
276
|
}) : null
|
|
277
277
|
]
|
|
278
278
|
});
|
|
279
279
|
}
|
|
280
|
-
export {
|
|
280
|
+
export { N as default };
|
|
281
281
|
|
|
282
282
|
//# sourceMappingURL=ExhibitorsPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExhibitorsPage.js","names":["Badge","Badge$1","SUMMARY_FETCH","LEADS_FETCH","readWebsite","value","metadata","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","exhibitor","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 status: string;\n metadata?: Record<string, unknown> | null;\n};\n\nconst SUMMARY_FETCH = 200;\nconst LEADS_FETCH = 500;\n\nfunction readWebsite(metadata: Record<string, unknown> | null | undefined): string | null {\n const value = 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.metadata);\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":";;;;;;;;;;;;;AAmCA,IAAME,IAAgB,KAChBC,IAAc;AAEpB,SAASC,EAAY,GAAqE;CACxF,IAAMC,IAAQC,GAAU;CACxB,OAAO,OAAOD,KAAU,YAAYA,EAAM,KAAK,IAAIA,IAAQ;AAC7D;AAEA,SAASE,EAAc,GAA8D;CACnF,IAAMF,IAAQG,EAAO,YAAY;CAUjC,OATI;EAAC;EAAa;EAAU;CAAU,CAAC,CAAC,SAASH,CAAK,IAC7C,YAEL;EAAC;EAAa;EAAY;CAAS,CAAC,CAAC,SAASA,CAAK,IAC9C,YAEL;EAAC;EAAW;EAAW;CAAO,CAAC,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+GACTI,IAAQ,IAAI,kDAAkD;UAG/D,UAAAA;SACG,CAAA,GAAC,OAEH;;OAEV;MACF;KA4EiB;KACT,MAAMrC;KACN,SAAS,MAAQiC,EAAI;KACrB,aAAa,MACX,kBAACK,GAAD;MACE,WAAW,GAAGL,EAAI,KAAK;MACvB,YAAYA,EAAI;MAChB,cAAcT,EAAS,eAAeS,EAAI,GAAG,MAAM;MACnD,gBAAgBrB,EAASqB,CAAG;MAC5B,YAAY,CACV;OACE,KAAK;OACL,OAAO;OACP,MAAMM;OACN,gBAAgBxC,EAAckC,CAAG;MACnC,CACF;KACD,CAAA;IAEJ,CAAA;GACQ,CAAA;GAGb,kBAACO,GAAD;IACE,QAAQlD,EAAW;IACnB,OAAOA,EAAW;IAClB,aAAaU,EAAW;IACjB;IACP,QAAQV,EAAW;IACnB,QAAQA,EAAW;IACnB,WAAU;IACD;GACV,CAAA;GAEAQ,IACC,kBAAC2C,GAAD;IACE,MAAM,EAAQ3C;IACd,eAAe,MAAS;KACtB,AAAK4C,KACH3C,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":";;;;;;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