@burdenoff/microfe-eventfullymanaged 2026.625.1 → 2026.703.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eventfullymanaged/api/eventApi.js +83 -38
- package/dist/eventfullymanaged/api/eventApi.js.map +1 -1
- package/dist/eventfullymanaged/components/ImageUploadField.js +98 -0
- package/dist/eventfullymanaged/components/ImageUploadField.js.map +1 -0
- package/dist/eventfullymanaged/lib/mutationResult.js +12 -0
- package/dist/eventfullymanaged/lib/mutationResult.js.map +1 -0
- package/dist/eventfullymanaged/lib/toast.js +36 -0
- package/dist/eventfullymanaged/lib/toast.js.map +1 -0
- package/dist/eventfullymanaged/pages/dashboard/DashboardPage.js +88 -47
- package/dist/eventfullymanaged/pages/dashboard/DashboardPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/AnalyticsPage.js +63 -51
- package/dist/eventfullymanaged/pages/modules/AnalyticsPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/AttendeeProfilePage.js +137 -78
- package/dist/eventfullymanaged/pages/modules/AttendeeProfilePage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/CommunicationPage.js +56 -45
- package/dist/eventfullymanaged/pages/modules/CommunicationPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/EventsPage.js +89 -52
- package/dist/eventfullymanaged/pages/modules/EventsPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/KioskPage.js +11 -10
- package/dist/eventfullymanaged/pages/modules/KioskPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/NetworkingPage.js +73 -24
- package/dist/eventfullymanaged/pages/modules/NetworkingPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/OperationsHubPage.js +135 -105
- package/dist/eventfullymanaged/pages/modules/OperationsHubPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/RegistrationPage.js +63 -33
- package/dist/eventfullymanaged/pages/modules/RegistrationPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/SponsorDetailsPage.js +132 -77
- package/dist/eventfullymanaged/pages/modules/SponsorDetailsPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/SponsorLeadsPage.js +54 -23
- package/dist/eventfullymanaged/pages/modules/SponsorLeadsPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/VenueResourcesPage.js +67 -37
- package/dist/eventfullymanaged/pages/modules/VenueResourcesPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/WorkflowsPage.js +81 -48
- package/dist/eventfullymanaged/pages/modules/WorkflowsPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/sponsors/SponsorFormPage.js +161 -133
- package/dist/eventfullymanaged/pages/sponsors/SponsorFormPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/sponsors/SponsorsListPage.js +22 -21
- package/dist/eventfullymanaged/pages/sponsors/SponsorsListPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/venues/FloorPlansPage.js +103 -61
- package/dist/eventfullymanaged/pages/venues/FloorPlansPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/venues/VenueDetailPage.js +67 -38
- package/dist/eventfullymanaged/pages/venues/VenueDetailPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/venues/VenueFormPage.js +156 -147
- package/dist/eventfullymanaged/pages/venues/VenueFormPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/venues/VenueListPage.js +23 -22
- package/dist/eventfullymanaged/pages/venues/VenueListPage.js.map +1 -1
- package/dist/node_modules/@apollo/client/react/context/ApolloContext.js.map +1 -1
- package/dist/node_modules/@apollo/client/react/hooks/internal/useDeepMemo.js.map +1 -1
- package/dist/node_modules/@apollo/client/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
- package/dist/node_modules/@apollo/client/react/hooks/internal/wrapHook.js.map +1 -1
- package/dist/node_modules/@apollo/client/react/hooks/useApolloClient.js.map +1 -1
- package/dist/node_modules/@apollo/client/react/hooks/useMutation.js.map +1 -1
- package/dist/node_modules/@apollo/client/react/hooks/useQuery.js.map +1 -1
- package/dist/node_modules/@apollo/client/react/hooks/useSyncExternalStore.js.map +1 -1
- package/dist/node_modules/sonner/dist/index.js +163 -0
- package/dist/node_modules/sonner/dist/index.js.map +1 -0
- package/package.json +2 -2
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { useEventfullyManaged as e } from "../../context/EventfullyManagedContext.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import { notify as t } from "../../lib/toast.js";
|
|
3
|
+
import { useCreateSponsorMutation as n, useEventsQuery as r, useSponsorsQuery as i, useUpdateSponsorMutation as a } from "../../api/eventApi.js";
|
|
4
|
+
import { describeError as o, mutationSucceeded as s } from "../../lib/mutationResult.js";
|
|
5
|
+
import { ImageUploadField as c } from "../../components/ImageUploadField.js";
|
|
6
|
+
import { useEffect as l, useMemo as u, useState as d } from "react";
|
|
7
|
+
import { useParams as f } from "react-router-dom";
|
|
8
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
9
|
+
import { ArrowLeft as h, Save as g } from "lucide-react";
|
|
10
|
+
import { Button as _, EmphasisPanel as v, Input as y, PagePurpose as b } from "@burdenoff/fe-libs/ui";
|
|
8
11
|
//#region src/eventfullymanaged/pages/sponsors/SponsorFormPage.tsx
|
|
9
|
-
var
|
|
12
|
+
var x = {
|
|
10
13
|
eventId: "",
|
|
11
14
|
name: "",
|
|
12
15
|
level: "BRONZE",
|
|
16
|
+
logoUrl: "",
|
|
13
17
|
website: "",
|
|
14
18
|
contactName: "",
|
|
15
19
|
contactEmail: "",
|
|
@@ -17,239 +21,263 @@ var g = {
|
|
|
17
21
|
value: "0",
|
|
18
22
|
leads: "0"
|
|
19
23
|
};
|
|
20
|
-
function
|
|
21
|
-
let { id:
|
|
24
|
+
function S() {
|
|
25
|
+
let { id: S = "" } = f(), C = u(() => !!S, [S]), { navigate: w } = e(), { data: T } = r({
|
|
22
26
|
limit: 100,
|
|
23
27
|
offset: 0
|
|
24
|
-
}), { data:
|
|
28
|
+
}), { data: E } = i({
|
|
25
29
|
limit: 100,
|
|
26
30
|
offset: 0
|
|
27
|
-
}),
|
|
28
|
-
eventId:
|
|
29
|
-
name:
|
|
30
|
-
level:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
31
|
+
}), D = u(() => (E?.sponsors?.items ?? []).find((e) => e.id === S), [S, E]), [O, { loading: k }] = n(), [A, { loading: j }] = a(), [M, N] = d(() => D ? {
|
|
32
|
+
eventId: D.eventId ?? "",
|
|
33
|
+
name: D.name ?? "",
|
|
34
|
+
level: D.level ?? "BRONZE",
|
|
35
|
+
logoUrl: D.logoUrl ?? "",
|
|
36
|
+
website: D.website ?? "",
|
|
37
|
+
contactName: D.contactName ?? "",
|
|
38
|
+
contactEmail: D.contactEmail ?? "",
|
|
39
|
+
contactPhone: D.contactPhone ?? "",
|
|
40
|
+
value: String(D.metrics?.value ?? 0),
|
|
41
|
+
leads: String(D.metrics?.leads ?? 0)
|
|
42
|
+
} : x);
|
|
43
|
+
l(() => {
|
|
44
|
+
D && N({
|
|
45
|
+
eventId: D.eventId ?? "",
|
|
46
|
+
name: D.name ?? "",
|
|
47
|
+
level: D.level ?? "BRONZE",
|
|
48
|
+
logoUrl: D.logoUrl ?? "",
|
|
49
|
+
website: D.website ?? "",
|
|
50
|
+
contactName: D.contactName ?? "",
|
|
51
|
+
contactEmail: D.contactEmail ?? "",
|
|
52
|
+
contactPhone: D.contactPhone ?? "",
|
|
53
|
+
value: String(D.metrics?.value ?? 0),
|
|
54
|
+
leads: String(D.metrics?.leads ?? 0)
|
|
49
55
|
});
|
|
50
|
-
}, [
|
|
51
|
-
let
|
|
52
|
-
|
|
56
|
+
}, [D]);
|
|
57
|
+
let P = (e, t) => {
|
|
58
|
+
N((n) => ({
|
|
53
59
|
...n,
|
|
54
60
|
[e]: t
|
|
55
61
|
}));
|
|
56
|
-
},
|
|
62
|
+
}, F = async (e) => {
|
|
57
63
|
e.preventDefault();
|
|
58
|
-
let
|
|
59
|
-
eventId:
|
|
60
|
-
name:
|
|
61
|
-
level:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
let n = {
|
|
65
|
+
eventId: M.eventId,
|
|
66
|
+
name: M.name,
|
|
67
|
+
level: M.level,
|
|
68
|
+
logoUrl: M.logoUrl,
|
|
69
|
+
website: M.website,
|
|
70
|
+
contactName: M.contactName,
|
|
71
|
+
contactEmail: M.contactEmail,
|
|
72
|
+
contactPhone: M.contactPhone,
|
|
66
73
|
metrics: {
|
|
67
|
-
value: Number(
|
|
68
|
-
leads: Number(
|
|
74
|
+
value: Number(M.value || 0),
|
|
75
|
+
leads: Number(M.leads || 0)
|
|
69
76
|
},
|
|
70
77
|
metadata: {}
|
|
71
78
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
try {
|
|
80
|
+
if (C) {
|
|
81
|
+
let e = await A({ variables: {
|
|
82
|
+
id: S,
|
|
83
|
+
input: n
|
|
84
|
+
} });
|
|
85
|
+
if (!s(e, e.data?.updateSponsor?.id, "Could not update sponsor")) return;
|
|
86
|
+
w("/sponsors");
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
let e = await O({ variables: { input: n } });
|
|
90
|
+
if (!s(e, e.data?.createSponsor?.id, "Could not create sponsor")) return;
|
|
91
|
+
w("/sponsors");
|
|
92
|
+
} catch (e) {
|
|
93
|
+
t.error("Could not save sponsor", o(e));
|
|
78
94
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return /* @__PURE__ */ u("div", {
|
|
95
|
+
}, I = k || j, L = T?.events?.items ?? [], R = "w-full rounded-input border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary transition-colors focus-visible:border-border-focus focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus)] focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]";
|
|
96
|
+
return /* @__PURE__ */ m("div", {
|
|
82
97
|
className: "space-y-6 p-6",
|
|
83
|
-
children: [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
children: /* @__PURE__ */
|
|
96
|
-
onSubmit:
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m(_, {
|
|
100
|
+
type: "button",
|
|
101
|
+
variant: "ghost",
|
|
102
|
+
size: "sm",
|
|
103
|
+
onClick: () => w("/sponsors"),
|
|
104
|
+
children: [/* @__PURE__ */ p(h, { className: "h-4 w-4" }), "Back to Sponsors"]
|
|
105
|
+
}), /* @__PURE__ */ p("h1", {
|
|
106
|
+
className: "mt-3 text-2xl font-bold text-text-primary",
|
|
107
|
+
children: C ? "Edit Sponsor" : "Create Sponsor"
|
|
108
|
+
})] }),
|
|
109
|
+
/* @__PURE__ */ p(b, { children: "Capture a sponsor and the deal behind it. Link them to an event, set their tier, and record the contract value and leads target so you can measure ROI later. The contact fields are who you will work with day to day, so keep them accurate." }),
|
|
110
|
+
/* @__PURE__ */ p(v, { children: /* @__PURE__ */ m("form", {
|
|
111
|
+
onSubmit: F,
|
|
97
112
|
className: "space-y-4",
|
|
98
113
|
children: [
|
|
99
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ m("div", {
|
|
100
115
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
101
|
-
children: [/* @__PURE__ */
|
|
116
|
+
children: [/* @__PURE__ */ m("label", {
|
|
102
117
|
className: "space-y-1 text-sm",
|
|
103
|
-
children: [/* @__PURE__ */
|
|
118
|
+
children: [/* @__PURE__ */ p("span", {
|
|
104
119
|
className: "font-medium text-text-primary",
|
|
105
120
|
children: "Event"
|
|
106
|
-
}), /* @__PURE__ */
|
|
107
|
-
value:
|
|
108
|
-
onChange: (e) =>
|
|
121
|
+
}), /* @__PURE__ */ m("select", {
|
|
122
|
+
value: M.eventId,
|
|
123
|
+
onChange: (e) => P("eventId", e.target.value),
|
|
109
124
|
required: !0,
|
|
110
|
-
className:
|
|
111
|
-
children: [/* @__PURE__ */
|
|
125
|
+
className: R,
|
|
126
|
+
children: [/* @__PURE__ */ p("option", {
|
|
112
127
|
value: "",
|
|
113
128
|
children: "Select Event"
|
|
114
|
-
}),
|
|
129
|
+
}), L.map((e) => /* @__PURE__ */ p("option", {
|
|
115
130
|
value: e.id,
|
|
116
131
|
children: e.name
|
|
117
132
|
}, e.id))]
|
|
118
133
|
})]
|
|
119
|
-
}), /* @__PURE__ */
|
|
134
|
+
}), /* @__PURE__ */ m("label", {
|
|
120
135
|
className: "space-y-1 text-sm",
|
|
121
|
-
children: [/* @__PURE__ */
|
|
136
|
+
children: [/* @__PURE__ */ p("span", {
|
|
122
137
|
className: "font-medium text-text-primary",
|
|
123
138
|
children: "Sponsor Name"
|
|
124
|
-
}), /* @__PURE__ */
|
|
125
|
-
value:
|
|
126
|
-
onChange: (e) =>
|
|
139
|
+
}), /* @__PURE__ */ p(y, {
|
|
140
|
+
value: M.name,
|
|
141
|
+
onChange: (e) => P("name", e.target.value),
|
|
127
142
|
required: !0
|
|
128
143
|
})]
|
|
129
144
|
})]
|
|
130
145
|
}),
|
|
131
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ m("div", {
|
|
132
147
|
className: "grid grid-cols-1 gap-4 md:grid-cols-3",
|
|
133
148
|
children: [
|
|
134
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ m("label", {
|
|
135
150
|
className: "space-y-1 text-sm",
|
|
136
|
-
children: [/* @__PURE__ */
|
|
151
|
+
children: [/* @__PURE__ */ p("span", {
|
|
137
152
|
className: "font-medium text-text-primary",
|
|
138
153
|
children: "Level"
|
|
139
|
-
}), /* @__PURE__ */
|
|
140
|
-
value:
|
|
141
|
-
onChange: (e) =>
|
|
142
|
-
className:
|
|
154
|
+
}), /* @__PURE__ */ m("select", {
|
|
155
|
+
value: M.level,
|
|
156
|
+
onChange: (e) => P("level", e.target.value),
|
|
157
|
+
className: R,
|
|
143
158
|
children: [
|
|
144
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ p("option", {
|
|
145
160
|
value: "PLATINUM",
|
|
146
161
|
children: "Platinum"
|
|
147
162
|
}),
|
|
148
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ p("option", {
|
|
149
164
|
value: "GOLD",
|
|
150
165
|
children: "Gold"
|
|
151
166
|
}),
|
|
152
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ p("option", {
|
|
153
168
|
value: "SILVER",
|
|
154
169
|
children: "Silver"
|
|
155
170
|
}),
|
|
156
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ p("option", {
|
|
157
172
|
value: "BRONZE",
|
|
158
173
|
children: "Bronze"
|
|
159
174
|
}),
|
|
160
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ p("option", {
|
|
161
176
|
value: "COMMUNITY",
|
|
162
177
|
children: "Community"
|
|
163
178
|
})
|
|
164
179
|
]
|
|
165
180
|
})]
|
|
166
181
|
}),
|
|
167
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ m("label", {
|
|
168
183
|
className: "space-y-1 text-sm",
|
|
169
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ p("span", {
|
|
170
185
|
className: "font-medium text-text-primary",
|
|
171
186
|
children: "Value"
|
|
172
|
-
}), /* @__PURE__ */
|
|
187
|
+
}), /* @__PURE__ */ p(y, {
|
|
173
188
|
type: "number",
|
|
174
189
|
min: "0",
|
|
175
|
-
value:
|
|
176
|
-
onChange: (e) =>
|
|
190
|
+
value: M.value,
|
|
191
|
+
onChange: (e) => P("value", e.target.value)
|
|
177
192
|
})]
|
|
178
193
|
}),
|
|
179
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ m("label", {
|
|
180
195
|
className: "space-y-1 text-sm",
|
|
181
|
-
children: [/* @__PURE__ */
|
|
196
|
+
children: [/* @__PURE__ */ p("span", {
|
|
182
197
|
className: "font-medium text-text-primary",
|
|
183
198
|
children: "Leads"
|
|
184
|
-
}), /* @__PURE__ */
|
|
199
|
+
}), /* @__PURE__ */ p(y, {
|
|
185
200
|
type: "number",
|
|
186
201
|
min: "0",
|
|
187
|
-
value:
|
|
188
|
-
onChange: (e) =>
|
|
202
|
+
value: M.leads,
|
|
203
|
+
onChange: (e) => P("leads", e.target.value)
|
|
189
204
|
})]
|
|
190
205
|
})
|
|
191
206
|
]
|
|
192
207
|
}),
|
|
193
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ m("label", {
|
|
194
209
|
className: "block space-y-1 text-sm",
|
|
195
|
-
children: [/* @__PURE__ */
|
|
210
|
+
children: [/* @__PURE__ */ p("span", {
|
|
196
211
|
className: "font-medium text-text-primary",
|
|
197
212
|
children: "Website"
|
|
198
|
-
}), /* @__PURE__ */
|
|
199
|
-
value:
|
|
200
|
-
onChange: (e) =>
|
|
213
|
+
}), /* @__PURE__ */ p(y, {
|
|
214
|
+
value: M.website,
|
|
215
|
+
onChange: (e) => P("website", e.target.value)
|
|
201
216
|
})]
|
|
202
217
|
}),
|
|
203
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ m("div", {
|
|
219
|
+
className: "space-y-1 text-sm",
|
|
220
|
+
children: [/* @__PURE__ */ p("span", {
|
|
221
|
+
className: "font-medium text-text-primary",
|
|
222
|
+
children: "Logo"
|
|
223
|
+
}), /* @__PURE__ */ p(c, {
|
|
224
|
+
label: "Upload logo",
|
|
225
|
+
folderPath: "/EventfullyManaged/Sponsors",
|
|
226
|
+
value: M.logoUrl || null,
|
|
227
|
+
onUploaded: (e) => P("logoUrl", e),
|
|
228
|
+
hint: "Stored securely in Files. Shown across sponsor listings and detail pages."
|
|
229
|
+
})]
|
|
230
|
+
}),
|
|
231
|
+
/* @__PURE__ */ m("div", {
|
|
204
232
|
className: "grid grid-cols-1 gap-4 md:grid-cols-3",
|
|
205
233
|
children: [
|
|
206
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ m("label", {
|
|
207
235
|
className: "space-y-1 text-sm",
|
|
208
|
-
children: [/* @__PURE__ */
|
|
236
|
+
children: [/* @__PURE__ */ p("span", {
|
|
209
237
|
className: "font-medium text-text-primary",
|
|
210
238
|
children: "Contact Name"
|
|
211
|
-
}), /* @__PURE__ */
|
|
212
|
-
value:
|
|
213
|
-
onChange: (e) =>
|
|
239
|
+
}), /* @__PURE__ */ p(y, {
|
|
240
|
+
value: M.contactName,
|
|
241
|
+
onChange: (e) => P("contactName", e.target.value)
|
|
214
242
|
})]
|
|
215
243
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ m("label", {
|
|
217
245
|
className: "space-y-1 text-sm",
|
|
218
|
-
children: [/* @__PURE__ */
|
|
246
|
+
children: [/* @__PURE__ */ p("span", {
|
|
219
247
|
className: "font-medium text-text-primary",
|
|
220
248
|
children: "Contact Email"
|
|
221
|
-
}), /* @__PURE__ */
|
|
249
|
+
}), /* @__PURE__ */ p(y, {
|
|
222
250
|
type: "email",
|
|
223
|
-
value:
|
|
224
|
-
onChange: (e) =>
|
|
251
|
+
value: M.contactEmail,
|
|
252
|
+
onChange: (e) => P("contactEmail", e.target.value)
|
|
225
253
|
})]
|
|
226
254
|
}),
|
|
227
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ m("label", {
|
|
228
256
|
className: "space-y-1 text-sm",
|
|
229
|
-
children: [/* @__PURE__ */
|
|
257
|
+
children: [/* @__PURE__ */ p("span", {
|
|
230
258
|
className: "font-medium text-text-primary",
|
|
231
259
|
children: "Contact Phone"
|
|
232
|
-
}), /* @__PURE__ */
|
|
233
|
-
value:
|
|
234
|
-
onChange: (e) =>
|
|
260
|
+
}), /* @__PURE__ */ p(y, {
|
|
261
|
+
value: M.contactPhone,
|
|
262
|
+
onChange: (e) => P("contactPhone", e.target.value)
|
|
235
263
|
})]
|
|
236
264
|
})
|
|
237
265
|
]
|
|
238
266
|
}),
|
|
239
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ p("div", {
|
|
240
268
|
className: "flex justify-end",
|
|
241
|
-
children: /* @__PURE__ */
|
|
269
|
+
children: /* @__PURE__ */ m(_, {
|
|
242
270
|
type: "submit",
|
|
243
|
-
disabled:
|
|
244
|
-
children: [/* @__PURE__ */
|
|
271
|
+
disabled: I,
|
|
272
|
+
children: [/* @__PURE__ */ p(g, { className: "h-4 w-4" }), I ? "Saving..." : "Save Sponsor"]
|
|
245
273
|
})
|
|
246
274
|
})
|
|
247
275
|
]
|
|
248
|
-
})
|
|
249
|
-
|
|
276
|
+
}) })
|
|
277
|
+
]
|
|
250
278
|
});
|
|
251
279
|
}
|
|
252
280
|
//#endregion
|
|
253
|
-
export {
|
|
281
|
+
export { S as default };
|
|
254
282
|
|
|
255
283
|
//# sourceMappingURL=SponsorFormPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SponsorFormPage.js","names":[],"sources":["../../../../src/eventfullymanaged/pages/sponsors/SponsorFormPage.tsx"],"sourcesContent":["/* eslint-disable react-hooks/set-state-in-effect */\nimport { ArrowLeft, Save } from 'lucide-react';\nimport { Button, GlassCard, Input } from '@burdenoff/fe-libs/ui';\nimport { useEffect, useMemo, useState } from 'react';\nimport { useParams } from 'react-router-dom';\n\nimport {\n useCreateSponsorMutation,\n useEventsQuery,\n useSponsorsQuery,\n useUpdateSponsorMutation,\n} from '../../api/eventApi';\nimport { useEventfullyManaged } from '../../context/EventfullyManagedContext';\n\ntype SponsorFormState = {\n eventId: string;\n name: string;\n level: string;\n website: string;\n contactName: string;\n contactEmail: string;\n contactPhone: string;\n value: string;\n leads: string;\n};\n\nconst initialState: SponsorFormState = {\n eventId: '',\n name: '',\n level: 'BRONZE',\n website: '',\n contactName: '',\n contactEmail: '',\n contactPhone: '',\n value: '0',\n leads: '0',\n};\n\nexport default function SponsorFormPage() {\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 const { data: sponsorsData } = useSponsorsQuery({ limit: 100, offset: 0 });\n\n const existingSponsor = useMemo(\n () => (sponsorsData?.sponsors?.items ?? []).find((item: { id: string }) => item.id === id),\n [id, sponsorsData]\n );\n\n const [createSponsor, { loading: creating }] = useCreateSponsorMutation();\n const [updateSponsor, { loading: updating }] = useUpdateSponsorMutation();\n const [form, setForm] = useState<SponsorFormState>(() => {\n if (!existingSponsor) {\n return initialState;\n }\n return {\n eventId: existingSponsor.eventId ?? '',\n name: existingSponsor.name ?? '',\n level: existingSponsor.level ?? 'BRONZE',\n website: existingSponsor.website ?? '',\n contactName: existingSponsor.contactName ?? '',\n contactEmail: existingSponsor.contactEmail ?? '',\n contactPhone: existingSponsor.contactPhone ?? '',\n value: String(existingSponsor.metrics?.value ?? 0),\n leads: String(existingSponsor.metrics?.leads ?? 0),\n };\n });\n\n useEffect(() => {\n if (!existingSponsor) {\n return;\n }\n setForm({\n eventId: existingSponsor.eventId ?? '',\n name: existingSponsor.name ?? '',\n level: existingSponsor.level ?? 'BRONZE',\n website: existingSponsor.website ?? '',\n contactName: existingSponsor.contactName ?? '',\n contactEmail: existingSponsor.contactEmail ?? '',\n contactPhone: existingSponsor.contactPhone ?? '',\n value: String(existingSponsor.metrics?.value ?? 0),\n leads: String(existingSponsor.metrics?.leads ?? 0),\n });\n }, [existingSponsor]);\n\n const onChange = (field: keyof SponsorFormState, value: string) => {\n setForm((prev) => ({ ...prev, [field]: value }));\n };\n\n const onSubmit = async (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n const input = {\n eventId: form.eventId,\n name: form.name,\n level: form.level,\n website: form.website,\n contactName: form.contactName,\n contactEmail: form.contactEmail,\n contactPhone: form.contactPhone,\n metrics: {\n value: Number(form.value || 0),\n leads: Number(form.leads || 0),\n },\n metadata: {},\n };\n\n if (isEdit) {\n await updateSponsor({ variables: { id, input } });\n navigate('/sponsors');\n return;\n }\n\n await createSponsor({ variables: { input } });\n navigate('/sponsors');\n };\n\n const saving = creating || updating;\n const events = eventsData?.events?.items ?? [];\n const selectClass =\n 'w-full rounded-input border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary transition-colors focus-visible:border-border-focus focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus)] focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]';\n\n return (\n <div className=\"space-y-6 p-6\">\n <div>\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" onClick={() => navigate('/sponsors')}>\n <ArrowLeft className=\"h-4 w-4\" />\n Back to Sponsors\n </Button>\n <h1 className=\"mt-3 text-2xl font-bold text-text-primary\">{isEdit ? 'Edit Sponsor' : 'Create Sponsor'}</h1>\n </div>\n\n <GlassCard treatment=\"plain\" className=\"border-border-seam p-5\">\n <form onSubmit={onSubmit} className=\"space-y-4\">\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\n value={form.eventId}\n onChange={(e) => onChange('eventId', e.target.value)}\n required\n className={selectClass}\n >\n <option value=\"\">Select Event</option>\n {events.map((eventItem: { id: string; name: string }) => (\n <option key={eventItem.id} value={eventItem.id}>\n {eventItem.name}\n </option>\n ))}\n </select>\n </label>\n\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Sponsor 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\">Level</span>\n <select value={form.level} onChange={(e) => onChange('level', e.target.value)} className={selectClass}>\n <option value=\"PLATINUM\">Platinum</option>\n <option value=\"GOLD\">Gold</option>\n <option value=\"SILVER\">Silver</option>\n <option value=\"BRONZE\">Bronze</option>\n <option value=\"COMMUNITY\">Community</option>\n </select>\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Value</span>\n <Input type=\"number\" min=\"0\" value={form.value} onChange={(e) => onChange('value', e.target.value)} />\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Leads</span>\n <Input type=\"number\" min=\"0\" value={form.leads} onChange={(e) => onChange('leads', e.target.value)} />\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 value={form.website} onChange={(e) => onChange('website', e.target.value)} />\n </label>\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\">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\n type=\"email\"\n value={form.contactEmail}\n onChange={(e) => onChange('contactEmail', e.target.value)}\n />\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Contact Phone</span>\n <Input value={form.contactPhone} onChange={(e) => onChange('contactPhone', e.target.value)} />\n </label>\n </div>\n\n <div className=\"flex justify-end\">\n <Button type=\"submit\" disabled={saving}>\n <Save className=\"h-4 w-4\" />\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B,IAAS,cAAc,eACjB;;MACL,CAAA;KACD;;GACG,CAAA,CACR"}
|
|
1
|
+
{"version":3,"file":"SponsorFormPage.js","names":[],"sources":["../../../../src/eventfullymanaged/pages/sponsors/SponsorFormPage.tsx"],"sourcesContent":["/* eslint-disable react-hooks/set-state-in-effect */\nimport { ArrowLeft, Save } from 'lucide-react';\nimport { Button, EmphasisPanel, Input, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { useEffect, useMemo, useState } from 'react';\nimport { useParams } from 'react-router-dom';\n\nimport {\n useCreateSponsorMutation,\n useEventsQuery,\n useSponsorsQuery,\n useUpdateSponsorMutation,\n} from '../../api/eventApi';\nimport { ImageUploadField } from '../../components/ImageUploadField';\nimport { useEventfullyManaged } from '../../context/EventfullyManagedContext';\nimport { describeError, mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\n\ntype SponsorFormState = {\n eventId: string;\n name: string;\n level: string;\n logoUrl: string;\n website: string;\n contactName: string;\n contactEmail: string;\n contactPhone: string;\n value: string;\n leads: string;\n};\n\nconst initialState: SponsorFormState = {\n eventId: '',\n name: '',\n level: 'BRONZE',\n logoUrl: '',\n website: '',\n contactName: '',\n contactEmail: '',\n contactPhone: '',\n value: '0',\n leads: '0',\n};\n\nexport default function SponsorFormPage() {\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 const { data: sponsorsData } = useSponsorsQuery({ limit: 100, offset: 0 });\n\n const existingSponsor = useMemo(\n () => (sponsorsData?.sponsors?.items ?? []).find((item: { id: string }) => item.id === id),\n [id, sponsorsData]\n );\n\n const [createSponsor, { loading: creating }] = useCreateSponsorMutation();\n const [updateSponsor, { loading: updating }] = useUpdateSponsorMutation();\n const [form, setForm] = useState<SponsorFormState>(() => {\n if (!existingSponsor) {\n return initialState;\n }\n return {\n eventId: existingSponsor.eventId ?? '',\n name: existingSponsor.name ?? '',\n level: existingSponsor.level ?? 'BRONZE',\n logoUrl: existingSponsor.logoUrl ?? '',\n website: existingSponsor.website ?? '',\n contactName: existingSponsor.contactName ?? '',\n contactEmail: existingSponsor.contactEmail ?? '',\n contactPhone: existingSponsor.contactPhone ?? '',\n value: String(existingSponsor.metrics?.value ?? 0),\n leads: String(existingSponsor.metrics?.leads ?? 0),\n };\n });\n\n useEffect(() => {\n if (!existingSponsor) {\n return;\n }\n setForm({\n eventId: existingSponsor.eventId ?? '',\n name: existingSponsor.name ?? '',\n level: existingSponsor.level ?? 'BRONZE',\n logoUrl: existingSponsor.logoUrl ?? '',\n website: existingSponsor.website ?? '',\n contactName: existingSponsor.contactName ?? '',\n contactEmail: existingSponsor.contactEmail ?? '',\n contactPhone: existingSponsor.contactPhone ?? '',\n value: String(existingSponsor.metrics?.value ?? 0),\n leads: String(existingSponsor.metrics?.leads ?? 0),\n });\n }, [existingSponsor]);\n\n const onChange = (field: keyof SponsorFormState, value: string) => {\n setForm((prev) => ({ ...prev, [field]: value }));\n };\n\n const onSubmit = async (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n const input = {\n eventId: form.eventId,\n name: form.name,\n level: form.level,\n logoUrl: form.logoUrl,\n website: form.website,\n contactName: form.contactName,\n contactEmail: form.contactEmail,\n contactPhone: form.contactPhone,\n metrics: {\n value: Number(form.value || 0),\n leads: Number(form.leads || 0),\n },\n metadata: {},\n };\n\n try {\n if (isEdit) {\n const response = await updateSponsor({ variables: { id, input } });\n if (!mutationSucceeded(response, response.data?.updateSponsor?.id, 'Could not update sponsor')) {\n return;\n }\n navigate('/sponsors');\n return;\n }\n\n const response = await createSponsor({ variables: { input } });\n if (!mutationSucceeded(response, response.data?.createSponsor?.id, 'Could not create sponsor')) {\n return;\n }\n navigate('/sponsors');\n } catch (error) {\n notify.error('Could not save sponsor', describeError(error));\n }\n };\n\n const saving = creating || updating;\n const events = eventsData?.events?.items ?? [];\n const selectClass =\n 'w-full rounded-input border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary transition-colors focus-visible:border-border-focus focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus)] focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]';\n\n return (\n <div className=\"space-y-6 p-6\">\n <div>\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" onClick={() => navigate('/sponsors')}>\n <ArrowLeft className=\"h-4 w-4\" />\n Back to Sponsors\n </Button>\n <h1 className=\"mt-3 text-2xl font-bold text-text-primary\">{isEdit ? 'Edit Sponsor' : 'Create Sponsor'}</h1>\n </div>\n\n <PagePurpose>\n Capture a sponsor and the deal behind it. Link them to an event, set their tier, and record the contract value\n and leads target so you can measure ROI later. The contact fields are who you will work with day to day, so keep\n them accurate.\n </PagePurpose>\n\n <EmphasisPanel>\n <form onSubmit={onSubmit} className=\"space-y-4\">\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\n value={form.eventId}\n onChange={(e) => onChange('eventId', e.target.value)}\n required\n className={selectClass}\n >\n <option value=\"\">Select Event</option>\n {events.map((eventItem: { id: string; name: string }) => (\n <option key={eventItem.id} value={eventItem.id}>\n {eventItem.name}\n </option>\n ))}\n </select>\n </label>\n\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Sponsor 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\">Level</span>\n <select value={form.level} onChange={(e) => onChange('level', e.target.value)} className={selectClass}>\n <option value=\"PLATINUM\">Platinum</option>\n <option value=\"GOLD\">Gold</option>\n <option value=\"SILVER\">Silver</option>\n <option value=\"BRONZE\">Bronze</option>\n <option value=\"COMMUNITY\">Community</option>\n </select>\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Value</span>\n <Input type=\"number\" min=\"0\" value={form.value} onChange={(e) => onChange('value', e.target.value)} />\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Leads</span>\n <Input type=\"number\" min=\"0\" value={form.leads} onChange={(e) => onChange('leads', e.target.value)} />\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 value={form.website} onChange={(e) => onChange('website', e.target.value)} />\n </label>\n\n <div className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Logo</span>\n <ImageUploadField\n label=\"Upload logo\"\n folderPath=\"/EventfullyManaged/Sponsors\"\n value={form.logoUrl || null}\n onUploaded={(url) => onChange('logoUrl', url)}\n hint=\"Stored securely in Files. Shown across sponsor listings and detail pages.\"\n />\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\">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\n type=\"email\"\n value={form.contactEmail}\n onChange={(e) => onChange('contactEmail', e.target.value)}\n />\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Contact Phone</span>\n <Input value={form.contactPhone} onChange={(e) => onChange('contactPhone', e.target.value)} />\n </label>\n </div>\n\n <div className=\"flex justify-end\">\n <Button type=\"submit\" disabled={saving}>\n <Save className=\"h-4 w-4\" />\n {saving ? 'Saving...' : 'Save Sponsor'}\n </Button>\n </div>\n </form>\n </EmphasisPanel>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AA8BA,IAAM,IAAiC;CACrC,SAAS;CACT,MAAM;CACN,OAAO;CACP,SAAS;CACT,SAAS;CACT,aAAa;CACb,cAAc;CACd,cAAc;CACd,O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;OACR,kBAAC,SAAD;QAAO,WAAU;kBAAjB,CACE,kBAAC,QAAD;SAAM,WAAU;mBAAgC;SAAoB,CAAA,EACpE,kBAAC,GAAD;SAAO,OAAO,EAAK;SAAc,WAAW,MAAM,EAAS,gBAAgB,EAAE,OAAO,MAAM;SAAI,CAAA,CACxF;;OACJ;;KAEN,kBAAC,OAAD;MAAK,WAAU;gBACb,kBAAC,GAAD;OAAQ,MAAK;OAAS,UAAU;iBAAhC,CACE,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA,EAC3B,IAAS,cAAc,eACjB;;MACL,CAAA;KACD;OACO,CAAA;GACZ"}
|
|
@@ -3,17 +3,18 @@ import { useSponsorsQuery as t } from "../../api/eventApi.js";
|
|
|
3
3
|
import { useMemo as n, useState as r } from "react";
|
|
4
4
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
import { Building2 as o, Mail as s, Phone as c, Plus as l, Search as u } from "lucide-react";
|
|
6
|
-
import { Badge as d, Button as f, GlassCard as p, IllustratedEmptyState as m, Input as h } from "@burdenoff/fe-libs/ui";
|
|
6
|
+
import { Badge as d, Button as f, GlassCard as p, IllustratedEmptyState as m, Input as h, PagePurpose as g } from "@burdenoff/fe-libs/ui";
|
|
7
7
|
//#region src/eventfullymanaged/pages/sponsors/SponsorsListPage.tsx
|
|
8
|
-
function
|
|
9
|
-
let { navigate:
|
|
10
|
-
search:
|
|
8
|
+
function _() {
|
|
9
|
+
let { navigate: _ } = e(), [v, y] = r(""), { data: b, loading: x } = t({
|
|
10
|
+
search: v,
|
|
11
11
|
limit: 100,
|
|
12
12
|
offset: 0
|
|
13
|
-
}),
|
|
13
|
+
}), S = n(() => b?.sponsors?.items ?? [], [b]), C = S.reduce((e, t) => e + Number(t.metrics?.value ?? 0), 0), w = S.reduce((e, t) => e + Number(t.metrics?.leads ?? 0), 0);
|
|
14
14
|
return /* @__PURE__ */ a("div", {
|
|
15
15
|
className: "space-y-6 p-6",
|
|
16
16
|
children: [
|
|
17
|
+
/* @__PURE__ */ i(g, { children: "Sponsors fund your event in exchange for visibility and leads. Track each one here — their tier, the contract value they bring, and the leads they generate — so you can prove ROI and keep the relationship warm for next time. The highlighted cards summarize your sponsor portfolio at a glance." }),
|
|
17
18
|
/* @__PURE__ */ a("div", {
|
|
18
19
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
19
20
|
children: [/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("h1", {
|
|
@@ -24,7 +25,7 @@ function g() {
|
|
|
24
25
|
children: "Manage event sponsors with live API data."
|
|
25
26
|
})] }), /* @__PURE__ */ a(f, {
|
|
26
27
|
type: "button",
|
|
27
|
-
onClick: () =>
|
|
28
|
+
onClick: () => _("/sponsors/create"),
|
|
28
29
|
children: [/* @__PURE__ */ i(l, { className: "h-4 w-4" }), "Add Sponsor"]
|
|
29
30
|
})]
|
|
30
31
|
}),
|
|
@@ -40,7 +41,7 @@ function g() {
|
|
|
40
41
|
children: "Total Sponsors"
|
|
41
42
|
}), /* @__PURE__ */ i("p", {
|
|
42
43
|
className: "mt-1 text-2xl font-bold tabular-nums text-text-primary",
|
|
43
|
-
children:
|
|
44
|
+
children: S.length
|
|
44
45
|
})]
|
|
45
46
|
}),
|
|
46
47
|
/* @__PURE__ */ a(p, {
|
|
@@ -51,7 +52,7 @@ function g() {
|
|
|
51
52
|
children: "Total Contract Value"
|
|
52
53
|
}), /* @__PURE__ */ a("p", {
|
|
53
54
|
className: "mt-1 text-2xl font-bold tabular-nums text-text-primary",
|
|
54
|
-
children: ["$",
|
|
55
|
+
children: ["$", C.toLocaleString()]
|
|
55
56
|
})]
|
|
56
57
|
}),
|
|
57
58
|
/* @__PURE__ */ a(p, {
|
|
@@ -62,7 +63,7 @@ function g() {
|
|
|
62
63
|
children: "Total Leads"
|
|
63
64
|
}), /* @__PURE__ */ i("p", {
|
|
64
65
|
className: "mt-1 text-2xl font-bold tabular-nums text-text-primary",
|
|
65
|
-
children:
|
|
66
|
+
children: w.toLocaleString()
|
|
66
67
|
})]
|
|
67
68
|
})
|
|
68
69
|
]
|
|
@@ -71,40 +72,40 @@ function g() {
|
|
|
71
72
|
className: "relative",
|
|
72
73
|
children: [/* @__PURE__ */ i(u, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-muted" }), /* @__PURE__ */ i(h, {
|
|
73
74
|
type: "text",
|
|
74
|
-
value:
|
|
75
|
-
onChange: (e) =>
|
|
75
|
+
value: v,
|
|
76
|
+
onChange: (e) => y(e.target.value),
|
|
76
77
|
placeholder: "Search sponsors",
|
|
77
78
|
"aria-label": "Search sponsors",
|
|
78
79
|
className: "pl-10"
|
|
79
80
|
})]
|
|
80
81
|
}),
|
|
81
|
-
|
|
82
|
+
x ? /* @__PURE__ */ i(p, {
|
|
82
83
|
treatment: "plain",
|
|
83
84
|
className: "border-border-seam p-8 text-center text-sm text-text-secondary",
|
|
84
85
|
children: "Loading sponsors..."
|
|
85
|
-
}) :
|
|
86
|
+
}) : S.length === 0 ? /* @__PURE__ */ i(p, {
|
|
86
87
|
treatment: "plain",
|
|
87
88
|
className: "border-border-seam",
|
|
88
89
|
children: /* @__PURE__ */ i(m, {
|
|
89
|
-
illustration:
|
|
90
|
-
title:
|
|
91
|
-
description:
|
|
92
|
-
action:
|
|
90
|
+
illustration: v ? "empty-search" : "empty-people",
|
|
91
|
+
title: v ? "No sponsors match your search." : "No sponsors yet.",
|
|
92
|
+
description: v ? "Try a different name." : "Add your first sponsor to start tracking value and leads.",
|
|
93
|
+
action: v ? void 0 : /* @__PURE__ */ a(f, {
|
|
93
94
|
type: "button",
|
|
94
|
-
onClick: () =>
|
|
95
|
+
onClick: () => _("/sponsors/create"),
|
|
95
96
|
children: [/* @__PURE__ */ i(l, { className: "h-4 w-4" }), "Add Sponsor"]
|
|
96
97
|
})
|
|
97
98
|
})
|
|
98
99
|
}) : /* @__PURE__ */ i("div", {
|
|
99
100
|
className: "space-y-4",
|
|
100
|
-
children:
|
|
101
|
+
children: S.map((e) => /* @__PURE__ */ a(p, {
|
|
101
102
|
treatment: "plain",
|
|
102
103
|
className: "border-border-seam p-5",
|
|
103
104
|
children: [/* @__PURE__ */ a("div", {
|
|
104
105
|
className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
|
|
105
106
|
children: [/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("button", {
|
|
106
107
|
type: "button",
|
|
107
|
-
onClick: () =>
|
|
108
|
+
onClick: () => _(`/sponsors/${e.id}/edit`),
|
|
108
109
|
className: "rounded-button text-left text-lg font-semibold text-text-primary transition-colors hover:text-text-link focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]",
|
|
109
110
|
children: e.name
|
|
110
111
|
}), /* @__PURE__ */ a("div", {
|
|
@@ -144,6 +145,6 @@ function g() {
|
|
|
144
145
|
});
|
|
145
146
|
}
|
|
146
147
|
//#endregion
|
|
147
|
-
export {
|
|
148
|
+
export { _ as default };
|
|
148
149
|
|
|
149
150
|
//# sourceMappingURL=SponsorsListPage.js.map
|